Define LSST_NESTED_CONTROL_FIELD

Define Documentation

LSST_NESTED_CONTROL_FIELD(NAME, MODULE, TYPE, DOC)

A preprocessor macro used to define fields in C++ “control object” structs, for nested control objects. These can be wrapped into Config objects by the functions in lsst.pex.config.wrap.

The nested object will be held as a regular, by-value data member (there’s currently no way to use smart pointers or getters/setters instead).

The nested control object class must also be wrapped into a config object, and the Python module of the wrapped nested control object must be passed as the MODULE argument to the macro. When a wrapped control object is used as a nested field in the same package it is defined in, the MODULE argument must refer to the actual wrapped module, not the just the package, even if the name is lifted into the package namespace.

See lsst.pex.config.wrap.makeConfigClass for a complete example of how to use this macro.