26 #ifndef _ODDBCLASS_INCLUDED_
27 #define _ODDBCLASS_INCLUDED_
49 #define ODDB_PSEUDO_DECLARE_MEMBERS(ClassName) \
51 ODRX_DECLARE_MEMBERS(ClassName); \
52 static OdPseudoConstructorType g_pMainConstr; \
53 OdRxClass* saveAsClass(OdRxClass* pClass) const
59 #define ODDB_PSEUDO_DEFINE_INIT_MEMBERS(ClassName,ParentClass,pseudoConsFn,PseudoBaseClass) \
62 void ClassName::rxInit() \
64 if (!ClassName::g_pDesc) \
66 OdRxClass* pParent = ParentClass::desc(); \
67 OdRxClass* pPseudoBase = PseudoBaseClass::desc(); \
68 if (!pParent->isDerivedFrom(pPseudoBase)) \
70 throw OdError(eNotThatKindOfClass); \
72 ClassName::g_pDesc = PseudoBaseClass::desc(); \
73 g_pMainConstr = pPseudoBase->constructor(); \
74 pPseudoBase->setConstructor(ClassName::pseudoConstructor); \
78 ODA_ASSERT(("Class ["#ClassName"] is already initialized.",0)); \
79 throw OdError(eExtendedError); \
84 void ClassName::rxUninit() \
86 if (ClassName::g_pDesc) \
88 OdRxClass* pPseudoBase = PseudoBaseClass::desc(); \
89 pPseudoBase->setConstructor(g_pMainConstr); \
90 ClassName::g_pMainConstr = 0; \
91 ClassName::g_pDesc = 0; \
95 ODA_ASSERT(("Class ["#ClassName"] is not initialized yet.",0)); \
96 throw OdError(eNotInitializedYet); \
103 #define ODDB_PSEUDO_DEFINE_MEMBERS(ClassName,ParentClass,PseudoBaseClass,DOCREATE) \
105 ODRX_DEFINE_RTTI_MEMBERS(ClassName,ParentClass) \
107 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName,DOCREATE) \
109 ODDB_PSEUDO_DEFINE_INIT_MEMBERS(ClassName,ParentClass,pseudoConsFn,PseudoBaseClass) \
111 OdPseudoConstructorType ClassName::g_pMainConstr = 0; \
113 OdRxClass* ClassName::saveAsClass(OdRxClass*) const \
115 return PseudoBaseClass::saveAsClass(PseudoBaseClass::desc()); \