CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
TfObject.h File Reference
#include "TD_PackPush.h"
#include "RxObject.h"
#include "RxIterator.h"
#include "TfVariant.h"
#include "TfObjectReactor.h"
#include "DbStubPtrArray.h"
#include "Gi/GiDrawable.h"

Go to the source code of this file.

Classes

class  OdTfAttributesContainer
 
class  OdTfPropertiesContainer
 
class  OdTfClass
 
class  OdTfProperty
 
class  OdTfAttribute
 
class  OdTfObject
 

Macros

#define ODTF_CREATE_ATTRIBUTE(Name, value)    result.push_back(::newOdTfAttribute(OD_T(#Name), pObject, value));
 
#define ODTF_DEFINE_ATTRIBUTES_CONSTRUCTOR(Name, ATTRIBUTES_LIST)
 
#define ODTF_CREATE_PROPERTY_NO_ATTRS(PropertyName, type, getterFn, setterFn, defaultItemFn)
 
#define ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST)
 
#define ODTF_DECLARE_MEMBERS(ClassName)    ODRX_DECLARE_MEMBERS_GENERIC(OdTfClass, ClassName)
 
#define ODTF_DEFINE_RTTI_MEMBERS(ClassName, ParentClass)    ODRX_DEFINE_RTTI_MEMBERS_GENERIC(OdTfClass, ClassName, ParentClass)
 
#define ODTF_DEFINE_INIT_MEMBERS(ClassName, ParentClass, attrsConsFn, propsConsFn, pseudoConsFn, szClassName)
 
#define ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, attrsConsFn, propsConsFn, pseudoConsFn, szClassName)
 
#define ODTF_NO_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS(ClassName, ParentClass)
 
#define ODTF_NO_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, PROPERTIES_LIST)
 
#define ODTF_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, PROPERTIES_LIST, DOCREATE)
 
#define ODTF_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS(ClassName, ParentClass, DOCREATE)
 

Typedefs

typedef OdSmartPtr< OdTfAttributesContainerOdTfAttributesContainerPtr
 
typedef OdSmartPtr< OdTfPropertiesContainerOdTfPropertiesContainerPtr
 
typedef OdSmartPtr< OdTfClassOdTfClassPtr
 
typedef OdSmartPtr< OdTfPropertyOdTfPropertyPtr
 
typedef OdSmartPtr< OdTfAttributeOdTfAttributePtr
 
typedef OdSmartPtr< OdTfObjectOdTfObjectPtr
 
typedef OdArray< OdTfProperty * >(* OdTfPropertiesConstructorType) (OdTfClass *)
 
typedef OdArray< OdTfAttribute * >(* OdTfAttributesConstructorType) (OdRxObject *)
 
typedef OdResult(* OdTfPropertyGetterType) (const OdTfObject *, OdTfVariant &)
 
typedef OdResult(* OdTfPropertySetterType) (OdTfObject *, const OdTfVariant &)
 
typedef OdTfVariant(* OdTfVariantConstructorType) ()
 

Functions

TFCORE_EXPORT OdTfClassnewOdTfClass (const OdString &name, OdRxClass *pBaseClass, OdTfAttributesConstructorType pAttrsConstr, OdTfPropertiesConstructorType pPropsConstr, OdPseudoConstructorType pConstr, bool bRegister=true)
 
TFCORE_EXPORT OdTfClasscreateOdTfClass ()
 
TFCORE_EXPORT OdTfClassinitOdTfClass (OdTfClass *pClass, const OdString &name, OdRxClass *pBaseClass, const OdArray< OdTfAttribute * > &attributes, const OdArray< OdTfProperty * > &properties, OdPseudoConstructorType pConstr, bool bRegister=true)
 
TFCORE_EXPORT OdTfPropertynewOdTfProperty (const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, OdTfAttributesConstructorType pAttrsConstr, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
 
TFCORE_EXPORT OdTfPropertycreateOdTfProperty ()
 
TFCORE_EXPORT OdTfPropertyinitOdTfProperty (OdTfProperty *pProp, const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, const OdArray< OdTfAttribute * > &attributes, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
 
TFCORE_EXPORT OdTfAttributenewOdTfAttribute (const OdString &name, OdRxObject *pOwner, const OdTfVariant &value)
 

Macro Definition Documentation

◆ ODTF_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS

#define ODTF_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS (   ClassName,
  ParentClass,
  DOCREATE 
)
Value:
ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, NULL, \
ClassName::pseudoConstructor, OD_T(#ClassName)) \
\
ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
#define OD_T(x)
#define ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, attrsConsFn, propsConsFn, pseudoConsFn, szClassName)
Definition: TfObject.h:76

Definition at line 108 of file TfObject.h.

◆ ODTF_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS

#define ODTF_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS (   ClassName,
  ParentClass,
  PROPERTIES_LIST,
  DOCREATE 
)
Value:
ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST) \
ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, \
ClassName##propertiesConstructor, \
ClassName::pseudoConstructor, OD_T(#ClassName)) \
\
ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
#define ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST)
Definition: TfObject.h:54

Definition at line 99 of file TfObject.h.

◆ ODTF_CREATE_ATTRIBUTE

#define ODTF_CREATE_ATTRIBUTE (   Name,
  value 
)     result.push_back(::newOdTfAttribute(OD_T(#Name), pObject, value));

Definition at line 37 of file TfObject.h.

◆ ODTF_CREATE_PROPERTY_NO_ATTRS

#define ODTF_CREATE_PROPERTY_NO_ATTRS (   PropertyName,
  type,
  getterFn,
  setterFn,
  defaultItemFn 
)
Value:
result.push_back(::newOdTfProperty( \
OD_T(#PropertyName), pClass, static_cast<OdTfVariant::Type>(type), NULL, \
defaultItemFn, getterFn, setterFn));
TFCORE_EXPORT OdTfProperty * newOdTfProperty(const OdString &name, OdTfClass *pOwner, OdTfVariant::Type type, OdTfAttributesConstructorType pAttrsConstr, OdTfVariantConstructorType pDefaultValueConstructor, OdTfPropertyGetterType pGetter, OdTfPropertySetterType pSetter)
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274

Definition at line 48 of file TfObject.h.

◆ ODTF_DECLARE_MEMBERS

#define ODTF_DECLARE_MEMBERS (   ClassName)     ODRX_DECLARE_MEMBERS_GENERIC(OdTfClass, ClassName)

Definition at line 62 of file TfObject.h.

◆ ODTF_DEFINE_ATTRIBUTES_CONSTRUCTOR

#define ODTF_DEFINE_ATTRIBUTES_CONSTRUCTOR (   Name,
  ATTRIBUTES_LIST 
)
Value:
static OdArray<OdTfAttribute*> Name##AttributesConstructor( \
OdRxObject* pObject) { \
ATTRIBUTES_LIST(ODTF_CREATE_ATTRIBUTE) \
return result; \
}
#define ODTF_CREATE_ATTRIBUTE(Name, value)
Definition: TfObject.h:37

Definition at line 40 of file TfObject.h.

◆ ODTF_DEFINE_INIT_MEMBERS

#define ODTF_DEFINE_INIT_MEMBERS (   ClassName,
  ParentClass,
  attrsConsFn,
  propsConsFn,
  pseudoConsFn,
  szClassName 
)
Value:
ClassName, (::newOdTfClass(szClassName, ParentClass::desc(), \
attrsConsFn, propsConsFn, pseudoConsFn)), \
(::newOdTfClass(szClassName, ParentClass::desc(), attrsConsFn, \
propsConsFn, pseudoConsFn)))
#define ODRX_DEFINE_INIT_MEMBERS_GENERIC(ClassName, CREATE_CLASS_INSTANCE, CREATE_CLASS_INSTANCE2)
Definition: RxObject.h:154
TFCORE_EXPORT OdTfClass * newOdTfClass(const OdString &name, OdRxClass *pBaseClass, OdTfAttributesConstructorType pAttrsConstr, OdTfPropertiesConstructorType pPropsConstr, OdPseudoConstructorType pConstr, bool bRegister=true)

Definition at line 68 of file TfObject.h.

◆ ODTF_DEFINE_MEMBERS2

#define ODTF_DEFINE_MEMBERS2 (   ClassName,
  ParentClass,
  attrsConsFn,
  propsConsFn,
  pseudoConsFn,
  szClassName 
)
Value:
\
ODTF_DEFINE_RTTI_MEMBERS(ClassName, ParentClass) \
ODTF_DEFINE_INIT_MEMBERS(ClassName, ParentClass, attrsConsFn, propsConsFn, \
pseudoConsFn, szClassName)

Definition at line 76 of file TfObject.h.

◆ ODTF_DEFINE_PROPERTIES_CONSTRUCTOR

#define ODTF_DEFINE_PROPERTIES_CONSTRUCTOR (   ClassName,
  PROPERTIES_LIST 
)
Value:
static OdArray<OdTfProperty*> ClassName##propertiesConstructor( \
OdTfClass* pClass) { \
PROPERTIES_LIST(ODTF_CREATE_PROPERTY_NO_ATTRS); \
return result; \
}
#define ODTF_CREATE_PROPERTY_NO_ATTRS(PropertyName, type, getterFn, setterFn, defaultItemFn)
Definition: TfObject.h:48

Definition at line 54 of file TfObject.h.

◆ ODTF_DEFINE_RTTI_MEMBERS

#define ODTF_DEFINE_RTTI_MEMBERS (   ClassName,
  ParentClass 
)     ODRX_DEFINE_RTTI_MEMBERS_GENERIC(OdTfClass, ClassName, ParentClass)

Definition at line 65 of file TfObject.h.

◆ ODTF_NO_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS

#define ODTF_NO_CONS_NO_ATTRS_NO_PROPS_DEFINE_MEMBERS (   ClassName,
  ParentClass 
)
Value:
\
ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, NULL, NULL, \
OD_T(#ClassName)) \
\
ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, EMPTY_CONSTR)
#define EMPTY_CONSTR(ClassName)
Definition: RxObject.h:121

Definition at line 83 of file TfObject.h.

◆ ODTF_NO_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS

#define ODTF_NO_CONS_NO_ATTRS_PROPS_DEFINE_MEMBERS (   ClassName,
  ParentClass,
  PROPERTIES_LIST 
)
Value:
ODTF_DEFINE_PROPERTIES_CONSTRUCTOR(ClassName, PROPERTIES_LIST) \
ODTF_DEFINE_MEMBERS2(ClassName, ParentClass, NULL, \
ClassName##propertiesConstructor, NULL, \
OD_T(#ClassName)) \
\
ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, EMPTY_CONSTR)

Definition at line 90 of file TfObject.h.

Typedef Documentation

◆ OdTfAttributePtr

A data type that represents a smart pointer to an OdTfAttribute object. <group OdTf_Types>

Definition at line 418 of file TfObject.h.

◆ OdTfAttributesConstructorType

typedef OdArray< OdTfAttribute * >(* OdTfAttributesConstructorType) (OdRxObject *)

A data type that represents a pointer to a function that creates a new attributes container derived from a specified class. <group OdTf_Types>

Definition at line 649 of file TfObject.h.

◆ OdTfAttributesContainerPtr

A data type that represents a smart pointer to an OdTfAttributesContainer object. <group OdTf_Types>

Definition at line 150 of file TfObject.h.

◆ OdTfClassPtr

A data type that represents a smart pointer to an OdTfClass object. <group OdTf_Types>

Definition at line 306 of file TfObject.h.

◆ OdTfObjectPtr

A data type that represents a smart pointer to an OdTfObject object. <group OdTf_Types>

Definition at line 633 of file TfObject.h.

◆ OdTfPropertiesConstructorType

typedef OdArray< OdTfProperty * >(* OdTfPropertiesConstructorType) (OdTfClass *)

A data type that represents a pointer to a function that creates a new properties container derived from a specified class. <group OdTf_Types>

Definition at line 643 of file TfObject.h.

◆ OdTfPropertiesContainerPtr

A data type that represents a smart pointer to an OdTfPropertiesContainer object. <group OdTf_Types>

Definition at line 257 of file TfObject.h.

◆ OdTfPropertyGetterType

typedef OdResult(* OdTfPropertyGetterType) (const OdTfObject *, OdTfVariant &)

A data type that represents a pointer to a function that returns a value of a property owned by a specified object. <group OdTf_Types>

Definition at line 655 of file TfObject.h.

◆ OdTfPropertyPtr

A data type that represents a smart pointer to an OdTfProperty object. <group OdTf_Types>

Definition at line 381 of file TfObject.h.

◆ OdTfPropertySetterType

typedef OdResult(* OdTfPropertySetterType) (OdTfObject *, const OdTfVariant &)

A data type that represents a pointer to a function that sets a new value of a property owned by a specified object. <group OdTf_Types>

Definition at line 662 of file TfObject.h.

◆ OdTfVariantConstructorType

typedef OdTfVariant(* OdTfVariantConstructorType) ()

A data type that represents a pointer to a function that creates a variant value. <group OdTf_Types>

Definition at line 669 of file TfObject.h.

Function Documentation

◆ createOdTfClass()

TFCORE_EXPORT OdTfClass * createOdTfClass ( )

This function creates a new Tf class information storage object with default parameters (acts as a default constructor for the OdTfClass).

Returns
Returns a raw pointer to the created class. <group OdTf_Functions>

◆ createOdTfProperty()

TFCORE_EXPORT OdTfProperty * createOdTfProperty ( )

This function creates a new property object with default parameters (acts as a default constructor for OdTfProperty).

Returns
Returns a raw pointer to the created property object. <group OdTf_Functions>

◆ initOdTfClass()

TFCORE_EXPORT OdTfClass * initOdTfClass ( OdTfClass pClass,
const OdString name,
OdRxClass pBaseClass,
const OdArray< OdTfAttribute * > &  attributes,
const OdArray< OdTfProperty * > &  properties,
OdPseudoConstructorType  pConstr,
bool  bRegister = true 
)

This function initializes a previously created Tf class object with specified parameters: name, base class, constructor function, attributes and properties.

Parameters
pClass[in] A pointer to the previously created class instance.
name[in] A name of the class.
pBaseClass[in] A pointer to the base class. After the method successfully runs, it refers to an instance of the base class.
attributes[in] An attributes container for the class instance.
properties[in] A properties container for the class instance.
pConstr[in] A pointer to the function that creates an instance of the class.
bRegister[in] A flag value that determines whether the class should be registered in the run-time type identification system (if equal to true) or not (if equal to false).
Returns
Returns a pointer to the initialized class object.
Remarks
The method creates an instance of the base class and initializes it with a constructor function, name, and a set of other default parameters. Then the method creates and initializes objects for storing attribute and property containers, and associates them with the class instance. As the last step of the initialization, the method associates the base class instance and property and attribute containers with the class object. <group OdTf_Functions>

◆ initOdTfProperty()

TFCORE_EXPORT OdTfProperty * initOdTfProperty ( OdTfProperty pProp,
const OdString name,
OdTfClass pOwner,
OdTfVariant::Type  type,
const OdArray< OdTfAttribute * > &  attributes,
OdTfVariantConstructorType  pDefaultValueConstructor,
OdTfPropertyGetterType  pGetter,
OdTfPropertySetterType  pSetter 
)

This function initializes a previously created property object.

Parameters
pProp[in] A pointer to a property object that should be initialized.
name[in] A name of the property.
pOwner[in] A pointer to the owner object.
type[in] A data type of the property.
attributes[in] An attributes container object for the property.
pDefaultValueConstructor[in] A pointer to the function that creates a default value of the property.
pGetter[in] A pointer to the function that retrieves and returns the current value of the property.
pSetter[in] A pointer to the function that sets a new value of the property.
Returns
Returns a raw pointer to the initialized property object. <group OdTf_Functions>

◆ newOdTfAttribute()

TFCORE_EXPORT OdTfAttribute * newOdTfAttribute ( const OdString name,
OdRxObject pOwner,
const OdTfVariant value 
)

This function creates and initializes a new attribute object with specified parameters.

Parameters
name[in] A name of the attribute.
pOwner[in] A pointer to the owner object.
value[in] A data type of the property.
Returns
Returns a raw pointer to the created and initialized attribute object. <group OdTf_Functions>

◆ newOdTfClass()

TFCORE_EXPORT OdTfClass * newOdTfClass ( const OdString name,
OdRxClass pBaseClass,
OdTfAttributesConstructorType  pAttrsConstr,
OdTfPropertiesConstructorType  pPropsConstr,
OdPseudoConstructorType  pConstr,
bool  bRegister = true 
)

This function creates and initializes a new Tf class object with specified parameters.

Parameters
name[in] A name of a class to be created.
pBaseClass[in] A pointer to the base class.
pAttrsConstr[in] A pointer to the function that creates an attribute container object for instances of the class.
pPropsConstr[in] A pointer to the function that creates a property container object for instances of the class.
pConstr[in] A pointer to the function that creates an instance of the class.
bRegister[in] A flag value that determines whether the created class should be registered in the run-time type identification system (if equal to true) or not (if equal to false).
Returns
Returns a raw pointer to the created and initialized class object.
Remarks
The method creates an instance of the class by calling the createOdTfClass() function, then attribute and property containers are created using the pointers passed to appropriate constructor functions. For the created class instance, the initOdTfClass() function is called to initialize it. <group OdTf_Functions>

◆ newOdTfProperty()

TFCORE_EXPORT OdTfProperty * newOdTfProperty ( const OdString name,
OdTfClass pOwner,
OdTfVariant::Type  type,
OdTfAttributesConstructorType  pAttrsConstr,
OdTfVariantConstructorType  pDefaultValueConstructor,
OdTfPropertyGetterType  pGetter,
OdTfPropertySetterType  pSetter 
)

This function creates and initializes a new property object with specified parameters.

Parameters
name[in] A name of the property.
pOwner[in] A pointer to the owner object.
type[in] A data type of the property.
pAttrsConstr[in] A pointer to the function that creates an attributes container object for the property.
pDefaultValueConstructor[in] A pointer to the function that creates a default value of the property.
pGetter[in] A pointer to the function that retrieves and returns the current value of the property.
pSetter[in] A pointer to the function that sets a new value of the property.
Returns
Returns a raw pointer to the created and initialized property object. <group OdTf_Functions>