20 #define TYPESYSTEM_HEADER() \ 22 friend class Core::CoreDocument; \ 23 static Base::Type getClassTypeId(void); \ 24 virtual Base::Type getTypeId(void) const; \ 25 static void setIfcNameAndID(const std::string& s, int id); \ 26 static void init(void); \ 27 static void* create(void); \ 30 static Base::Type classTypeId; \ 31 static std::string ifcEntityName; \ 32 static int ifcEntityID; 36 #define TYPESYSTEM_SOURCE_P(_class_) \ 37 Base::Type _class_::getClassTypeId(void) { return ::_class_::classTypeId; } \ 38 Base::Type _class_::getTypeId(void) const { return ::_class_::classTypeId; } \ 39 void _class_::setIfcNameAndID(const std::string& s, int id) \ 44 Base::Type _class_::classTypeId = Base::Type::badType(); \ 45 std::string _class_::ifcEntityName; \ 46 int _class_::ifcEntityID; \ 47 void* _class_::create(void) { return new ::_class_(); } 50 #define TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \ 51 Base::Type _class_::getClassTypeId(void) { return ::_class_::classTypeId; } \ 52 Base::Type _class_::getTypeId(void) const { return ::_class_::classTypeId; } \ 53 void _class_::setIfcNameAndID(const std::string& s, int id) \ 58 Base::Type _class_::classTypeId = Base::Type::badType(); \ 59 std::string _class_::ifcEntityName; \ 60 int _class_::ifcEntityID; \ 61 void* _class_::create(void) { return 0; } 65 #define TYPESYSTEM_SOURCE(_class_, _parentclass_) \ 66 TYPESYSTEM_SOURCE_P(_class_); \ 67 void _class_::init(void) \ 69 initSubclass(::_class_::classTypeId, #_class_, #_parentclass_, &(::_class_::create)); \ 70 initIfcTypes(::_class_::ifcEntityName, ::_class_::classTypeId, ::_class_::ifcEntityID); \ 74 #define TYPESYSTEM_SOURCE_ABSTRACT(_class_, _parentclass_) \ 75 TYPESYSTEM_SOURCE_ABSTRACT_P(_class_); \ 76 void _class_::init(void) \ 78 initSubclass(::_class_::classTypeId, #_class_, #_parentclass_, &(::_class_::create)); \ 79 initIfcTypes(::_class_::ifcEntityName, ::_class_::classTypeId, ::_class_::ifcEntityID); \ 96 static Type getClassTypeId(
void);
97 virtual Type getTypeId(
void)
const;
98 static void init(
void);
101 static void setIfcNameAndID(
const std::string& n,
int id);
104 long ____deadVal = 0xBADEAFFE;
106 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API 107 template <
typename T>
123 static Type classTypeId;
124 static std::string ifcEntityName;
125 static int ifcEntityID;
129 static void initIfcTypes(
const std::string& s,
Base::Type classTypeId,
int id);
138 int getEntityTypeID();
139 std::string getEntityTypeString();
140 static int getEntityTypeIDStatic();
141 static std::string getEntityTypeStringStatic();
142 static std::vector<Base::Type> getLxTypeForIfcEntityTypeID(
int id);
143 std::vector<Base::Type> getLxTypeForIfcEntityTypeString(std::string& s);
144 static int getIfcEntityTypeIDForLxType(
Base::Type t);
145 static std::map<Base::Type, std::string> getLxTypesMap();
150 template <
typename T>
153 return dynamic_cast<T*>(b);
154 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API 162 template <
typename T>
165 return dynamic_cast<const T*>(b);
166 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API bool isDerivedFrom(const Type type) const
void *(* instantiationMethod)(void)
Definition: Type.h:66
static void * create(void)
Definition: Base.h:100
Definition: CoreDocument.h:210
BaseClass class and root of the type system.
Definition: Base.h:85
bool isDerivedFrom() const
Definition: Base.h:108
const T * ccast2(const Base::BaseClass *b)
Definition: Base.h:163
T * cast2(Base::BaseClass *b)
Definition: Base.h:151
Definition: AbstractXMLReader.h:5
bool isDerivedFrom(const Type type) const
Definition: Base.h:114