SyTen

◆ expose_syten_class()

template<typename Exposed , typename... Options, typename... Args>
py::class_<Exposed, Options...> syten::Pyten::expose_syten_class ( py::module &  module,
std::string  name,
std::string  docstring = std::string(""),
bool enable_load_in_ctor]  [[maybe_unused] = false 
)

Creates a py::class_<Exposed, Options> object and some standard functions to it.

These functions are:

  • a default empty __init__/ctor
  • a mem_size() function returning totalSize(obj)

The following two functions are only added if the class has a non-zero Boost serialisation version:

  • a __init__/ctor taking a single string to construct the object from a file
  • a save(str) function to save the object to a file

A brief headline describing the C++ class name is automatically added to the start of the docstring.

Remarks
More functions may be added in the future.

References std::string::c_str(), syten::demangle_type(), syten::loadInputRef(), syten::ostreamshiftable(), syten::save(), std::stringstream::str(), syten::MemoryUsage::totalSize(), and syten::verbose().

+ Here is the call graph for this function: