CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TfObject.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef __TF_OBJECT_H__
25#define __TF_OBJECT_H__
26
27#include "TD_PackPush.h"
28
29#include "RxObject.h"
30#include "RxIterator.h"
31#include "TfVariant.h"
32#include "TfObjectReactor.h"
33#include "DbStubPtrArray.h"
34#include "Gi/GiDrawable.h"
35
36//DOM-IGNORE-BEGIN
37#define ODTF_CREATE_ATTRIBUTE(Name, value) \
38 result.push_back(::newOdTfAttribute(OD_T(#Name), pObject, value));
39
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) \
45 return result; \
46 }
47
48#define ODTF_CREATE_PROPERTY_NO_ATTRS(PropertyName, type, getterFn, setterFn, \
49 defaultItemFn) \
50 result.push_back(::newOdTfProperty( \
51 OD_T(#PropertyName), pClass, static_cast<OdTfVariant::Type>(type), NULL, \
52 defaultItemFn, getterFn, setterFn));
53
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); \
59 return result; \
60 }
61
62#define ODTF_DECLARE_MEMBERS(ClassName)\
63 ODRX_DECLARE_MEMBERS_GENERIC(OdTfClass, ClassName)
64
65#define ODTF_DEFINE_RTTI_MEMBERS(ClassName, ParentClass) \
66 ODRX_DEFINE_RTTI_MEMBERS_GENERIC(OdTfClass, ClassName, ParentClass)
67
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)))
75
76#define ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, attrsConsFn, propsConsFn, \
77 pseudoConsFn, szClassName) \
78 \
79 ODTF_DEFINE_RTTI_MEMBERS(ClassName, ParentClass) \
80 ODTF_DEFINE_INIT_MEMBERS(ClassName, ParentClass, attrsConsFn, propsConsFn, \
81 pseudoConsFn, szClassName)
82
83#define ODTF_NO_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS(ClassName, ParentClass) \
84 \
85 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, NULL, NULL, \
86 OD_T(#ClassName)) \
87 \
88 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, EMPTY_CONSTR)
89
90#define ODTF_NO_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, \
91 PROPERTIES_LIST) \
92 ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST) \
93 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, \
94 ClassName##propertiesConstructor, NULL, \
95 OD_T(#ClassName)) \
96 \
97 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, EMPTY_CONSTR)
98
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)) \
105 \
106 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
107
108#define ODTF_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, \
109 DOCREATE) \
110 ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, NULL, \
111 ClassName::pseudoConstructor, OD_T(#ClassName)) \
112 \
113 ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
114
115//DOM-IGNORE-END
116
117class OdTfClass;
118class OdTfProperty;
119class OdTfAttribute;
120
126 //DOM-IGNORE-BEGIN
128 //DOM-IGNORE-END
129public:
134 virtual OdRxObject* owner() const = 0;
135
143 virtual const OdTfAttribute* find(const OdString& name) const = 0;
144};
145
151
160 //DOM-IGNORE-BEGIN
162 //DOM-IGNORE-END
163public:
164
170
175 virtual OdTfClass* owner() const = 0;
176
181 virtual size_type size() const = 0;
182
188 virtual bool contains(const OdTfProperty* pProp) const = 0;
189
195 virtual const OdTfProperty* find(size_type index) const = 0;
196
204 virtual const OdTfProperty* find(const OdString& name) const = 0;
205
216 virtual const OdTfProperty* find(const OdString& name,
217 const OdTfVariant::Type type) const = 0;
218
224 virtual size_type index(const OdTfProperty* pProp) const = 0;
225
232 virtual bool unique(const OdString& name) const = 0;
233
243 virtual bool unique(const OdString& name,
244 const OdTfVariant::Type type) const = 0;
245
250 virtual OdRxIteratorPtr iterator() const = 0;
251};
252
258
259class OdTfClassImpl;
260
268 //DOM-IGNORE-BEGIN
270 //DOM-IGNORE-END
271protected:
272 OdTfClass(OdTfClassImpl*);
273public:
274
280
286
292
299 virtual OdTfClass* tfParent() const;
300};
301
307
315 //DOM-IGNORE-BEGIN
317 //DOM-IGNORE-END
318public:
319
324 virtual OdTfClass* owner() const = 0;
325
330 virtual OdTfVariant::Type type() const = 0;
331
336 virtual const OdString& name() const = 0;
337
343
352 virtual OdTfVariant defaultItemValue() const = 0;
353
362 virtual OdResult getValue(const OdTfObject* pObject,
363 OdTfVariant& value) const = 0;
364
373 virtual OdResult setValue(OdTfObject* pObject,
374 const OdTfVariant& value) const = 0;
375};
376
382
390 //DOM-IGNORE-BEGIN
392 //DOM-IGNORE-END
393public:
394
399 virtual OdRxObject* owner() const = 0;
400
405 virtual const OdString& name() const = 0;
406
411 virtual OdTfVariant value() const = 0;
412};
413
419
432 //DOM-IGNORE-BEGIN
434 //DOM-IGNORE-END
435
436public:
437
443
449
454 virtual const OdTfObject* getOwner() const = 0;
455
470 const OdTfProperty* pPI, OdTfVariant& value,
471 const ItemIndexType arrayIndex = -1) const = 0;
472
487 const OdTfProperty* pPI, const OdTfVariant& value,
488 const ItemIndexType arrayIndex = -1) = 0;
489
511 const ItemIndexType arrayIndex = -1,
512 const OdTfClass* pClass = NULL) const = 0;
513
535 const OdTfVariant& value,
536 const ItemIndexType arrayIndex = -1,
537 const OdTfClass* pClass = NULL) = 0;
552 const PropertyIndexType propertyIndex, OdTfVariant& value,
553 const ItemIndexType arrayIndex = -1) const = 0;
554
569 const PropertyIndexType propertyIndex, const OdTfVariant& value,
570 const ItemIndexType arrayIndex = -1) = 0;
571
578 virtual void addReactor(OdTfObjectReactor* pReactor) = 0;
579
586 virtual void removeReactor(OdTfObjectReactor* pReactor) = 0;
587
595 virtual void addPersistentReactor(OdTfPersistentReactor* pPersistentReactor) = 0;
596
603 virtual void removePersistentReactor(OdTfPersistentReactor* pPersistentReactor) = 0;
604
610 virtual bool hasPersistentReactor(OdTfPersistentReactor* pPersistentReactor) const = 0;
611
619
626 virtual void getTransientReactors(OdTfObjectReactorArray& reactors) = 0;
627};
628
634
635//
636//
637//
638
644
650
656 OdTfVariant&);
657
663 const OdTfVariant&);
664
670
687 const OdString& name, OdRxClass* pBaseClass,
690 bool bRegister = true);
691
698
716 OdTfClass* pClass, const OdString& name, OdRxClass* pBaseClass,
717 const OdArray<OdTfAttribute*>& attributes,
718 const OdArray<OdTfProperty*>& properties, OdPseudoConstructorType pConstr,
719 bool bRegister = true);
720
736 OdTfVariantConstructorType pDefaultValueConstructor,
738
745
760 OdTfProperty* pProp, const OdString& name, OdTfClass* pOwner,
762 OdTfVariantConstructorType pDefaultValueConstructor,
764
774 OdRxObject* pOwner,
775 const OdTfVariant& value);
776
777#endif // __TF_OBJECT_H__
int OdInt32
#define ODRX_ABSTRACT
OdResult
Definition: OdResult.h:29
OdRxObjectPtr(* OdPseudoConstructorType)()
Definition: RxObject.h:843
#define ODRX_DECLARE_MEMBERS(ClassName)
Definition: RxObject.h:112
#define TFCORE_EXPORT
Definition: TfExport.h:34
TFCORE_EXPORT OdTfClass * createOdTfClass()
OdSmartPtr< OdTfAttribute > OdTfAttributePtr
Definition: TfObject.h:418
TFCORE_EXPORT OdTfAttribute * newOdTfAttribute(const OdString &name, OdRxObject *pOwner, const OdTfVariant &value)
OdArray< OdTfProperty * >(* OdTfPropertiesConstructorType)(OdTfClass *)
Definition: TfObject.h:643
OdSmartPtr< OdTfProperty > OdTfPropertyPtr
Definition: TfObject.h:381
OdResult(* OdTfPropertySetterType)(OdTfObject *, const OdTfVariant &)
Definition: TfObject.h:662
OdSmartPtr< OdTfAttributesContainer > OdTfAttributesContainerPtr
Definition: TfObject.h:150
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
Definition: TfObject.h:306
OdSmartPtr< OdTfPropertiesContainer > OdTfPropertiesContainerPtr
Definition: TfObject.h:257
#define ODTF_DECLARE_MEMBERS(ClassName)
Definition: TfObject.h:62
TFCORE_EXPORT OdTfProperty * createOdTfProperty()
OdArray< OdTfAttribute * >(* OdTfAttributesConstructorType)(OdRxObject *)
Definition: TfObject.h:649
OdResult(* OdTfPropertyGetterType)(const OdTfObject *, OdTfVariant &)
Definition: TfObject.h:655
TFCORE_EXPORT OdTfProperty * newOdTfProperty(const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, OdTfAttributesConstructorType pAttrsConstr, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
OdTfVariant(* OdTfVariantConstructorType)()
Definition: TfObject.h:669
OdSmartPtr< OdTfObject > OdTfObjectPtr
Definition: TfObject.h:633
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
Definition: OdArray.h:831
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
Definition: TfObject.h:442
OdTfVariantArray::size_type ItemIndexType
Definition: TfObject.h:448
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 index
Definition: gles2_ext.h:265
GLuint const GLchar * name
Definition: gles2_ext.h:265
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLsizei const GLfloat * value
Definition: gles2_ext.h:302