API Guides > ConceptRT 3.x

Detailed Description

CONCEPT_DEFINE_CLASS adds the symbols classType (type of the class) and baseClass (type of the parent class). These symbols simplify the source code and reduce maintenance effort.

Warning
The symbol baseClass is mandatory in some macros calling the parent class behaviour (DYNAMIC_INVOCATION_BASECLASS, FIELDS_BASECLASS).
Example of declaration:
class GeneratorSinus : public GeneratorPeriodic
{
CONCEPT_DEFINE_CLASS(GeneratorSinus, GeneratorPeriodic)
public:
void Initialize();
};
Example of usage:
void GeneratorSinus::Initialize()
{
baseClass::Initialize();
Amplitude = 1;
Offset = 0;
}

Classes

class  NonCopyable
 Base class that prevents objects to be copied with copy constructor or operator=. More...
 

Macros

#define CONCEPT_DEFINE_CLASS(_classType, _baseType)
 Helper to declare classType and baseClass More...
 
#define CONCEPT_DEFINE_TOP_CLASS(_classType)   typedef _classType classType;
 Helper to declare classType More...
 
#define CONCEPT_DISALLOW_COPY_AND_ASSIGN(_classType)
 Helper to disallow copy and assignement of the objects. More...
 

Macro Definition Documentation

#define CONCEPT_DEFINE_CLASS (   _classType,
  _baseType 
)
Value:
typedef _classType classType;\
typedef _baseType baseClass;

Helper to declare classType and baseClass

Parameters
_classTypeThe current class name.
_baseTypethe parent class name.

classType helps to refer to the current class in the code. baseClass helps to refer to the base class in the code of the class. Very useful to call parent behaviour without having to use its name

Note
If there is no inheritance use CONCEPT_DEFINE_TOP_CLASS

Context of use : Class declaration.

#define CONCEPT_DEFINE_TOP_CLASS (   _classType)    typedef _classType classType;

Helper to declare classType

Parameters
_classTypeThe current class name.

classType helps to refer to the current class in the code.

Note
If there is inheritance use CONCEPT_DEFINE_CLASS

Context of use : Class declaration.

#define CONCEPT_DISALLOW_COPY_AND_ASSIGN (   _classType)

Helper to disallow copy and assignement of the objects.

Parameters
_classTypeThe current class name.

Place the copy constructor and the assignement operator in protected visibility. Context of use : Class declaration.