Public Member Functions | |
def | __init__ (self, module, module_name, top_module_namespace='', ignore_classes=()) |
def | class_comment (self, instantiated_class) |
def | class_serialize_comment (self, class_name, static_methods) |
def | generate_collector_function (self, func_id) |
def | generate_matlab_wrapper (self) |
def | generate_wrapper (self, namespace) |
def | mex_function (self) |
def | wrap (self) |
def | wrap_class_constructors (self, namespace_name, inst_class, parent_name, ctors, is_virtual) |
def | wrap_class_deconstructor (self, namespace_name, inst_class) |
def | wrap_class_display (self) |
def | wrap_class_methods (self, namespace_name, inst_class, methods, serialize=(False,)) |
def | wrap_class_properties (self, class_name) |
def | wrap_class_serialize_method (self, namespace_name, inst_class) |
def | wrap_collector_function_deserialize (self, class_name, full_name='', namespace='') |
def | wrap_collector_function_return (self, method) |
def | wrap_collector_function_return_types (self, return_type, func_id) |
def | wrap_collector_function_serialize (self, class_name, full_name='', namespace='') |
def | wrap_collector_function_shared_return (self, return_type_name, shared_obj, func_id, new_line=True) |
def | wrap_collector_function_upcast_from_void (self, class_name, func_id, cpp_name) |
def | wrap_global_function (self, function) |
def | wrap_instantiated_class (self, instantiated_class, namespace_name='') |
def | wrap_method (self, methods) |
def | wrap_methods (self, methods, global_funcs=False, global_ns=None) |
def | wrap_namespace (self, namespace, parent=()) |
def | wrap_static_methods (self, namespace_name, instantiated_class, serialize) |
Public Member Functions inherited from object | |
template<typename T > | |
T | cast () const & |
template<typename T > | |
T | cast ()&& |
template<> | |
void | cast () const & |
template<> | |
void | cast ()&& |
object ()=default | |
object (const object &o) | |
Copy constructor; always increases the reference count. More... | |
object (object &&other) noexcept | |
Move constructor; steals the object from other and preserves its reference count. More... | |
object (handle h, borrowed_t) | |
object (handle h, stolen_t) | |
object & | operator= (const object &other) |
object & | operator= (object &&other) noexcept |
PYBIND11_DEPRECATED ("Use reinterpret_borrow<object>() or reinterpret_steal<object>()") object(handle h | |
handle | release () |
~object () | |
Destructor; automatically calls handle::dec_ref() More... | |
Public Member Functions inherited from handle | |
template<typename T > | |
T | cast () const |
template<> | |
void | cast () const |
bool | check () const |
const handle & | dec_ref () const & |
handle ()=default | |
The default constructor creates a handle with a nullptr -valued pointer. More... | |
handle (PyObject *ptr) | |
Creates a handle from the given raw Python object pointer. More... | |
const handle & | inc_ref () const & |
operator bool () const | |
Return true when the handle wraps a valid Python object. More... | |
bool | operator!= (const handle &h) const |
bool | operator== (const handle &h) const |
PyObject * | ptr () const |
Return the underlying PyObject * pointer. More... | |
PyObject *& | ptr () |
Public Attributes | |
ignore_classes | |
module | |
module_name | |
top_module_namespace | |
verbose | |
Public Attributes inherited from object | |
bool | is_borrowed: handle(h) { if (is_borrowed) inc_ref() |
Static Public Attributes | |
data_type | |
data_type_param | |
dict | |
dir_path | |
global_function_id | |
ignore_methods | |
ignore_namespace | |
list | |
not_ptr_type | |
whitelist | |
wrapper_file_header | |
wrapper_id | |
Private Member Functions | |
def | _add_class (self, instantiated_class) |
def | _add_include (self, include) |
def | _clean_class_name (self, instantiated_class) |
def | _debug (self, message) |
def | _format_class_name (self, instantiated_class, separator='') |
def | _format_global_method (self, static_method, separator='') |
def | _format_instance_method (self, instance_method, separator='') |
def | _format_return_type (cls, return_type, include_namespace=False, separator="::") |
def | _format_static_method (self, static_method, separator='') |
def | _format_type_name (cls, type_name, separator='::', include_namespace=True, constructor=False, method=False) |
def | _format_varargout (cls, return_type, return_type_formatted) |
def | _group_class_methods (self, methods) |
def | _group_methods (self, methods) |
def | _insert_spaces (self, x, y) |
def | _is_ptr (self, arg_type) |
def | _is_ref (self, arg_type) |
def | _is_shared_ptr (self, arg_type) |
def | _qualified_name (self, names) |
def | _update_wrapper_id (self, collector_function=None, id_diff=0) |
def | _wrap_args (self, args) |
def | _wrap_list_variable_arguments (self, args) |
def | _wrap_method_check_statement (self, args) |
def | _wrap_variable_arguments (self, args, wrap_datatypes=True) |
def | _wrapper_name (self) |
def | _wrapper_unwrap_arguments (self, args, arg_id=0, constructor=False) |
Static Private Member Functions | |
def | _return_count (return_type) |
Additional Inherited Members | |
Protected Attributes inherited from handle | |
PyObject * | m_ptr = nullptr |
Wrap the given C++ code into Matlab. Attributes module: the C++ module being wrapped module_name: name of the C++ module being wrapped top_module_namespace: C++ namespace for the top module (default '') ignore_classes: A list of classes to ignore (default [])
Definition at line 19 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.__init__ | ( | self, | |
module, | |||
module_name, | |||
top_module_namespace = '' , |
|||
ignore_classes = () |
|||
) |
Definition at line 88 of file matlab_wrapper.py.
|
private |
Definition at line 103 of file matlab_wrapper.py.
|
private |
Definition at line 100 of file matlab_wrapper.py.
|
private |
Reformatted the C++ class name to fit Matlab defined naming standards
Definition at line 199 of file matlab_wrapper.py.
|
private |
Definition at line 95 of file matlab_wrapper.py.
|
private |
Format a template_instantiator.InstantiatedClass name.
Definition at line 301 of file matlab_wrapper.py.
|
private |
Example: gtsamPoint3.staticFunction
Definition at line 355 of file matlab_wrapper.py.
|
private |
Example: gtsamPoint3.staticFunction
Definition at line 335 of file matlab_wrapper.py.
|
private |
Format return_type. Args: return_type: an interface_parser.ReturnType to reformat include_namespace: whether to include namespaces when reformatting
Definition at line 274 of file matlab_wrapper.py.
|
private |
Example: gtsamPoint3.staticFunction
Definition at line 322 of file matlab_wrapper.py.
|
private |
Args: type_name: an interface_parser.Typename to reformat separator: the statement to add between namespaces and typename include_namespace: whether to include namespaces when reformatting constructor: if the typename will be in a constructor method: if the typename will be in a method Raises: constructor and method cannot both be true
Definition at line 214 of file matlab_wrapper.py.
|
private |
Determine format of return and varargout statements
Definition at line 926 of file matlab_wrapper.py.
|
private |
Group overloaded methods together
Definition at line 908 of file matlab_wrapper.py.
|
private |
Group overloaded methods together
Definition at line 181 of file matlab_wrapper.py.
|
private |
Insert spaces at the beginning of each line Args: x: the statement currently generated y: the addition to add to the statement
Definition at line 144 of file matlab_wrapper.py.
|
private |
Determine if the `interface_parser.Type` should be treated as a raw pointer in the wrapper.
Definition at line 163 of file matlab_wrapper.py.
|
private |
Determine if the interface_parser.Type should be treated as a reference in the wrapper.
Definition at line 173 of file matlab_wrapper.py.
|
private |
Determine if the `interface_parser.Type` should be treated as a shared pointer in the wrapper.
Definition at line 153 of file matlab_wrapper.py.
|
private |
Definition at line 141 of file matlab_wrapper.py.
|
staticprivate |
The amount of objects returned by the given interface_parser.ReturnType.
Definition at line 569 of file matlab_wrapper.py.
|
private |
Get and define wrapper ids. Generates the map of id -> collector function. Args: collector_function: tuple storing info about the wrapper function (namespace, class instance, function type, function name, extra) id_diff: constant to add to the id in the map Returns: the current wrapper id
Definition at line 108 of file matlab_wrapper.py.
|
private |
Wrap an interface_parser.ArgumentList into a list of arguments. Returns: A string representation of the arguments. For example: 'int x, double y'
Definition at line 368 of file matlab_wrapper.py.
|
private |
Wrap an interface_parser.ArgumentList into a list of argument variables. Returns: A string representation of a list of variable arguments. For example: 'varargin{1}, varargin{2}, varargin{3}'
Definition at line 433 of file matlab_wrapper.py.
|
private |
Wrap the given arguments into either just a varargout call or a call in an if statement that checks if the parameters are accurate.
Definition at line 454 of file matlab_wrapper.py.
|
private |
Wrap an interface_parser.ArgumentList into a statement of argument checks. Returns: A string representation of a variable arguments for an if statement. For example: ' && isa(varargin{1},'double') && isa(varargin{2},'numeric')'
Definition at line 388 of file matlab_wrapper.py.
|
private |
Determine the name of wrapper function.
Definition at line 575 of file matlab_wrapper.py.
|
private |
Format the interface_parser.Arguments. Examples: ((a), unsigned char a = unwrap< unsigned char >(in[1]);), ((a), Test& t = *unwrap_shared_ptr< Test >(in[1], "ptr_Test");), ((a), std::shared_ptr<Test> p1 = unwrap_shared_ptr< Test >(in[1], "ptr_Test");)
Definition at line 508 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.class_comment | ( | self, | |
instantiated_class | |||
) |
Generate comments for the given class in Matlab. Args instantiated_class: the class being wrapped ctors: a list of the constructors in the class methods: a list of the methods in the class
Definition at line 604 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.class_serialize_comment | ( | self, | |
class_name, | |||
static_methods | |||
) |
Generate comments for serialize methods.
Definition at line 579 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.generate_collector_function | ( | self, | |
func_id | |||
) |
Generate the complete collector function.
Definition at line 1430 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.generate_matlab_wrapper | ( | self | ) |
Generate the C++ file for the wrapper.
Definition at line 668 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.generate_wrapper | ( | self, | |
namespace | |||
) |
Generate the c++ wrapper.
Definition at line 1630 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.mex_function | ( | self | ) |
Generate the wrapped MEX function.
Definition at line 1579 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap | ( | self | ) |
High level function to wrap the project.
Definition at line 1875 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_class_constructors | ( | self, | |
namespace_name, | |||
inst_class, | |||
parent_name, | |||
ctors, | |||
is_virtual | |||
) |
Wrap class constructor. Args: namespace_name: the name of the namespace ('' if it does not exist) inst_class: instance of the class parent_name: the name of the parent class if it exists ctors: the interface_parser.Constructor in the class is_virtual: whether the class is part of a virtual inheritance chain
Definition at line 765 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_class_deconstructor | ( | self, | |
namespace_name, | |||
inst_class | |||
) |
Generate the delete function for the Matlab class.
Definition at line 881 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_class_display | ( | self | ) |
Generate the display function for the Matlab class.
Definition at line 898 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_class_methods | ( | self, | |
namespace_name, | |||
inst_class, | |||
methods, | |||
serialize = (False,) |
|||
) |
Wrap the methods in the class. Args: namespace_name: the name of the class's namespace inst_class: the instantiated class whose methods to wrap methods: the methods to wrap in the order to wrap them serialize: mutable param storing if one of the methods is serialize
Definition at line 941 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_class_properties | ( | self, | |
class_name | |||
) |
Generate properties of class.
Definition at line 873 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_class_serialize_method | ( | self, | |
namespace_name, | |||
inst_class | |||
) |
Wrap the serizalize method of the class.
Definition at line 1808 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_collector_function_deserialize | ( | self, | |
class_name, | |||
full_name = '' , |
|||
namespace = '' |
|||
) |
Wrap the deserizalize collector function.
Definition at line 1857 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_collector_function_return | ( | self, | |
method | |||
) |
Wrap the complete return type of the function.
Definition at line 1322 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_collector_function_return_types | ( | self, | |
return_type, | |||
func_id | |||
) |
Wrap the return type of the collector function.
Definition at line 1290 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_collector_function_serialize | ( | self, | |
class_name, | |||
full_name = '' , |
|||
namespace = '' |
|||
) |
Wrap the serizalize collector function.
Definition at line 1837 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_collector_function_shared_return | ( | self, | |
return_type_name, | |||
shared_obj, | |||
func_id, | |||
new_line = True |
|||
) |
Wrap the collector function which returns a shared pointer.
Definition at line 1275 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_collector_function_upcast_from_void | ( | self, | |
class_name, | |||
func_id, | |||
cpp_name | |||
) |
Add function to upcast type from void type.
Definition at line 1415 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_global_function | ( | self, | |
function | |||
) |
Wrap the given global function.
Definition at line 714 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_instantiated_class | ( | self, | |
instantiated_class, | |||
namespace_name = '' |
|||
) |
Generate comments and code for given class. Args: instantiated_class: template_instantiator.InstantiatedClass instance storing the class to wrap namespace_name: the name of the namespace if there is one
Definition at line 1127 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_method | ( | self, | |
methods | |||
) |
Wrap methods in the body of a class.
Definition at line 676 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_methods | ( | self, | |
methods, | |||
global_funcs = False , |
|||
global_ns = None |
|||
) |
Wrap a sequence of methods. Groups methods with the same names together. If global_funcs is True then output every method into its own file.
Definition at line 686 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_namespace | ( | self, | |
namespace, | |||
parent = () |
|||
) |
Wrap a namespace by wrapping all of its components. Args: namespace: the interface_parser.namespace instance of the namespace parent: parent namespace
Definition at line 1215 of file matlab_wrapper.py.
def gtwrap.matlab_wrapper.MatlabWrapper.wrap_static_methods | ( | self, | |
namespace_name, | |||
instantiated_class, | |||
serialize | |||
) |
Wrap the static methods in the class.
Definition at line 1031 of file matlab_wrapper.py.
|
static |
Definition at line 30 of file matlab_wrapper.py.
|
static |
Definition at line 42 of file matlab_wrapper.py.
|
static |
Definition at line 68 of file matlab_wrapper.py.
|
static |
Definition at line 80 of file matlab_wrapper.py.
|
static |
Definition at line 75 of file matlab_wrapper.py.
gtwrap.matlab_wrapper.MatlabWrapper.ignore_classes |
Definition at line 92 of file matlab_wrapper.py.
|
static |
Definition at line 58 of file matlab_wrapper.py.
|
static |
Definition at line 64 of file matlab_wrapper.py.
|
static |
Definition at line 60 of file matlab_wrapper.py.
gtwrap.matlab_wrapper.MatlabWrapper.module |
Definition at line 89 of file matlab_wrapper.py.
gtwrap.matlab_wrapper.MatlabWrapper.module_name |
Definition at line 90 of file matlab_wrapper.py.
|
static |
Definition at line 62 of file matlab_wrapper.py.
gtwrap.matlab_wrapper.MatlabWrapper.top_module_namespace |
Definition at line 91 of file matlab_wrapper.py.
gtwrap.matlab_wrapper.MatlabWrapper.verbose |
Definition at line 93 of file matlab_wrapper.py.
|
static |
Definition at line 56 of file matlab_wrapper.py.
|
static |
Definition at line 82 of file matlab_wrapper.py.
|
static |
Definition at line 66 of file matlab_wrapper.py.