| 
									
										
										
										
											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 Method.h | 
					
						
							|  |  |  |  * @brief describes and generates code for methods | 
					
						
							|  |  |  |  * @author Frank Dellaert | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  |  **/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <string>
 | 
					
						
							|  |  |  | #include <list>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "Argument.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-14 11:23:14 +08:00
										 |  |  | /// Method class
 | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  | struct Method { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:06 +08:00
										 |  |  | 	/// Constructor creates empty object
 | 
					
						
							|  |  |  | 	Method(bool verbose = true) : | 
					
						
							| 
									
										
										
										
											2011-10-21 10:35:11 +08:00
										 |  |  | 			returns_ptr_(false), returns_ptr2_(false), returns_pair_(false), verbose_( | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:06 +08:00
										 |  |  | 					verbose) { | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Then the instance variables are set directly by the Module constructor
 | 
					
						
							| 
									
										
										
										
											2011-10-21 10:35:11 +08:00
										 |  |  | 	bool is_const_; | 
					
						
							|  |  |  | 	ArgumentList args_; | 
					
						
							|  |  |  | 	std::string returns_, returns2_, name_; | 
					
						
							|  |  |  | 	bool returns_ptr_, returns_ptr2_, returns_pair_; | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:06 +08:00
										 |  |  | 	bool verbose_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	enum pairing { | 
					
						
							|  |  |  | 		arg1, arg2, pair | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 	std::string return_type(bool add_ptr, pairing p); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// MATLAB code generation
 | 
					
						
							|  |  |  | 	// classPath is class directory, e.g., ../matlab/@Point2
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void matlab_mfile(const std::string& classPath); ///< m-file
 | 
					
						
							|  |  |  | 	void matlab_wrapper(const std::string& classPath, | 
					
						
							|  |  |  | 			const std::string& className, const std::string& nameSpace); ///< wrapper
 | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 |