| 
									
										
										
										
											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 { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:06 +08:00
										 |  |  | 	/// Constructor creates an empty class
 | 
					
						
							| 
									
										
										
										
											2012-06-30 02:38:54 +08:00
										 |  |  | 	Constructor(bool verbose = false) : | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:06 +08:00
										 |  |  | 			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
 | 
					
						
							| 
									
										
										
										
											2012-06-27 02:52:27 +08:00
										 |  |  |     std::vector<ArgumentList> args_list; | 
					
						
							| 
									
										
										
										
											2011-12-09 04:51:13 +08:00
										 |  |  | 	std::string name; | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:06 +08:00
										 |  |  | 	bool verbose_; | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:06 +08:00
										 |  |  | 	// MATLAB code generation
 | 
					
						
							|  |  |  | 	// toolboxPath is main toolbox directory, e.g., ../matlab
 | 
					
						
							|  |  |  | 	// classFile is class proxy file, e.g., ../matlab/@Point2/Point2.m
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/// wrapper name
 | 
					
						
							| 
									
										
										
										
											2011-12-12 05:09:07 +08:00
										 |  |  | 	std::string matlab_wrapper_name(const std::string& className) const; | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:06 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-10 13:06:46 +08:00
										 |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * Create fragment to select constructor in proxy class, e.g., | 
					
						
							|  |  |  | 	 * if nargin == 2, obj.self = new_Pose3_RP(varargin{1},varargin{2}); end | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2012-07-05 22:04:36 +08:00
										 |  |  | 	void proxy_fragment(FileWriter& file, const std::string& wrapperName, | 
					
						
							| 
									
										
										
										
											2012-07-18 23:47:06 +08:00
										 |  |  | 	        bool hasParent, const int id, const ArgumentList args) const; | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:06 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-09 23:44:35 +08:00
										 |  |  | 	/// cpp wrapper
 | 
					
						
							| 
									
										
										
										
											2012-07-05 22:04:36 +08:00
										 |  |  | 	std::string wrapper_fragment(FileWriter& file, | 
					
						
							| 
									
										
										
										
											2011-12-09 04:51:13 +08:00
										 |  |  | 			 const std::string& cppClassName, | 
					
						
							| 
									
										
										
										
											2012-07-18 23:47:06 +08:00
										 |  |  | 			 const std::string& matlabUniqueName, | 
					
						
							| 
									
										
										
										
											2012-07-09 08:02:43 +08:00
										 |  |  | 			 const std::string& cppBaseClassName, | 
					
						
							| 
									
										
										
										
											2012-07-05 22:04:36 +08:00
										 |  |  | 			 int id, | 
					
						
							| 
									
										
										
										
											2011-12-10 04:29:47 +08:00
										 |  |  | 			 const std::vector<std::string>& using_namespaces, | 
					
						
							| 
									
										
										
										
											2012-07-05 22:04:36 +08:00
										 |  |  | 			 const ArgumentList& al) const; | 
					
						
							| 
									
										
										
										
											2012-06-27 02:52:27 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/// 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
 |