| 
									
										
										
										
											2021-03-25 12:49:51 +08:00
										 |  |  | class FunRange {
 | 
					
						
							|  |  |  |   FunRange(); | 
					
						
							|  |  |  |   This range(double d); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   static This create(); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | template<M={double}> | 
					
						
							|  |  |  | class Fun {
 | 
					
						
							| 
									
										
										
										
											2021-09-18 14:17:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-26 01:32:38 +08:00
										 |  |  |   static This staticMethodWithThis(); | 
					
						
							| 
									
										
										
										
											2021-03-25 12:49:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-26 00:46:06 +08:00
										 |  |  |   template<T={int}> | 
					
						
							|  |  |  |   static double templatedStaticMethod(const T& m); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-25 12:49:51 +08:00
										 |  |  |   template<T={string}> | 
					
						
							| 
									
										
										
										
											2021-03-26 01:32:38 +08:00
										 |  |  |   This templatedMethod(double d, T t); | 
					
						
							| 
									
										
										
										
											2021-03-25 12:49:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-26 01:32:38 +08:00
										 |  |  |   template<T={string}, U={size_t}> | 
					
						
							|  |  |  |   This multiTemplatedMethod(double d, T t, U u); | 
					
						
							| 
									
										
										
										
											2021-12-07 00:01:43 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   std::map<M, This::M> sets(); | 
					
						
							| 
									
										
										
										
											2021-03-25 12:49:51 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // An include! Can go anywhere outside of a class, in any order | 
					
						
							|  |  |  | #include <folder/path/to/Test.h> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Test {
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /* a comment! */ | 
					
						
							|  |  |  |   // another comment | 
					
						
							|  |  |  |   Test(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Test a shared ptr property | 
					
						
							|  |  |  |   gtsam::noiseModel::Base* model_ptr; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   pair<Vector,Matrix> return_pair (Vector v, Matrix A) const; // intentionally the first method | 
					
						
							|  |  |  |   pair<Vector,Matrix> return_pair (Vector v) const; // overload | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   bool   return_bool   (bool   value) const; // comment after a line! | 
					
						
							|  |  |  |   size_t return_size_t (size_t value) const; | 
					
						
							|  |  |  |   int    return_int    (int    value) const; | 
					
						
							|  |  |  |   double return_double (double value) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Test(double a, Matrix b); // a constructor in the middle of a class | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // comments in the middle! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // (more) comments in the middle! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   string return_string (string value) const; | 
					
						
							|  |  |  |   Vector return_vector1(Vector value) const; | 
					
						
							|  |  |  |   Matrix return_matrix1(Matrix value) const; | 
					
						
							|  |  |  |   Vector return_vector2(Vector value) const; | 
					
						
							|  |  |  |   Matrix return_matrix2(Matrix value) const; | 
					
						
							|  |  |  |   void arg_EigenConstRef(const Matrix& value) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   bool return_field(const Test& t) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Test* return_TestPtr(const Test* value) const; | 
					
						
							|  |  |  |   Test  return_Test(Test* value) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   gtsam::Point2* return_Point2Ptr(bool value) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   pair<Test*,Test*> create_ptrs () const; | 
					
						
							|  |  |  |   pair<Test ,Test*> create_MixedPtrs () const; | 
					
						
							|  |  |  |   pair<Test*,Test*> return_ptrs (Test* p1, Test* p2) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-17 01:51:43 +08:00
										 |  |  |   // This should be callable as .print() in python | 
					
						
							| 
									
										
										
										
											2021-03-25 12:49:51 +08:00
										 |  |  |   void print() const; | 
					
						
							| 
									
										
										
										
											2021-06-17 01:51:43 +08:00
										 |  |  |   // Since this is a reserved keyword, it should be updated to `lambda_` | 
					
						
							|  |  |  |   void lambda() const; | 
					
						
							| 
									
										
										
										
											2021-03-25 12:49:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-02 11:20:12 +08:00
										 |  |  |   void set_container(std::vector<testing::Test> container); | 
					
						
							|  |  |  |   void set_container(std::vector<testing::Test*> container); | 
					
						
							|  |  |  |   void set_container(std::vector<testing::Test&> container); | 
					
						
							|  |  |  |   std::vector<testing::Test*> get_container() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-25 22:12:24 +08:00
										 |  |  |   // special ipython method | 
					
						
							|  |  |  |   string markdown(const gtsam::KeyFormatter& keyFormatter = | 
					
						
							|  |  |  |                  gtsam::DefaultKeyFormatter) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-25 12:49:51 +08:00
										 |  |  |   // comments at the end! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // even more comments at the end! | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | virtual class ns::OtherClass; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // A doubly templated class | 
					
						
							|  |  |  | template<POSE, POINT> | 
					
						
							|  |  |  | class MyFactor {
 | 
					
						
							|  |  |  |   MyFactor(size_t key1, size_t key2, double measured, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							| 
									
										
										
										
											2021-04-17 09:07:09 +08:00
										 |  |  |   void print(const string &s = "factor: ", | 
					
						
							|  |  |  |              const gtsam::KeyFormatter &keyFormatter = gtsam::DefaultKeyFormatter); | 
					
						
							| 
									
										
										
										
											2021-03-25 12:49:51 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // and a typedef specializing it | 
					
						
							|  |  |  | typedef MyFactor<gtsam::Pose2, Matrix> MyFactorPosePoint2; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | template<T = {double}> | 
					
						
							|  |  |  | class PrimitiveRef {
 | 
					
						
							|  |  |  |   PrimitiveRef(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   static This Brutal(const T& t); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // A class with integer template arguments | 
					
						
							|  |  |  | template<N = {3,12}> | 
					
						
							|  |  |  | class MyVector {
 | 
					
						
							|  |  |  |   MyVector(); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // comments at the end! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // even more comments at the end! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Class with multiple instantiated templates | 
					
						
							|  |  |  | template<T = {int}, U = {double, float}> | 
					
						
							|  |  |  | class MultipleTemplates {}; | 
					
						
							| 
									
										
										
										
											2021-06-17 01:51:43 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // Test for default args in constructor | 
					
						
							|  |  |  | class ForwardKinematics {
 | 
					
						
							|  |  |  |   ForwardKinematics(const gtdynamics::Robot& robot, | 
					
						
							|  |  |  |                     const string& start_link_name, const string& end_link_name, | 
					
						
							|  |  |  |                     const gtsam::Values& joint_angles, | 
					
						
							|  |  |  |                     const gtsam::Pose3& l2Tp = gtsam::Pose3()); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-18 14:17:47 +08:00
										 |  |  | // Test for templated constructor | 
					
						
							|  |  |  | class TemplatedConstructor {
 | 
					
						
							|  |  |  |   TemplatedConstructor(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   template<T={string, int, double}> | 
					
						
							|  |  |  |   TemplatedConstructor(const T& arg); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-17 01:51:43 +08:00
										 |  |  | class SuperCoolFactor; | 
					
						
							|  |  |  | typedef SuperCoolFactor<gtsam::Pose3> SuperCoolFactorPose3; |