2011-10-14 02:41:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								/* ----------------------------------------------------------------------------
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  GTSAM  Copyright  2010 ,  Georgia  Tech  Research  Corporation ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  Atlanta ,  Georgia  30332 - 0415 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  All  Rights  Reserved 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  Authors :  Frank  Dellaert ,  et  al .  ( see  THANKS  for  the  full  author  list ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  See  LICENSE  for  the  license  information 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/**
  
						 
					
						
							
								
									
										
										
										
											2011-10-14 11:23:14 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  @ file  Class . h 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @ brief  describe  the  C + +  class  that  is  being  wrapped 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @ author  Frank  Dellaert 
							 
						 
					
						
							
								
									
										
										
										
											2012-06-27 02:52:27 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  @ author  Andrew  Melim 
							 
						 
					
						
							
								
									
										
										
										
											2011-10-14 02:41:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 * */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# pragma once 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  <string> 
  
						 
					
						
							
								
									
										
										
										
											2012-07-05 22:05:00 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  <map> 
  
						 
					
						
							
								
									
										
										
										
											2011-10-14 02:41:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "Constructor.h" 
  
						 
					
						
							
								
									
										
										
										
											2012-03-30 13:34:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Deconstructor.h" 
  
						 
					
						
							
								
									
										
										
										
											2011-10-14 02:41:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# include  "Method.h" 
  
						 
					
						
							
								
									
										
										
										
											2011-12-02 10:32:18 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "StaticMethod.h" 
  
						 
					
						
							
								
									
										
										
										
											2011-10-14 02:41:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-12-03 00:43:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								namespace  wrap  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-10-14 12:43:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/// Class has name, constructors, methods
  
						 
					
						
							
								
									
										
										
										
											2011-10-14 02:41:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								struct  Class  {  
						 
					
						
							
								
									
										
										
										
											2012-07-05 22:05:00 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									typedef  std : : map < std : : string ,  Method >  Methods ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									typedef  std : : map < std : : string ,  StaticMethod >  StaticMethods ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-10-14 12:43:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  /// Constructor creates an empty class
 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-10 22:21:58 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  Class ( bool  verbose = true )  :  isVirtual ( false ) ,  verbose_ ( verbose )  { } 
							 
						 
					
						
							
								
									
										
										
										
											2011-10-14 02:41:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-10-14 12:43:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									// Then the instance variables are set directly by the Module constructor
 
							 
						 
					
						
							
								
									
										
										
										
											2011-12-09 23:44:35 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  std : : string  name ;                          ///< Class name
 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-12 10:11:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : vector < std : : string >  templateArgs ;          ///< Template arguments
 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-12 05:43:16 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : string  typedefName ;                   ///< The name to typedef *from*, if this class is actually a typedef, i.e. typedef [typedefName] [name]
 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-10 04:19:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bool  isVirtual ;                            ///< Whether the class is part of a virtual inheritance chain
 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-08 20:27:39 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : vector < std : : string >  qualifiedParent ;  ///< The *single* parent - the last string is the parent class name, preceededing elements are a namespace stack
 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-05 22:05:00 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  Methods  methods ;                           ///< Class methods
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  StaticMethods  static_methods ;              ///< Static methods
 
							 
						 
					
						
							
								
									
										
										
										
											2011-12-09 23:44:35 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  std : : vector < std : : string >  namespaces ;       ///< Stack of namespaces
 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-05 22:04:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  std : : vector < std : : string >  using_namespaces ; ///< default namespaces
 
							 
						 
					
						
							
								
									
										
										
										
											2011-12-09 23:44:35 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  std : : vector < std : : string >  includes ;         ///< header include overrides
 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-05 22:04:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  Constructor  constructor ;                   ///< Class constructors
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Deconstructor  deconstructor ;               ///< Deconstructor to deallocate C++ object
 
							 
						 
					
						
							
								
									
										
										
										
											2011-12-09 23:44:35 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  bool  verbose_ ;                             ///< verbose flag
 
							 
						 
					
						
							
								
									
										
										
										
											2011-10-14 12:43:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  // And finally MATLAB code is emitted, methods below called by Module::matlab_code
 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-10 04:19:37 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  void  matlab_proxy ( const  std : : string &  classFile ,  const  std : : string &  wrapperName ,  const  ReturnValue : : TypeAttributesTable &  typeAttributes , 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-05 22:04:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										FileWriter &  wrapperFile ,  std : : vector < std : : string > &  functionNames )  const ;           ///< emit proxy class
 
							 
						 
					
						
							
								
									
										
										
										
											2011-12-09 04:51:13 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  std : : string  qualifiedName ( const  std : : string &  delim  =  " " )  const ;  ///< creates a namespace-qualified name, optional delimiter
 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-05 22:04:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-07-12 05:43:16 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									std : : vector < Class >  expandTemplate ( const  std : : string &  templateArg ,  const  std : : vector < std : : vector < std : : string >  > &  instantiations )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-12 10:11:29 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Class  expandTemplate ( const  std : : string &  templateArg ,  const  std : : vector < std : : string > &  instantiation )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2012-07-12 05:43:16 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// The typedef line for this class, if this class is a typedef, otherwise returns an empty string.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									std : : string  getTypedef ( )  const ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2012-07-05 22:04:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								private :  
						 
					
						
							
								
									
										
										
										
											2012-07-11 23:44:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  pointer_constructor_fragments ( FileWriter &  proxyFile ,  FileWriter &  wrapperFile ,  const  std : : string &  wrapperName ,  std : : vector < std : : string > &  functionNames )  const ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-10-14 02:41:56 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-12-03 00:43:15 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  // \namespace wrap