Chi-Tech
ChiObjectFactory.h File Reference

Go to the source code of this file.

Data Structures

class  ChiObjectFactory
 
struct  ChiObjectFactory::ObjectRegistryEntry
 

Macros

#define ChiObjectFactoryJoinWordsA(x, y)   x##y
 
#define ChiObjectFactoryJoinWordsB(x, y)   ChiObjectFactoryJoinWordsA(x, y)
 
#define RegisterChiObject(namespace_name, object_name)
 
#define RegisterChiObjectParametersOnly(namespace_name, object_name)
 
#define RegisterSyntaxBlock(namespace_name, block_name, syntax_function)
 

Macro Definition Documentation

◆ ChiObjectFactoryJoinWordsA

#define ChiObjectFactoryJoinWordsA (   x,
 
)    x##y

Small utility macro for joining two words.

Definition at line 10 of file ChiObjectFactory.h.

◆ ChiObjectFactoryJoinWordsB

#define ChiObjectFactoryJoinWordsB (   x,
 
)    ChiObjectFactoryJoinWordsA(x, y)

IDK why this is needed. Seems like counter doesnt work properly without it

Definition at line 12 of file ChiObjectFactory.h.

◆ RegisterChiObject

#define RegisterChiObject (   namespace_name,
  object_name 
)
Value:
unique_var_name_object_##object_name##_, __COUNTER__) = \
ChiObjectFactory::AddObjectToRegistry<object_name, ChiObject>( \
#namespace_name, #object_name)
#define ChiObjectFactoryJoinWordsB(x, y)

Macro for registering an object within the ChiObjectFactory singleton.

Parameters
namespace_nameName of the namespace within which the object is.
object_nameName of the object in the registry. Example:
RegisterChiObject(kaka, Zorba);
#define RegisterChiObject(namespace_name, object_name)
Note
Remember to include the header "ChiObject/ChiObjectFactory.h".

Definition at line 22 of file ChiObjectFactory.h.

◆ RegisterChiObjectParametersOnly

#define RegisterChiObjectParametersOnly (   namespace_name,
  object_name 
)
Value:
unique_var_name_object_##object_name##_, __COUNTER__) = \
ChiObjectFactory::AddObjectToRegistryParamsOnly<object_name>( \
#namespace_name, #object_name)

Macro for registering an object (parameters only) within the ChiObjectFactory singleton.

Parameters
namespace_nameName of the namespace within which the object is.
object_nameName of the object in the registry. Example:
#define RegisterChiObjectParametersOnly(namespace_name, object_name)
Note
Remember to include the header "ChiObject/object_maker.h"

Definition at line 38 of file ChiObjectFactory.h.

◆ RegisterSyntaxBlock

#define RegisterSyntaxBlock (   namespace_name,
  block_name,
  syntax_function 
)
Value:
unique_var_name_syntax_##block_name##_, __COUNTER__) = \
#namespace_name, #block_name, syntax_function)
static char AddSyntaxBlockToRegistry(const std::string &namespace_name, const std::string &block_name, ObjectGetInParamsFunc syntax_function)

Macro for registering a pure input parameters block within the ChiObjectFactory singleton AND giving it a custom name

Parameters
namespace_nameName of the namespace within which the object is.
block_nameName of the object in the registry.
syntax_functionActual syntax function for this object Example:
RegisterSyntaxBlock(kaka, Zorba, ZorbaSyntaxFunction);
#define RegisterSyntaxBlock(namespace_name, block_name, syntax_function)
Note
Remember to include the header "ChiObject/object_maker.h"

Definition at line 55 of file ChiObjectFactory.h.