SBCMetaBaseType.hpp File Reference

Macros

#define SB_DECLARE_BASE_TYPE(DERIVED_TYPE, BASE_TYPE)
 Registers a base type in a SAMSON Element. More...
 

Macro Definition Documentation

◆ SB_DECLARE_BASE_TYPE

#define SB_DECLARE_BASE_TYPE (   DERIVED_TYPE,
  BASE_TYPE 
)
Parameters
DERIVED_TYPEThe derived registered type
BASE_TYPEThe base registered type

This macro registers a base type in a SAMSON Element.

Assume for example a SAMSON Element contains the following classes:

class A {
public:
A() {}
virtual ~A() {}
};
SB_REGISTER_TYPE(A, "A", "BF99103E-06FE-C4C1-D929-4C6E833B101C");
class B : public A {
public:
B() {}
virtual ~B() {}
};
SB_REGISTER_TYPE(B, "B", "D67D0F1A-540D-052F-CC31-2122E0089669");

The SB_DECLARE_BASE_TYPE macro declares to SAMSON's introspection mechanism that class B derives from class A.

Both the derived and the base types should be registered through either SB_REGISTER_TYPE or SB_REGISTER_TARGET_TYPE (whichever is appropriate).

Note that, at the moment, SAMSON's introspection mechanism may not expose multiple inheritance relationships: while it is perfectly possible to expose a class that inherits multiple classes, the SB_DECLARE_BASE_TYPE macro may be used to expose only one derivation relationship, with only one of the base classes.

See also
Introspection
SB_REGISTER_TYPE
SB_REGISTER_TARGET_TYPE