Go to the documentation of this file.
12 #define TYPESYSTEM_HEADER() \
14 friend class Core::CoreDocument; \
15 static Base::Type getClassTypeId(void); \
16 virtual Base::Type getTypeId(void) const; \
17 static void setIfcNameAndID(const std::string& s, int id); \
18 static void init(void); \
19 static void* create(void); \
22 static Base::Type classTypeId; \
23 static std::string ifcEntityName; \
24 static int ifcEntityID;
28 #define TYPESYSTEM_SOURCE_P(_class_) \
29 Base::Type _class_::getClassTypeId(void) { return ::_class_::classTypeId; } \
30 Base::Type _class_::getTypeId(void) const { return ::_class_::classTypeId; } \
31 void _class_::setIfcNameAndID(const std::string& s, int id) \
36 Base::Type _class_::classTypeId = Base::Type::badType(); \
37 std::string _class_::ifcEntityName; \
38 int _class_::ifcEntityID; \
39 void* _class_::create(void) { return new ::_class_(); }
42 #define TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \
43 Base::Type _class_::getClassTypeId(void) { return ::_class_::classTypeId; } \
44 Base::Type _class_::getTypeId(void) const { return ::_class_::classTypeId; } \
45 void _class_::setIfcNameAndID(const std::string& s, int id) \
50 Base::Type _class_::classTypeId = Base::Type::badType(); \
51 std::string _class_::ifcEntityName; \
52 int _class_::ifcEntityID; \
53 void* _class_::create(void) { return 0; }
57 #define TYPESYSTEM_SOURCE(_class_, _parentclass_) \
58 TYPESYSTEM_SOURCE_P(_class_); \
59 void _class_::init(void) \
61 initSubclass(::_class_::classTypeId, #_class_, #_parentclass_, &(::_class_::create)); \
62 initIfcTypes(::_class_::ifcEntityName, ::_class_::classTypeId, ::_class_::ifcEntityID); \
66 #define TYPESYSTEM_SOURCE_ABSTRACT(_class_, _parentclass_) \
67 TYPESYSTEM_SOURCE_ABSTRACT_P(_class_); \
68 void _class_::init(void) \
70 initSubclass(::_class_::classTypeId, #_class_, #_parentclass_, &(::_class_::create)); \
71 initIfcTypes(::_class_::ifcEntityName, ::_class_::classTypeId, ::_class_::ifcEntityID); \
92 static void*
create(
void) {
return 0; }
96 long ____deadVal = 0xBADEAFFE;
98 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API
102 return getTypeId().isDerivedFrom(T::getClassTypeId());
115 void*
operator new(
size_t size)
118 void* p = ::operator
new(size);
122 void operator delete(
void* p)
154 static Type classTypeId;
155 static std::string ifcEntityName;
156 static int ifcEntityID;
172 int getEntityTypeID();
173 std::string getEntityTypeString();
174 static int getEntityTypeIDStatic();
175 static std::string getEntityTypeStringStatic();
176 static std::vector<Base::Type> getLxTypeForIfcEntityTypeID(
int id);
177 std::vector<Base::Type> getLxTypeForIfcEntityTypeString(std::string& s);
178 static int getIfcEntityTypeIDForLxType(
Base::Type t);
179 static std::map<Base::Type, std::string> getLxTypesMap();
184 template <
typename T>
187 return dynamic_cast<T*
>(b);
199 template <
typename T>
202 return dynamic_cast<const T*
>(b);
BaseClass class and root of the type system.
Definition: Base.h:78
Definition: CoreDocument.h:269
static void * create(void)
Definition: Base.h:92
const T * ccast2(const Base::BaseClass *b)
Definition: Base.h:200
void *(* instantiationMethod)(void)
Definition: Type.h:64
T * cast2(Base::BaseClass *b)
Definition: Base.h:185
bool isDerivedFrom() const
Definition: Base.h:100
bool isDerivedFrom(const Type type) const
Definition: Base.h:106
virtual ~BaseClass()
Destruction.
static Type getClassTypeId(void)
BaseClass * operator->() const
Definition: Base.h:140
BaseClass * operator->()
Definition: Base.h:135
BaseClass()=default
Construction.
static void initIfcTypes(const std::string &s, Base::Type classTypeId, int id)
static void setIfcNameAndID(const std::string &n, int id)
static void initSubclass(Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=0)
virtual Type getTypeId(void) const
Definition: AbstractXMLReader.h:5