| 
									
										
										
										
											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 Constructor.h | 
					
						
							|  |  |  |  * @brief class describing a constructor + code generation | 
					
						
							|  |  |  |  * @author Frank Dellaert | 
					
						
							| 
									
										
										
										
											2012-07-13 06:28:28 +08:00
										 |  |  |  * @author Richard Roberts | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  |  **/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <string>
 | 
					
						
							| 
									
										
										
										
											2011-12-09 23:44:35 +08:00
										 |  |  | #include <vector>
 | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "Argument.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-03 00:43:15 +08:00
										 |  |  | namespace wrap { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  | // Constructor class
 | 
					
						
							|  |  |  | struct Constructor { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-02 22:40:07 +08:00
										 |  |  |   /// Constructor creates an empty class
 | 
					
						
							|  |  |  |   Constructor(bool verbose = false) : | 
					
						
							|  |  |  |       verbose_(verbose) { | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-02 22:40:07 +08:00
										 |  |  |   // Then the instance variables are set directly by the Module constructor
 | 
					
						
							| 
									
										
										
										
											2012-06-27 02:52:27 +08:00
										 |  |  |     std::vector<ArgumentList> args_list; | 
					
						
							| 
									
										
										
										
											2012-10-02 22:40:07 +08:00
										 |  |  |   std::string name; | 
					
						
							|  |  |  |   bool verbose_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // MATLAB code generation
 | 
					
						
							|  |  |  |   // toolboxPath is main toolbox directory, e.g., ../matlab
 | 
					
						
							|  |  |  |   // classFile is class proxy file, e.g., ../matlab/@Point2/Point2.m
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /// wrapper name
 | 
					
						
							|  |  |  |   std::string matlab_wrapper_name(const std::string& className) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /**
 | 
					
						
							|  |  |  |    * Create fragment to select constructor in proxy class, e.g., | 
					
						
							|  |  |  |    * if nargin == 2, obj.self = new_Pose3_RP(varargin{1},varargin{2}); end | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   void proxy_fragment(FileWriter& file, const std::string& wrapperName, | 
					
						
							|  |  |  |           bool hasParent, const int id, const ArgumentList args) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /// cpp wrapper
 | 
					
						
							|  |  |  |   std::string wrapper_fragment(FileWriter& file, | 
					
						
							|  |  |  |        const std::string& cppClassName, | 
					
						
							|  |  |  |        const std::string& matlabUniqueName, | 
					
						
							|  |  |  |        const std::string& cppBaseClassName, | 
					
						
							|  |  |  |        int id, | 
					
						
							|  |  |  |        const ArgumentList& al) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /// constructor function
 | 
					
						
							|  |  |  |   void generate_construct(FileWriter& file, const std::string& cppClassName, | 
					
						
							|  |  |  |           std::vector<ArgumentList>& args_list) const; | 
					
						
							|  |  |  |    | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-03 00:43:15 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-27 02:52:27 +08:00
										 |  |  | } // \namespace wrap
 |