Skip to content

Latest commit

 

History

History
82 lines (39 loc) · 2.51 KB

concrete.compiler.wrapper.md

File metadata and controls

82 lines (39 loc) · 2.51 KB

module concrete.compiler.wrapper

Wrapper for native Cpp objects.


class WrapperCpp

Wrapper base class for native Cpp objects.

Initialization should mainly store the wrapped object, and future calls to the wrapper will be forwarded to it. A static wrap method is provided to be more explicit. Wrappers should always be constructed using the new method, which construct the Cpp object using the provided arguments, then wrap it. Classes that inherit from this class should preferably type check the wrapped object during calls to init, and reimplement the new method if the class is meant to be constructed.

method __init__

__init__(cpp_obj)

method cpp

cpp()

Return the Cpp wrapped object.


method new

new(*args, **kwargs)

Create a new wrapper by building the underlying object with a specific set of arguments.


classmethod wrap

wrap(cpp_obj) → WrapperCpp

Wrap the Cpp object into a Python object.

Args:

  • cpp_obj: object to wrap

Returns:

  • WrapperCpp: wrapper