CLAM-Development  1.4.0
Macros
DynamicTypeMacros.hxx File Reference
#include "Assert.hxx"
#include "TypeInfoStd.hxx"
#include "StaticBool.hxx"
#include <typeinfo>

Go to the source code of this file.

Macros

#define __COMMON_DYNAMIC_TYPE(CLASS_NAME, N)
#define DYNAMIC_TYPE(CLASS_NAME, N)
#define DYNAMIC_TYPE_USING_INTERFACE(CLASS_NAME, N, INTERFACE_NAME)
#define __COMMON_DYN_ATTRIBUTE(N, ACCESS, TYPE, NAME)
#define DYN_ATTRIBUTE(N, ACCESS, TYPE, NAME)
#define DYN_CONTAINER_ATTRIBUTE(N, ACCESS, TYPE, NAME, ENAME)

Macro Definition Documentation

#define __COMMON_DYN_ATTRIBUTE (   N,
  ACCESS,
  TYPE,
  NAME 
)

Definition at line 212 of file DynamicTypeMacros.hxx.

#define __COMMON_DYNAMIC_TYPE (   CLASS_NAME,
 
)

Definition at line 40 of file DynamicTypeMacros.hxx.

#define DYN_ATTRIBUTE (   N,
  ACCESS,
  TYPE,
  NAME 
)
Value:
__COMMON_DYN_ATTRIBUTE(N,ACCESS,TYPE,NAME) \
protected: \
void Store##NAME(CLAM::Storage & s) const { \
if (Has##NAME()) { \
StoreAttribute((CLAM::TypeInfo<TYPE >::StorableAsLeaf*)NULL, s, Get##NAME(), #NAME); \
} \
} \
bool Load##NAME(CLAM::Storage & s) { \
TYPE obj; \
if (!LoadAttribute((CLAM::TypeInfo<TYPE >::StorableAsLeaf*)NULL, s, obj, #NAME)) { \
Remove##NAME(); \
return false; \
} \
Set##NAME(obj); \
return true; \
} \
ACCESS: \

Definition at line 318 of file DynamicTypeMacros.hxx.

#define DYN_CONTAINER_ATTRIBUTE (   N,
  ACCESS,
  TYPE,
  NAME,
  ENAME 
)
Value:
__COMMON_DYN_ATTRIBUTE(N,ACCESS,TYPE,NAME) \
protected: \
void Store##NAME(CLAM::Storage & s) const { \
if (Has##NAME()) { \
StoreIterableAttribute(s, Get##NAME(), #NAME, #ENAME); \
} \
} \
bool Load##NAME(CLAM::Storage & s) { \
Add##NAME(); \
UpdateData(); \
if (! LoadIterableAttribute(s, Get##NAME(), #NAME, #ENAME)) { \
Remove##NAME(); \
return false; \
} \
return true; \
} \
ACCESS: \

Definition at line 338 of file DynamicTypeMacros.hxx.

#define DYNAMIC_TYPE (   CLASS_NAME,
 
)
Value:
public: \
CLASS_NAME() : CLAM::DynamicType(N)\
{\
MandatoryInit(); \
DefaultInit();\
}\
CLASS_NAME(const CLASS_NAME& prototype, const bool shareData=false, const bool deep=true)\
: CLAM::DynamicType(prototype, shareData, deep) { \
CopyInit(prototype);\
}\
__COMMON_DYNAMIC_TYPE(CLASS_NAME,N); \

Definition at line 184 of file DynamicTypeMacros.hxx.

#define DYNAMIC_TYPE_USING_INTERFACE (   CLASS_NAME,
  N,
  INTERFACE_NAME 
)
Value:
public: \
CLASS_NAME() : INTERFACE_NAME(N)\
{\
MandatoryInit(); \
DefaultInit();\
}\
CLASS_NAME(const CLASS_NAME& prototype, const bool shareData=false, const bool deep=true)\
: INTERFACE_NAME(prototype, shareData, deep) { \
CopyInit(prototype); \
}\
__COMMON_DYNAMIC_TYPE(CLASS_NAME,N); \

Definition at line 198 of file DynamicTypeMacros.hxx.