libbio
Loading...
Searching...
No Matches
Macros
ConstructorMacros.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BIO_CONSTRUCTORS(thisClass, finalClass)
 
#define BIO_CONSTRUCTORS_WITH_COMMON_CONSTRUCTOR(thisClass, finalClass)
 

Macro Definition Documentation

◆ BIO_CONSTRUCTORS

#define BIO_CONSTRUCTORS (   thisClass,
  finalClass 
)
Value:
thisClass() : \
finalClass() \
{} \
explicit thisClass(const ::bio::Name& name) : \
finalClass(name) \
{} \
explicit thisClass(const ::bio::Id& id) : \
finalClass(id) \
{}

Defines constructors for classes deriving from any Final class.
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.

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.

Parameters
thisClassthe name of the class to construct
finalClassthe name of the Final____ class *this is deriving from.

◆ BIO_CONSTRUCTORS_WITH_COMMON_CONSTRUCTOR

#define BIO_CONSTRUCTORS_WITH_COMMON_CONSTRUCTOR (   thisClass,
  finalClass 
)
Value:
thisClass() : \
finalClass() \
{ \
this->CommonConstructor(); \
} \
explicit thisClass(const ::bio::Name& name) : \
finalClass(name) \
{ \
this->CommonConstructor(); \
} \
explicit thisClass(const ::bio::Id& id) : \
finalClass(id) \
{ \
this->CommonConstructor(); \
}

Defines constructors for classes deriving from any Final class.
All constructors call a CommonConstructor() 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.

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.

Parameters
thisClassthe name of the class to construct
finalClassthe name of the Final____ class *this is deriving from.