Develop Biology
The language of life
|
Go to the source code of this file.
Macros | |
#define | BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS(ns, class, ...) |
#define | BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS_WITH_CTOR_COMMON(ns, class, ...) |
#define BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS | ( | ns, | |
class, | |||
... | |||
) |
Defines constructors for classes deriving from chemical::Class and beyond. These will allow you to construct your object with either a name or an id. We also define the empty constructor for when neither name nor id are supplied.
IMPORTANT: despite using VA_ARGS, this will fail if nothing more than the namespace and class are provided. At a minimum, you MUST ALSO INCLUDE THE Perspective AFTER class! e.g. BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS(my_namespace, MyClass, &MyClassPerspective::Instance())
NOTE: if your class has multiple template args or otherwise uses commas in its name, you must enclose it in BIO_SINGLE_ARG() so as to not have it be considered part of the VA_ARGS.
ns | the namespace of the class |
class | the name of the class |
... | all arguments to the ns::Class<class>(...) constructor. |
Definition at line 38 of file ConstructorMacros.h.
#define BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS_WITH_CTOR_COMMON | ( | ns, | |
class, | |||
... | |||
) |
Defines constructors for classes deriving from chemical::Class and beyond. All constructors call a CtorCommon() method with no args. These will allow you to construct your object with either a name or an id. We also define the empty constructor for when neither name nor id are supplied.
IMPORTANT: despite using VA_ARGS, this will fail if nothing more than the namespace and class are provided. At a minimum, you MUST ALSO INCLUDE THE Perspective AFTER class! e.g. BIO_DEFAULT_IDENTIFIABLE_CONSTRUCTORS(my_namespace, MyClass, &MyClassPerspective::Instance())
NOTE: if your class has multiple template args or otherwise uses commas in its name, you must enclose it in BIO_SINGLE_ARG() so as to not have it be considered part of the VA_ARGS.
ns | the namespace of the class |
class | the name of the class |
... | all arguments to the ns::Class<class>(...) constructor. |
Definition at line 65 of file ConstructorMacros.h.