mirror of
https://github.com/zama-ai/concrete.git
synced 2026-01-13 06:48:02 -05:00
2.5 KiB
2.5 KiB
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