Honeycomb  0.1
Component-Model Framework
Namespaces | Classes | Macros | Typedefs
Component System

Methods to create and operate on components and component objects. More...

Namespaces

 honey::component
 Component methods.
 

Classes

class  honey::ComObject
 Component object. Object that consists of a collection of components. More...
 
class  honey::ComRegistry::Type
 Component type. More...
 
class  honey::ComRegistry
 Holds global list of all component types. More...
 
class  honey::Component
 Base class for components. Components can only be attached to one ComObject at a time. More...
 
class  honey::Object
 Base class for objects. More...
 
class  honey::PropertyBase
 Base class for all properties. More...
 
class  honey::Property< T >
 Generic property. More...
 
class  honey::Property< vector< T > >
 Generic vector property. More...
 
struct  honey::PropertyError
 
class  honey::PropertyObject
 Object that contains properties. More...
 

Macros

#define COMPONENT(...)    EVAL(TOKCAT(COMPONENT_, NUMARGS(__VA_ARGS__))(__VA_ARGS__))
 Forwards to COMPONENT_#args. More...
 
#define COMPONENT_1(Class)    COMPONENT_2(Class, #Class)
 Declare a component. Call inside class definition. More...
 
#define COMPONENT_2(Class, typeId)    COMPONENT_SUB(, Class, typeId)
 Declare a component with a custom type id. More...
 
#define COMPONENT_SUB(...)    EVAL(TOKCAT(COMPONENT_SUB_, NUMARGS(__VA_ARGS__))(__VA_ARGS__))
 Forwards to COMPONENT_SUB_#args. More...
 
#define COMPONENT_SUB_2(SuperCom, Class)    COMPONENT_SUB_3(SuperCom, Class, #Class)
 Declare a derived component that inherits from component class SuperCom. A derived component can be typecasted to its super component. More...
 
#define COMPONENT_SUB_3(SuperCom, Class, typeId)
 Declare a derived component with a custom type id. More...
 
#define COMPONENT_REG(Class)    static mt::Void TOKCAT(__comReg_,__COUNTER__)(UNBRACKET(Class)::__comReg());
 Register a component class. Call outside class definition. More...
 
#define COMPONENT_REG_T(Template, Class)    UNBRACKET(Template) mt::Void UNBRACKET(Class)::__comReg_t(__comReg());
 Register a templated component class. Call outside class definition. More...
 

Typedefs

typedef vector< int > honey::IntList
 Integer list property. More...
 
typedef vector< Real > honey::RealList
 Real list property. More...
 

Detailed Description

Methods to create and operate on components and component objects.

Macro Definition Documentation

#define COMPONENT (   ...)    EVAL(TOKCAT(COMPONENT_, NUMARGS(__VA_ARGS__))(__VA_ARGS__))

Forwards to COMPONENT_#args.

#define COMPONENT_1 (   Class)    COMPONENT_2(Class, #Class)

Declare a component. Call inside class definition.

Every component type must have a unique type id (uses class name by default).

#define COMPONENT_2 (   Class,
  typeId 
)    COMPONENT_SUB(, Class, typeId)

Declare a component with a custom type id.

#define COMPONENT_REG (   Class)    static mt::Void TOKCAT(__comReg_,__COUNTER__)(UNBRACKET(Class)::__comReg());

Register a component class. Call outside class definition.

#define COMPONENT_REG_T (   Template,
  Class 
)    UNBRACKET(Template) mt::Void UNBRACKET(Class)::__comReg_t(__comReg());

Register a templated component class. Call outside class definition.

#define COMPONENT_SUB (   ...)    EVAL(TOKCAT(COMPONENT_SUB_, NUMARGS(__VA_ARGS__))(__VA_ARGS__))

Forwards to COMPONENT_SUB_#args.

#define COMPONENT_SUB_2 (   SuperCom,
  Class 
)    COMPONENT_SUB_3(SuperCom, Class, #Class)

Declare a derived component that inherits from component class SuperCom. A derived component can be typecasted to its super component.

#define COMPONENT_SUB_3 (   SuperCom,
  Class,
  typeId 
)
Value:
friend class ComRegistry; \
\
typedef SharedPtr<Class> Ptr; \
typedef SharedPtr<const Class> ConstPtr; \
\ \
static ComRegistry::Type& s_comType() \
{ \
mt_unused(__comReg_t); /* reference register var so it can't be compiled out */ \
static ComRegistry::Type obj( \
ComRegistry::Type( typeId, mt::identity<Class>() \
IFEMPTY(, COMMA mt::identity<SuperCom>(), SuperCom))); \
return obj; \
} \
\ \
virtual const ComRegistry::Type& comType() const { return s_comType(); } \
\ \
static mt::Void __comReg() \
{ \
static bool init = false; if (init) return mt::Void(); init = true; \
ComRegistry::inst().reg<Class>(); \
return mt::Void(); \
} \
static mt::Void __comReg_t; /* for templated component reg */ \
#define IFEMPTY(True, False,...)
Evaluate true or false depending on whether argument list is empty.
Definition: Preprocessor.h:38
#define COMMA
Use to avoid macro interpreting a comma as an argument delimiter.
Definition: Preprocessor.h:33

Declare a derived component with a custom type id.

Typedef Documentation

typedef vector<int> honey::IntList

Integer list property.

typedef vector<Real> honey::RealList

Real list property.