LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Macros
config.h File Reference

Go to the source code of this file.

Macros

#define LSST_CONTROL_FIELD(NAME, TYPE, DOC)
 
#define LSST_NESTED_CONTROL_FIELD(NAME, MODULE, TYPE, DOC)
 

Macro Definition Documentation

#define LSST_CONTROL_FIELD (   NAME,
  TYPE,
  DOC 
)
Value:
static char const * _doc_ ## NAME() { \
static char const * doc = DOC; \
return doc; \
} \
static char const * _type_ ## NAME() { \
static char const * type = #TYPE; \
return type; \
} \
TYPE NAME

A preprocessor macro used to define fields in C++ "control object" structs. These objects can then be wrapped into full-fledged Config objects by the functions in lsst.pex.config.wrap.

The defaults for the config class will be set properly if and only if the control class is default-constructable.

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

Definition at line 36 of file config.h.

#define LSST_NESTED_CONTROL_FIELD (   NAME,
  MODULE,
  TYPE,
  DOC 
)
Value:
static char const * _doc_ ## NAME() { \
static char const * doc = DOC; \
return doc; \
} \
static char const * _type_ ## NAME() { \
static char const * type = #TYPE; \
return type; \
} \
static char const * _module_ ## NAME() { \
static char const * mod = #MODULE; \
return mod; \
} \
TYPE NAME

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 swigged 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 Swig-generated 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.

Definition at line 62 of file config.h.