24#ifndef __TF_OBJECT_H__
25#define __TF_OBJECT_H__
37#define ODTF_CREATE_ATTRIBUTE(Name, value) \
38 result.push_back(::newOdTfAttribute(OD_T(#Name), pObject, value));
40#define ODTF_DEFINE_ATTRIBUTES_CONSTRUCTOR(Name, ATTRIBUTES_LIST) \
41 static OdArray<OdTfAttribute*> Name##AttributesConstructor( \
42 OdRxObject* pObject) { \
43 OdArray<OdTfAttribute*> result; \
44 ATTRIBUTES_LIST(ODTF_CREATE_ATTRIBUTE) \
48#define ODTF_CREATE_PROPERTY_NO_ATTRS(PropertyName, type, getterFn, setterFn, \
50 result.push_back(::newOdTfProperty( \
51 OD_T(#PropertyName), pClass, static_cast<OdTfVariant::Type>(type), NULL, \
52 defaultItemFn, getterFn, setterFn));
54#define ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST) \
55 static OdArray<OdTfProperty*> ClassName##propertiesConstructor( \
56 OdTfClass* pClass) { \
57 OdArray<OdTfProperty*> result; \
58 PROPERTIES_LIST(ODTF_CREATE_PROPERTY_NO_ATTRS); \
62#define ODTF_DECLARE_MEMBERS(ClassName)\
63 ODRX_DECLARE_MEMBERS_GENERIC(OdTfClass, ClassName)
65#define ODTF_DEFINE_RTTI_MEMBERS(ClassName, ParentClass) \
66 ODRX_DEFINE_RTTI_MEMBERS_GENERIC(OdTfClass, ClassName, ParentClass)
68#define ODTF_DEFINE_INIT_MEMBERS(ClassName, ParentClass, attrsConsFn, \
69 propsConsFn, pseudoConsFn, szClassName) \
70 ODRX_DEFINE_INIT_MEMBERS_GENERIC( \
71 ClassName, (::newOdTfClass(szClassName, ParentClass::desc(), \
72 attrsConsFn, propsConsFn, pseudoConsFn)), \
73 (::newOdTfClass(szClassName, ParentClass::desc(), attrsConsFn, \
74 propsConsFn, pseudoConsFn)))
76#define ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, attrsConsFn, propsConsFn, \
77 pseudoConsFn, szClassName) \
79 ODTF_DEFINE_RTTI_MEMBERS(ClassName, ParentClass) \
80 ODTF_DEFINE_INIT_MEMBERS(ClassName, ParentClass, attrsConsFn, propsConsFn, \
81 pseudoConsFn, szClassName)
83#define ODTF_NO_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS(ClassName, ParentClass) \
85 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, NULL, NULL, \
88 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, EMPTY_CONSTR)
90#define ODTF_NO_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, \
92 ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST) \
93 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, \
94 ClassName##propertiesConstructor, NULL, \
97 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, EMPTY_CONSTR)
99#define ODTF_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, \
100 PROPERTIES_LIST, DOCREATE) \
101 ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST) \
102 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, \
103 ClassName##propertiesConstructor, \
104 ClassName::pseudoConstructor, OD_T(#ClassName)) \
106 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
108#define ODTF_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, \
110 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, NULL, \
111 ClassName::pseudoConstructor, OD_T(#ClassName)) \
113 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
512 const OdTfClass* pClass = NULL)
const = 0;
690 bool bRegister =
true);
719 bool bRegister =
true);
OdRxObjectPtr(* OdPseudoConstructorType)()
#define ODRX_DECLARE_MEMBERS(ClassName)
TFCORE_EXPORT OdTfClass * createOdTfClass()
OdSmartPtr< OdTfAttribute > OdTfAttributePtr
TFCORE_EXPORT OdTfAttribute * newOdTfAttribute(const OdString &name, OdRxObject *pOwner, const OdTfVariant &value)
OdArray< OdTfProperty * >(* OdTfPropertiesConstructorType)(OdTfClass *)
OdSmartPtr< OdTfProperty > OdTfPropertyPtr
OdResult(* OdTfPropertySetterType)(OdTfObject *, const OdTfVariant &)
OdSmartPtr< OdTfAttributesContainer > OdTfAttributesContainerPtr
TFCORE_EXPORT OdTfProperty * initOdTfProperty(OdTfProperty *pProp, const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, const OdArray< OdTfAttribute * > &attributes, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
OdSmartPtr< OdTfClass > OdTfClassPtr
OdSmartPtr< OdTfPropertiesContainer > OdTfPropertiesContainerPtr
#define ODTF_DECLARE_MEMBERS(ClassName)
TFCORE_EXPORT OdTfProperty * createOdTfProperty()
OdArray< OdTfAttribute * >(* OdTfAttributesConstructorType)(OdRxObject *)
OdResult(* OdTfPropertyGetterType)(const OdTfObject *, OdTfVariant &)
TFCORE_EXPORT OdTfProperty * newOdTfProperty(const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, OdTfAttributesConstructorType pAttrsConstr, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
OdTfVariant(* OdTfVariantConstructorType)()
OdSmartPtr< OdTfObject > OdTfObjectPtr
TFCORE_EXPORT OdTfClass * newOdTfClass(const OdString &name, OdRxClass *pBaseClass, OdTfAttributesConstructorType pAttrsConstr, OdTfPropertiesConstructorType pPropsConstr, OdPseudoConstructorType pConstr, bool bRegister=true)
TFCORE_EXPORT OdTfClass * initOdTfClass(OdTfClass *pClass, const OdString &name, OdRxClass *pBaseClass, const OdArray< OdTfAttribute * > &attributes, const OdArray< OdTfProperty * > &properties, OdPseudoConstructorType pConstr, bool bRegister=true)
typename A::size_type size_type
virtual const OdString & name() const =0
virtual OdTfVariant value() const =0
virtual OdRxObject * owner() const =0
virtual const OdTfAttribute * find(const OdString &name) const =0
virtual OdRxObject * owner() const =0
virtual const OdTfPropertiesContainerPtr allProperties() const
virtual OdTfClass * tfParent() const
virtual const OdTfAttributesContainerPtr attributes() const
OdTfClass(OdTfClassImpl *)
virtual const OdTfPropertiesContainerPtr properties() const
virtual void addPersistentReactor(OdTfPersistentReactor *pPersistentReactor)=0
virtual OdResult setProperty(const OdString &name, const OdTfVariant &value, const ItemIndexType arrayIndex=-1, const OdTfClass *pClass=NULL)=0
virtual bool hasPersistentReactor(OdTfPersistentReactor *pPersistentReactor) const =0
virtual OdResult setProperty(const OdTfProperty *pPI, const OdTfVariant &value, const ItemIndexType arrayIndex=-1)=0
virtual OdResult getProperty(const PropertyIndexType propertyIndex, OdTfVariant &value, const ItemIndexType arrayIndex=-1) const =0
virtual void removeReactor(OdTfObjectReactor *pReactor)=0
virtual void getPersistentReactors(OdTfPersistentReactorArray &elmIds)=0
virtual void removePersistentReactor(OdTfPersistentReactor *pPersistentReactor)=0
OdTfPropertiesContainer::size_type PropertyIndexType
OdTfVariantArray::size_type ItemIndexType
virtual OdResult setProperty(const PropertyIndexType propertyIndex, const OdTfVariant &value, const ItemIndexType arrayIndex=-1)=0
virtual OdResult getProperty(const OdTfProperty *pPI, OdTfVariant &value, const ItemIndexType arrayIndex=-1) const =0
virtual void addReactor(OdTfObjectReactor *pReactor)=0
virtual const OdTfObject * getOwner() const =0
virtual void getTransientReactors(OdTfObjectReactorArray &reactors)=0
virtual OdResult getProperty(const OdString &name, OdTfVariant &value, const ItemIndexType arrayIndex=-1, const OdTfClass *pClass=NULL) const =0
virtual const OdTfProperty * find(const OdString &name) const =0
virtual OdRxIteratorPtr iterator() const =0
virtual bool unique(const OdString &name, const OdTfVariant::Type type) const =0
virtual size_type index(const OdTfProperty *pProp) const =0
virtual const OdTfProperty * find(size_type index) const =0
virtual OdTfClass * owner() const =0
virtual const OdTfProperty * find(const OdString &name, const OdTfVariant::Type type) const =0
virtual size_type size() const =0
virtual bool contains(const OdTfProperty *pProp) const =0
virtual bool unique(const OdString &name) const =0
virtual OdTfAttributesContainerPtr attributes() const =0
virtual const OdString & name() const =0
virtual OdTfVariant defaultItemValue() const =0
virtual OdTfClass * owner() const =0
virtual OdResult getValue(const OdTfObject *pObject, OdTfVariant &value) const =0
virtual OdResult setValue(OdTfObject *pObject, const OdTfVariant &value) const =0
virtual OdTfVariant::Type type() const =0
GLuint const GLchar * name
GLuint GLsizei GLsizei GLint GLenum * type
GLsizei const GLfloat * value