DynamicTypeMacros.hxx File Reference

#include "Assert.hxx"
#include "TypeInfoStd.hxx"
#include "StaticBool.hxx"
#include <typeinfo>

Go to the source code of this file.

Defines

#define __COMMON_DYNAMIC_TYPE(CLASS_NAME, N)
#define DYNAMIC_TYPE(CLASS_NAME, N)
 Returns the type id of attribute 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)
 This declaration to detect compile-time-err of repeated attribute IDs(num), without having to relay in templates.
#define DYN_CONTAINER_ATTRIBUTE(N, ACCESS, TYPE, NAME, ENAME)

Define Documentation

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

Definition at line 217 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: \

This declaration to detect compile-time-err of repeated attribute IDs(num), without having to relay in templates.

Precondition:
already exist an object of the type in that position (that will be deleted)

Definition at line 323 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 343 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); \

Returns the type id of attribute n.

Visit all Dynamic Attributes Remove all Dynamic Attributes Add all Dynamic Attributes Add all Dynamic Attributes Store all Dynamic Attributes Load all Dynamic Attributes Instantiated whenever a Attribute number is out of range. \ Gives a compilation error message. \ \ Instantiated whenever a Attribute number is left. \ Gives a compilation error message. \ Undefined link for the Visit method chain (Visit) Undefined link for the Remove method chain (Remove) Undefined link for the Add method chain (Add) Undefined link for the Inform method chain (Inform) Undefined link on the method chain (Store) Undefined link on the method chain (Load) Method chain terminator Method chain terminator Method chain terminator Method chain terminator Method chain terminator Method chain terminator Undefined link on the method chain (GetTypeId)

Definition at line 189 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 203 of file DynamicTypeMacros.hxx.

Referenced by CLAM::NullProcessingConfig::NullProcessingConfig().

Generated by  doxygen 1.6.3