1 #pragma warning(disable : 4251) 11 #pragma warning(disable : 4100) 27 #define TYPESYSTEM_HEADER() \ 29 friend class Core::CoreDocument; \ 30 static Base::Type getClassTypeId(void); \ 31 virtual Base::Type getTypeId(void) const; \ 32 static void setIfcNameAndID(std::string s, int id); \ 33 static void init(void); \ 34 static void* create(void); \ 37 static Base::Type classTypeId; \ 38 static std::string ifcEntityName; \ 39 static int ifcEntityID; 43 #define TYPESYSTEM_SOURCE_P(_class_) \ 44 Base::Type _class_::getClassTypeId(void) { return ::_class_::classTypeId; } \ 45 Base::Type _class_::getTypeId(void) const { return ::_class_::classTypeId; } \ 46 void _class_::setIfcNameAndID(std::string s, int id) \ 51 Base::Type _class_::classTypeId = Base::Type::badType(); \ 52 std::string _class_::ifcEntityName; \ 53 int _class_::ifcEntityID; \ 54 void* _class_::create(void) { return new ::_class_(); } 57 #define TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \ 58 Base::Type _class_::getClassTypeId(void) { return ::_class_::classTypeId; } \ 59 Base::Type _class_::getTypeId(void) const { return ::_class_::classTypeId; } \ 60 void _class_::setIfcNameAndID(std::string s, int id) \ 65 Base::Type _class_::classTypeId = Base::Type::badType(); \ 66 std::string _class_::ifcEntityName; \ 67 int _class_::ifcEntityID; \ 68 void* _class_::create(void) { return 0; } 72 #define TYPESYSTEM_SOURCE(_class_, _parentclass_) \ 73 TYPESYSTEM_SOURCE_P(_class_); \ 74 void _class_::init(void) \ 76 initSubclass(::_class_::classTypeId, #_class_, #_parentclass_, &(::_class_::create)); \ 77 initIfcTypes(::_class_::ifcEntityName, ::_class_::classTypeId, ::_class_::ifcEntityID); \ 81 #define TYPESYSTEM_SOURCE_ABSTRACT(_class_, _parentclass_) \ 82 TYPESYSTEM_SOURCE_ABSTRACT_P(_class_); \ 83 void _class_::init(void) \ 85 initSubclass(::_class_::classTypeId, #_class_, #_parentclass_, &(::_class_::create)); \ 86 initIfcTypes(::_class_::ifcEntityName, ::_class_::classTypeId, ::_class_::ifcEntityID); \ 103 static Type getClassTypeId(
void);
104 virtual Type getTypeId(
void)
const;
105 static void init(
void);
108 static void setIfcNameAndID(std::string n,
int id);
112 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API 113 template <
typename T>
126 static Type classTypeId;
127 static std::string ifcEntityName;
128 static int ifcEntityID;
132 static void initIfcTypes(std::string s,
Base::Type classTypeId,
int id);
141 int getEntityTypeID();
142 std::string getEntityTypeString();
143 static int getEntityTypeIDStatic();
144 static std::string getEntityTypeStringStatic();
145 static std::vector<Base::Type> getLxTypeForIfcEntityTypeID(
int id);
146 std::vector<Base::Type> getLxTypeForIfcEntityTypeString(std::string& s);
147 static int getIfcEntityTypeIDForLxType(
Base::Type t);
148 static std::map<Base::Type, std::string> getLxTypesMap();
153 template <
typename T>
156 return dynamic_cast<T*>(b);
157 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API 165 template <
typename T>
168 return dynamic_cast<const T*>(b);
169 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API bool isDerivedFrom(const Type type) const
#define BASE_EXPORT
Definition: base_defines.h:12
void *(* instantiationMethod)(void)
Definition: Type.h:70
static void * create(void)
Definition: Base.h:107
Definition: CoreDocument.h:197
BaseClass class and root of the type system.
Definition: Base.h:92
bool isDerivedFrom() const
Definition: Base.h:114
const T * ccast2(const Base::BaseClass *b)
Definition: Base.h:166
T * cast2(Base::BaseClass *b)
Definition: Base.h:154
Definition: AbstractXMLReader.h:8