CFx SDK Documentation  2020SP3
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
RxObject.h File Reference
#include "TD_PackPush.h"
#include "RootExport.h"
#include "OdHeap.h"
#include "OdArrayPreDef.h"
#include "OdString.h"
#include "BaseObjectPtr.h"
#include "SmartPtr.h"
#include "TD_PackPop.h"

Go to the source code of this file.

Classes

class  OdRxObjectPtr
 
class  OdRxObject
 
class  OdRxClass
 

Namespaces

 OdRx
 

Macros

#define _ODRXOBJECT_INCLUDED_   /* { Secret } *//
 
#define ODRX_DECLARE_MEMBERS_GENERIC(ClassType, ClassName)
 
#define ODRX_DECLARE_MEMBERS(ClassName)    ODRX_DECLARE_MEMBERS_GENERIC(OdRxClass, ClassName)
 
#define EMPTY_CONSTR(ClassName)   (ClassName*)0
 
#define NEWOBJ_CONSTR(ClassName)   OdSmartPtr<ClassName>(new ClassName, kOdRxObjAttach)
 
#define ODRX_DEFINE_RTTI_MEMBERS_GENERIC(ClassType, ClassName, ParentClass)
 
#define ODRX_DEFINE_RTTI_MEMBERS(ClassName, ParentClass)    ODRX_DEFINE_RTTI_MEMBERS_GENERIC(OdRxClass, ClassName, ParentClass)
 
#define ODRX_DEFINE_INIT_MEMBERS_GENERIC(ClassName, CREATE_CLASS_INSTANCE, CREATE_CLASS_INSTANCE2)
 
#define ODRX_DEFINE_INIT_MEMBERS(ClassName, ParentClass, pseudoConsFn, DwgVer, MaintVer, nProxyFlags, szDWGClassName, szDxfName, szAppName, nCustomFlags)
 
#define ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
 
#define ODRX_DEFINE_MEMBERS2(ClassName, ParentClass, pseudoConsFn, DwgVer, MaintVer, nProxyFlags, szDWGClassName, szDxfName, szAppName, nCustomFlags)
 
#define ODRX_DEFINE_MEMBERS(ClassName, ParentClass, DOCREATE, DwgVer, MaintVer, nProxyFlags, szDWGClassName, szDxfName, szAppName)
 
#define ODRX_DEFINE_MEMBERS_EX(ClassName, ParentClass, DOCREATE, DwgVer, MaintVer, nProxyFlags, szDWGClassName, szDxfName, szAppName, nCustomFlags)
 
#define ODRX_NO_CONS_DEFINE_MEMBERS_ALTNAME(ClassName, ParentClass, szClassName)
 
#define ODRX_NO_CONS_DEFINE_MEMBERS(ClassName, ParentClass)
 
#define ODRX_CONS_DEFINE_MEMBERS_ALTNAME(ClassName, ParentClass, szClassName, DOCREATE)
 
#define ODRX_CONS_DEFINE_MEMBERS(ClassName, ParentClass, DOCREATE)
 
#define ODRX_DXF_DEFINE_MEMBERS(ClassName, ParentClass, DOCREATE, DwgVer, MaintVer, nProxyFlags, DxfName, AppName)
 
#define ODRX_DXF_CONS_DEFINE_MEMBERS(ClassName, ParentClass, DwgVer, MaintVer, nProxyFlags, DxfName, AppName)
 

Typedefs

typedef void(* AppNameChangeFuncPtr) (const OdRxClass *classObj, OdString &newAppName, int saveVer)
 
typedef void(* OdRxMemberCollectionConstructorPtr) (OdRxMemberCollectionBuilder &, void *)
 
typedef OdRxObjectPtr(* OdPseudoConstructorType) ()
 
typedef OdSmartPtr< OdRxClassOdRxClassPtr
 
typedef OdArray< OdRxObjectPtrOdRxObjectPtrArray
 
typedef void(* ODRXOBJECT_CALLBACK) (const OdRxObject *)
 

Enumerations

enum  OdRxObjMod { kOdRxObjAttach }
 
enum  OdRx::Ordering { OdRx::kLessThan =-1, OdRx::kEqual = 0, OdRx::kGreaterThan = 1, OdRx::kNotOrderable = 2 }
 
enum  OdRx::MTSupport {
  OdRx::kMTRender = 0x01, OdRx::kMTRenderInBlock = 0x02, OdRx::kMTRenderNested = 0x04, OdRx::kMTRenderReserved = 0x08,
  OdRx::kMTRenderMask = 0x0f, OdRx::kMTLoading = 0x80, OdRx::kHistoryAware = 0x100
}
 
enum  OverrulingType {
  kDrawableOverrule = 0, kObjectOverrule, kPropertiesOverrule, kGeometryOverrule,
  kHighlightOverrule, kSubentityOverrule, kGripOverrule, kTransformOverrule,
  kOsnapOverrule, kVisibilityOverrule, kTotalOverrules
}
 

Functions

template<class Class , class Parent >
OdRxObjectodQueryXImpl (const Class *pThis, const OdRxClass *pClass)
 
FIRSTDLL_EXPORT OdRxObjectPtr odrxCreateObject (const OdString &sClassName)
 
FIRSTDLL_EXPORT OdRxClassnewOdRxClass (const OdString &sClassName, OdRxClass *pBaseClass, OdPseudoConstructorType pConstr=0, int DwgVer=0, int MaintVer=0, int nProxyFlags=0, const OdString &sDxfName=OdString::kEmpty, const OdString &sAppName=OdString::kEmpty, AppNameChangeFuncPtr fNameChangeFunc=NULL, int nCustomFlags=0)
 
FIRSTDLL_EXPORT void deleteOdRxClass (OdRxClass *pClass)
 
FIRSTDLL_EXPORT void odrxRegisterDestructorCallback (const ODRXOBJECT_CALLBACK callbackFunc)
 
FIRSTDLL_EXPORT void odrxUnregisterDestructorCallback ()
 

Macro Definition Documentation

◆ _ODRXOBJECT_INCLUDED_

#define _ODRXOBJECT_INCLUDED_   /* { Secret } *//

Definition at line 25 of file RxObject.h.

◆ EMPTY_CONSTR

#define EMPTY_CONSTR (   ClassName)    (ClassName*)0

Defines the empty constructor and casts a null pointer for the specified class.

See also
<link rtti_pseudoconstructor.html, Understanding Pseudo-Constructors>

Definition at line 121 of file RxObject.h.

◆ NEWOBJ_CONSTR

#define NEWOBJ_CONSTR (   ClassName)    OdSmartPtr<ClassName>(new ClassName, kOdRxObjAttach)

Defines the pseudo-constructor for the specified class that creates a new instance, creates a smart pointer to it, does not increment its reference counter, and returns a smart pointer to the instance.

Remarks
The reference counter of a new instance is set to a default value.
See also
<link rtti_pseudoconstructor.html, Understanding Pseudo-Constructors>

Definition at line 133 of file RxObject.h.

◆ ODRX_CONS_DEFINE_MEMBERS

#define ODRX_CONS_DEFINE_MEMBERS (   ClassName,
  ParentClass,
  DOCREATE 
)
Value:
\
ODRX_CONS_DEFINE_MEMBERS_ALTNAME(ClassName,ParentClass,OD_T(#ClassName),DOCREATE)

Definition at line 267 of file RxObject.h.

◆ ODRX_CONS_DEFINE_MEMBERS_ALTNAME

#define ODRX_CONS_DEFINE_MEMBERS_ALTNAME (   ClassName,
  ParentClass,
  szClassName,
  DOCREATE 
)
Value:
\
ODRX_DEFINE_MEMBERS2(ClassName,ParentClass,ClassName::pseudoConstructor,0,0,0,szClassName,OdString::kEmpty,OdString::kEmpty,0) \
ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName,DOCREATE)

Definition at line 259 of file RxObject.h.

◆ ODRX_DECLARE_MEMBERS

#define ODRX_DECLARE_MEMBERS (   ClassName)     ODRX_DECLARE_MEMBERS_GENERIC(OdRxClass, ClassName)

Declares the RunTime Type Identification methods required by OdRxObject objects.

Remarks
Any class derived from OdRxObject should include this macro in its class declarations, passing its own name.
See also
<link rtti_class_implementing.html, Implementing RTTI Methods for the Derived Class>

Definition at line 112 of file RxObject.h.

◆ ODRX_DECLARE_MEMBERS_GENERIC

#define ODRX_DECLARE_MEMBERS_GENERIC (   ClassType,
  ClassName 
)

Definition at line 58 of file RxObject.h.

◆ ODRX_DEFINE_INIT_MEMBERS

#define ODRX_DEFINE_INIT_MEMBERS (   ClassName,
  ParentClass,
  pseudoConsFn,
  DwgVer,
  MaintVer,
  nProxyFlags,
  szDWGClassName,
  szDxfName,
  szAppName,
  nCustomFlags 
)
Value:
ClassName, \
(::newOdRxClass(szDWGClassName, ParentClass::desc(), pseudoConsFn, DwgVer, \
MaintVer, nProxyFlags, szDxfName, szAppName, NULL, nCustomFlags)), \
(::newOdRxClass(szDWGClassName, ParentClass::desc(), pseudoConsFn, DwgVer, \
MaintVer, nProxyFlags, szDxfName, szAppName, pAppNameChangeCallback, nCustomFlags)))

Defines the registering and unregistering functions.

See also
<link rtti_class_implementing.html, Implementing RTTI Methods for the Derived Class>

<link rtti_class_registering.html, Registering and Unregistering Classes in a Program>

Definition at line 196 of file RxObject.h.

◆ ODRX_DEFINE_INIT_MEMBERS_GENERIC

#define ODRX_DEFINE_INIT_MEMBERS_GENERIC (   ClassName,
  CREATE_CLASS_INSTANCE,
  CREATE_CLASS_INSTANCE2 
)

Definition at line 154 of file RxObject.h.

◆ ODRX_DEFINE_MEMBERS

#define ODRX_DEFINE_MEMBERS (   ClassName,
  ParentClass,
  DOCREATE,
  DwgVer,
  MaintVer,
  nProxyFlags,
  szDWGClassName,
  szDxfName,
  szAppName 
)
Value:
\
ODRX_DEFINE_MEMBERS2(ClassName,ParentClass,ClassName::pseudoConstructor, \
DwgVer,MaintVer,nProxyFlags,szDWGClassName,szDxfName,szAppName,0) \
ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName,DOCREATE)

Definition at line 230 of file RxObject.h.

◆ ODRX_DEFINE_MEMBERS2

#define ODRX_DEFINE_MEMBERS2 (   ClassName,
  ParentClass,
  pseudoConsFn,
  DwgVer,
  MaintVer,
  nProxyFlags,
  szDWGClassName,
  szDxfName,
  szAppName,
  nCustomFlags 
)
Value:
\
ODRX_DEFINE_RTTI_MEMBERS(ClassName,ParentClass) \
ODRX_DEFINE_INIT_MEMBERS(ClassName,ParentClass,pseudoConsFn, \
DwgVer,MaintVer,nProxyFlags,szDWGClassName,szDxfName,szAppName,nCustomFlags)

Defines Runtime Type Identification and initialization functions for OdRxObject objects.

See also
<link rtti_class_implementing.html, Implementing RTTI Methods for the Derived Class>

Definition at line 223 of file RxObject.h.

◆ ODRX_DEFINE_MEMBERS_EX

#define ODRX_DEFINE_MEMBERS_EX (   ClassName,
  ParentClass,
  DOCREATE,
  DwgVer,
  MaintVer,
  nProxyFlags,
  szDWGClassName,
  szDxfName,
  szAppName,
  nCustomFlags 
)
Value:
\
ODRX_DEFINE_MEMBERS2(ClassName,ParentClass,ClassName::pseudoConstructor, \
DwgVer,MaintVer,nProxyFlags,szDWGClassName,szDxfName,szAppName,nCustomFlags) \
ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName,DOCREATE)

Definition at line 237 of file RxObject.h.

◆ ODRX_DEFINE_PSEUDOCONSTRUCTOR

#define ODRX_DEFINE_PSEUDOCONSTRUCTOR (   ClassName,
  DOCREATE 
)
Value:
\
OdRxObjectPtr ClassName::pseudoConstructor() { return OdRxObjectPtr(DOCREATE(ClassName)); }

Defines a pseudo-constructor for the specified class name.

See also
<link rtti_pseudoconstructor.html, Understanding Pseudo-Constructors>

Definition at line 213 of file RxObject.h.

◆ ODRX_DEFINE_RTTI_MEMBERS

#define ODRX_DEFINE_RTTI_MEMBERS (   ClassName,
  ParentClass 
)     ODRX_DEFINE_RTTI_MEMBERS_GENERIC(OdRxClass, ClassName, ParentClass)

Defines Runtime Type Identification functions for OdRxObject objects.

See also
<link rtti_class_implementing.html, Implementing RTTI Methods for the Derived Class>

Definition at line 151 of file RxObject.h.

◆ ODRX_DEFINE_RTTI_MEMBERS_GENERIC

#define ODRX_DEFINE_RTTI_MEMBERS_GENERIC (   ClassType,
  ClassName,
  ParentClass 
)
Value:
\
ClassType* ClassName::g_pDesc = 0; \
ClassType* ClassName::desc() { return g_pDesc; } \
ClassType* ClassName::isA() const { return g_pDesc; } \
\
OdRxObject* ClassName::queryX(const OdRxClass* pClass) const { \
return ::odQueryXImpl<ClassName, ParentClass>(this, pClass); \
}

Definition at line 135 of file RxObject.h.

◆ ODRX_DXF_CONS_DEFINE_MEMBERS

#define ODRX_DXF_CONS_DEFINE_MEMBERS (   ClassName,
  ParentClass,
  DwgVer,
  MaintVer,
  nProxyFlags,
  DxfName,
  AppName 
)
Value:
\
ODRX_DEFINE_MEMBERS2(ClassName,ParentClass,ClassName::pseudoConstructor, \
DwgVer,MaintVer,nProxyFlags,OD_T(#ClassName),OD_T(#DxfName),OD_T(#AppName),0) \

Definition at line 280 of file RxObject.h.

◆ ODRX_DXF_DEFINE_MEMBERS

#define ODRX_DXF_DEFINE_MEMBERS (   ClassName,
  ParentClass,
  DOCREATE,
  DwgVer,
  MaintVer,
  nProxyFlags,
  DxfName,
  AppName 
)
Value:
\
ODRX_DEFINE_MEMBERS(ClassName,ParentClass,DOCREATE, \
DwgVer,MaintVer,nProxyFlags,OD_T(#ClassName),OD_T(#DxfName),OD_T(#AppName))

Definition at line 273 of file RxObject.h.

◆ ODRX_NO_CONS_DEFINE_MEMBERS

#define ODRX_NO_CONS_DEFINE_MEMBERS (   ClassName,
  ParentClass 
)
Value:
\
ODRX_NO_CONS_DEFINE_MEMBERS_ALTNAME(ClassName,ParentClass,OD_T(#ClassName))

Definition at line 253 of file RxObject.h.

◆ ODRX_NO_CONS_DEFINE_MEMBERS_ALTNAME

#define ODRX_NO_CONS_DEFINE_MEMBERS_ALTNAME (   ClassName,
  ParentClass,
  szClassName 
)
Value:
\
ODRX_DEFINE_MEMBERS2(ClassName,ParentClass,0,0,0,0,szClassName,OdString::kEmpty,OdString::kEmpty,0) \

Definition at line 245 of file RxObject.h.

Typedef Documentation

◆ AppNameChangeFuncPtr

typedef void(* AppNameChangeFuncPtr) (const OdRxClass *classObj, OdString &newAppName, int saveVer)

Callback function providing ability for custom class to alter its application name depending on file format version drawing is saved to.

Remarks
Effects only application name saved to file.

Definition at line 44 of file RxObject.h.

◆ OdPseudoConstructorType

typedef OdRxObjectPtr(* OdPseudoConstructorType) ()

Defines OdPseudoConstructorType as a function pointer type.

Remarks
Functions pointed to by OdPseudoConstructorType take no arguments and construct instances of classes derived from OdRxObject; hence the name PseudoConstructorType.

Definition at line 849 of file RxObject.h.

◆ OdRxClassPtr

This template class is a specialization of the OdSmartPtr class template for OdRxClass object pointers.

See also
<link rtti_class_belonging.html, Belonging to an Instance of a Class>

Definition at line 1102 of file RxObject.h.

◆ OdRxMemberCollectionConstructorPtr

typedef void(* OdRxMemberCollectionConstructorPtr) (OdRxMemberCollectionBuilder &, void *)

Definition at line 838 of file RxObject.h.

◆ ODRXOBJECT_CALLBACK

typedef void(* ODRXOBJECT_CALLBACK) (const OdRxObject *)

This registration allows you to catch the invoking of each RxObject destructor.

Definition at line 1179 of file RxObject.h.

◆ OdRxObjectPtrArray

This template class is a specialization of the OdArray class template for OdRx object pointers.

Definition at line 1174 of file RxObject.h.

Enumeration Type Documentation

◆ OdRxObjMod

enum OdRxObjMod

Suppresses the incrementing of the reference counter.

Remarks
The option is used for creating of smart pointers that refer to the classes derived from OdRxObject. The option can be specified as an argument for the constructor of the OdSmartPtr class or OdRxObjectPtr class.
See also
<link smart_pointers_definition.html, Implementing Smart Pointers>
Enumerator
kOdRxObjAttach 

Definition at line 56 of file RxObject.h.

◆ OverrulingType

Enumerator
kDrawableOverrule 
kObjectOverrule 
kPropertiesOverrule 
kGeometryOverrule 
kHighlightOverrule 
kSubentityOverrule 
kGripOverrule 
kTransformOverrule 
kOsnapOverrule 
kVisibilityOverrule 
kTotalOverrules 

Definition at line 819 of file RxObject.h.

Function Documentation

◆ deleteOdRxClass()

FIRSTDLL_EXPORT void deleteOdRxClass ( OdRxClass pClass)

This external function deletes a class description instance.

Parameters
pClass[in] Raw pointer to an existing class description instance.

◆ newOdRxClass()

FIRSTDLL_EXPORT OdRxClass* newOdRxClass ( const OdString sClassName,
OdRxClass pBaseClass,
OdPseudoConstructorType  pConstr = 0,
int  DwgVer = 0,
int  MaintVer = 0,
int  nProxyFlags = 0,
const OdString sDxfName = OdString::kEmpty,
const OdString sAppName = OdString::kEmpty,
AppNameChangeFuncPtr  fNameChangeFunc = NULL,
int  nCustomFlags = 0 
)

This external function creates a new class description instance with specified parameters and returns a raw pointer to it.

Parameters
sClassName[in] Custom class name as a string.
pBaseClass[in] A pointer to an existing class description instance which is the parent class.
pConstr[in] A pointer to the pseudo-constructor function.
DwgVer[in] dwg-version number.
MaintVer[in] Maintain version number.
nProxyFlags[in] Mask of the proxy flags.
sDxfName[in] dxf-class name.
sAppName[in] Application class name.
fNameChangeFunc[in] A pointer to the callback function which is called when the registered object is to be saved.
nCustomFlags[in] Mask of the custom flags.
See also
<link rtti_class_registering.html, Registering and Unregistering Classes in a Program>

◆ odQueryXImpl()

template<class Class , class Parent >
OdRxObject* odQueryXImpl ( const Class *  pThis,
const OdRxClass pClass 
)

Definition at line 1105 of file RxObject.h.

◆ odrxCreateObject()

FIRSTDLL_EXPORT OdRxObjectPtr odrxCreateObject ( const OdString sClassName)

This external function creates a new instance of the class specified by the argument as a string and returns a /non-typified smart pointer/ to it.

Parameters
sClassName[in] Custom class name as a string.

◆ odrxRegisterDestructorCallback()

FIRSTDLL_EXPORT void odrxRegisterDestructorCallback ( const ODRXOBJECT_CALLBACK  callbackFunc)

◆ odrxUnregisterDestructorCallback()

FIRSTDLL_EXPORT void odrxUnregisterDestructorCallback ( )
EMPTY_CONSTR
#define EMPTY_CONSTR(ClassName)
Definition: RxObject.h:121
NULL
#define NULL
Definition: GsProperties.h:177
OdRxObjectPtr
Definition: RxObject.h:345
NEWOBJ_CONSTR
#define NEWOBJ_CONSTR(ClassName)
Definition: RxObject.h:133
newOdRxClass
FIRSTDLL_EXPORT OdRxClass * newOdRxClass(const OdString &sClassName, OdRxClass *pBaseClass, OdPseudoConstructorType pConstr=0, int DwgVer=0, int MaintVer=0, int nProxyFlags=0, const OdString &sDxfName=OdString::kEmpty, const OdString &sAppName=OdString::kEmpty, AppNameChangeFuncPtr fNameChangeFunc=NULL, int nCustomFlags=0)
ODRX_DEFINE_INIT_MEMBERS
#define ODRX_DEFINE_INIT_MEMBERS(ClassName, ParentClass, pseudoConsFn, DwgVer, MaintVer, nProxyFlags, szDWGClassName, szDxfName, szAppName, nCustomFlags)
Definition: RxObject.h:196
OD_T
#define OD_T(x)
Definition: OdPlatformSettings.h:714
OdRxClass
Definition: RxObject.h:865
ODRX_DEFINE_PSEUDOCONSTRUCTOR
#define ODRX_DEFINE_PSEUDOCONSTRUCTOR(ClassName, DOCREATE)
Definition: RxObject.h:213
ODRX_DEFINE_INIT_MEMBERS_GENERIC
#define ODRX_DEFINE_INIT_MEMBERS_GENERIC(ClassName, CREATE_CLASS_INSTANCE, CREATE_CLASS_INSTANCE2)
Definition: RxObject.h:154
OdString::kEmpty
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98