gtsam/wrap/tests/fixtures/class.i

107 lines
2.6 KiB
OpenEdge ABL
Raw Normal View History

class FunRange {
FunRange();
This range(double d);
static This create();
};
template<M={double}>
class Fun {
static This staticMethodWithThis();
template<T={string}>
This templatedMethod(double d, T t);
template<T={string}, U={size_t}>
This multiTemplatedMethod(double d, T t, U u);
};
// 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;
void print() const;
Squashed 'wrap/' changes from 96ccdfd0b..5ddaff8ba 5ddaff8ba Merge pull request #77 from borglab/fix/template-as-template-arg 0b6f2d92b allow templates as paramters to templates 7f3e242b0 Merge pull request #76 from borglab/fix/cmake-config 0caa79b82 macro to find and configure matlab 522557232 fix GTWRAP_INCLUDE_NAME 78a5d3afa Use CMakePackageConfigHelpers to vastly simplify the package config 76f8b9e5d Merge pull request #75 from borglab/fix/template-args 3b8e8389e remove reference from shared pointers 045393c7b docs and flag renaming d23d8beae tests ef96b4bdc don't make template parameters as references d1e1dc697 Merge pull request #74 from borglab/fix/type-recursion 8202ecf10 minor fixes 5855ea85b support for passing templated types as arguments 150cc0578 Support for templated return types 5c58f8d03 Merge pull request #73 from borglab/fix/types-refactor c697aa9c8 refactored the basic and custom types to make it cleaner, added more tests 98e2c3fa1 Merge pull request #68 from borglab/fix/cmake c6d5e786a make config agnostic to install prefix 4d6999f15 Merge pull request #69 from borglab/feature/call-and-index ccf408804 add support for callable and indexing overloads 8f8e3ec93 add status messages 88566eca4 make WRAP_PYTHON_VERSION an optional argument 01b8368ad Merge pull request #67 from borglab/feature/operator-overloading 522a12801 remove unsupported operators 209346133 update check location for unary operator 39e290f60 fix small typo faa589bec update DOCS 7ff83cec8 minor fixes 8ce37766f fixed tests 21c477c4d include pybind11/operators a3534ac5e wrap operator overloads 67c8f2089 instantiate templates for operators e9dce65d8 use ReturnType for ease in other places and use members in Class 3078aa6db added parser rule for operator overloading git-subtree-dir: wrap git-subtree-split: 5ddaff8bab6c05e8a943c94993bf496e13296dd6
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;
// 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);
};
// 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 {};