CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OdTfVariant Class Reference

#include <TfVariant.h>

Inheritance diagram for OdTfVariant:
OdVariant

Public Types

enum  Type {
  kGUID = OdVariant::kNextType , kEmpty , kDEPRECARED0 , kDbStubPtr ,
  kRxObjectWeakPtr , kTuple , kNextType
}
 
- Public Types inherited from OdVariant
enum  Type {
  kVoid = 0x0000 , kString = 0x0001 , kBool = 0x0002 , kInt8 = 0x0003 ,
  kUInt8 = 0x0003 , kInt16 = 0x0004 , kUInt16 = 0x0004 , kInt32 = 0x0005 ,
  kUInt32 = 0x0005 , kInt64 = 0x0006 , kUInt64 = 0x0006 , kDouble = 0x0007 ,
  kWString = 0x0008 , kAnsiString = 0x0008 , kRxObjectPtr = 0x0009 , kNextType = 0x000A ,
  kByRef = 0x0040 , kArray = 0x0080
}
 

Public Member Functions

bool isEmpty () const
 
bool isVariantArray () const
 
 OdTfVariant ()
 
 OdTfVariant (const OdVariant &value)
 
 OdTfVariant (const OdTfVariant &value)
 
 OdTfVariant (const OdGUID &value)
 
 OdTfVariant (const OdTfVariantTuple &value)
 
 OdTfVariant (OdTfVariant::Type type, const OdTfVariantArray &value)
 
 OdTfVariant (OdDbStub *const value)
 
OdTfVariantoperator= (const OdTfVariant &value)
 
virtual ~OdTfVariant ()
 
const OdGUIDgetGUID () const
 
const OdTfVariantArraygetVariantArray () const
 
OdDbStub * getDbStubPtr () const
 
OdRxObjectgetRxObjectWeakPtr () const
 
const OdTfVariantTuplegetVariantTuple () const
 
OdTfVariantArrayasVariantArray ()
 
OdTfVariantTupleasVariantTuple ()
 
OdTfVariantsetGUID (const OdGUID &value)
 
OdTfVariantsetVariantArray (OdTfVariant::Type type, const OdTfVariantArray &value)
 
OdTfVariantsetVariantTuple (const OdTfVariantTuple &value)
 
OdTfVariantsetDbStubPtr (OdDbStub *const value)
 
OdTfVariantsetRxObjectWeakPtr (OdRxObject *const value)
 
- Public Member Functions inherited from OdVariant
 OdVariant ()
 
 OdVariant (const OdVariant &val)
 
OdVariantoperator= (const OdVariant &val)
 
virtual ~OdVariant ()
 
int varType () const
 
Type type () const
 
bool isArray () const
 
bool isByRef () const
 
 OdVariant (const OdString &val)
 
 OdVariant (const OdAnsiString &val)
 
 OdVariant (const OdRxObjectPtr &val)
 
 OdVariant (bool val)
 
 OdVariant (OdInt8 val)
 
 OdVariant (OdUInt8 val)
 
 OdVariant (OdInt16 val)
 
 OdVariant (OdUInt16 val)
 
 OdVariant (OdInt32 val)
 
 OdVariant (OdUInt32 val)
 
 OdVariant (OdInt64 val)
 
 OdVariant (OdUInt64 val)
 
 OdVariant (double val)
 
const OdStringgetString () const
 
const OdAnsiString & getAnsiString () const
 
const OdRxObjectPtrgetRxObjectPtr () const
 
bool getBool () const
 
OdInt8 getInt8 () const
 
OdUInt8 getUInt8 () const
 
OdInt16 getInt16 () const
 
OdUInt16 getUInt16 () const
 
OdInt32 getInt32 () const
 
OdUInt32 getUInt32 () const
 
OdInt64 getInt64 () const
 
OdUInt64 getUInt64 () const
 
OdIntPtr getIntPtr () const
 
double getDouble () const
 
OdStringgetStringPtr () const
 
OdAnsiString * getAnsiStringPtr () const
 
OdRxObjectPtrgetRxObjectPtrPtr () const
 
bool * getBoolPtr () const
 
OdInt8getInt8Ptr () const
 
OdUInt8getUInt8Ptr () const
 
OdInt16getInt16Ptr () const
 
OdUInt16getUInt16Ptr () const
 
OdInt32getInt32Ptr () const
 
OdUInt32getUInt32Ptr () const
 
OdInt64getInt64Ptr () const
 
OdUInt64getUInt64Ptr () const
 
double * getDoublePtr () const
 
const OdStringArraygetStringArray () const
 
const OdAnsiStringArray & getAnsiStringArray () const
 
const OdRxObjectPtrArraygetRxObjectPtrArray () const
 
const OdBoolArraygetBoolArray () const
 
const OdInt8ArraygetInt8Array () const
 
const OdUInt8ArraygetUInt8Array () const
 
const OdInt16ArraygetInt16Array () const
 
const OdUInt16ArraygetUInt16Array () const
 
const OdInt32ArraygetInt32Array () const
 
const OdUInt32ArraygetUInt32Array () const
 
const OdInt64ArraygetInt64Array () const
 
const OdUInt64ArraygetUInt64Array () const
 
const OdDoubleArraygetDoubleArray () const
 
OdStringArrayasStringArray ()
 
OdAnsiStringArray & asAnsiStringArray ()
 
OdRxObjectPtrArrayasRxObjectPtrArray ()
 
OdBoolArrayasBoolArray ()
 
OdInt8ArrayasInt8Array ()
 
OdUInt8ArrayasUInt8Array ()
 
OdInt16ArrayasInt16Array ()
 
OdUInt16ArrayasUInt16Array ()
 
OdInt32ArrayasInt32Array ()
 
OdUInt32ArrayasUInt32Array ()
 
OdInt64ArrayasInt64Array ()
 
OdUInt64ArrayasUInt64Array ()
 
OdDoubleArrayasDoubleArray ()
 
OdStringArraygetStringArrayPtr () const
 
OdAnsiStringArray * getAnsiStringArrayPtr () const
 
OdRxObjectPtrArraygetRxObjectPtrArrayPtr () const
 
OdBoolArraygetBoolArrayPtr () const
 
OdInt8ArraygetInt8ArrayPtr () const
 
OdUInt8ArraygetUInt8ArrayPtr () const
 
OdInt16ArraygetInt16ArrayPtr () const
 
OdUInt16ArraygetUInt16ArrayPtr () const
 
OdInt32ArraygetInt32ArrayPtr () const
 
OdUInt32ArraygetUInt32ArrayPtr () const
 
OdInt64ArraygetInt64ArrayPtr () const
 
OdUInt64ArraygetUInt64ArrayPtr () const
 
OdDoubleArraygetDoubleArrayPtr () const
 
OdVariantsetString (const OdString &val)
 
OdVariantsetAnsiString (const OdAnsiString &val)
 
OdVariantsetRxObjectPtr (const OdRxObjectPtr &val)
 
OdVariantsetBool (bool val)
 
OdVariantsetInt8 (OdInt8 val)
 
OdVariantsetUInt8 (OdUInt8 val)
 
OdVariantsetInt16 (OdInt16 val)
 
OdVariantsetUInt16 (OdUInt16 val)
 
OdVariantsetInt32 (OdInt32 val)
 
OdVariantsetUInt32 (OdUInt32 val)
 
OdVariantsetInt64 (OdInt64 val)
 
OdVariantsetUInt64 (OdUInt64 val)
 
OdVariantsetIntPtr (OdIntPtr val)
 
OdVariantsetDouble (double val)
 
OdVariantsetStringPtr (OdString *val)
 
OdVariantsetAnsiStringPtr (OdAnsiString *val)
 
OdVariantsetRxObjectPtrPtr (OdRxObjectPtr *val)
 
OdVariantsetBoolPtr (bool *val)
 
OdVariantsetInt8Ptr (OdInt8 *val)
 
OdVariantsetUInt8Ptr (OdUInt8 *val)
 
OdVariantsetInt16Ptr (OdInt16 *val)
 
OdVariantsetUInt16Ptr (OdUInt16 *val)
 
OdVariantsetInt32Ptr (OdInt32 *val)
 
OdVariantsetUInt32Ptr (OdUInt32 *val)
 
OdVariantsetInt64Ptr (OdInt64 *val)
 
OdVariantsetUInt64Ptr (OdUInt64 *val)
 
OdVariantsetDoublePtr (double *val)
 
OdVariantsetStringArray (const OdStringArray &val)
 
OdVariantsetAnsiStringArray (const OdAnsiStringArray &val)
 
OdVariantsetRxObjectPtrArray (const OdRxObjectPtrArray &val)
 
OdVariantsetBoolArray (const OdBoolArray &val)
 
OdVariantsetInt8Array (const OdInt8Array &val)
 
OdVariantsetUInt8Array (const OdUInt8Array &val)
 
OdVariantsetInt16Array (const OdInt16Array &val)
 
OdVariantsetUInt16Array (const OdUInt16Array &val)
 
OdVariantsetInt32Array (const OdInt32Array &val)
 
OdVariantsetUInt32Array (const OdUInt32Array &val)
 
OdVariantsetInt64Array (const OdInt64Array &val)
 
OdVariantsetUInt64Array (const OdUInt64Array &val)
 
OdVariantsetDoubleArray (const OdDoubleArray &val)
 
OdVariantsetStringArrayPtr (OdStringArray *val)
 
OdVariantsetAnsiStringArrayPtr (OdAnsiStringArray *val)
 
OdVariantsetRxObjectPtrArrayPtr (OdRxObjectPtrArray *val)
 
OdVariantsetBoolArrayPtr (OdBoolArray *val)
 
OdVariantsetInt8ArrayPtr (OdInt8Array *val)
 
OdVariantsetUInt8ArrayPtr (OdUInt8Array *val)
 
OdVariantsetInt16ArrayPtr (OdInt16Array *val)
 
OdVariantsetUInt16ArrayPtr (OdUInt16Array *val)
 
OdVariantsetInt32ArrayPtr (OdInt32Array *val)
 
OdVariantsetUInt32ArrayPtr (OdUInt32Array *val)
 
OdVariantsetInt64ArrayPtr (OdInt64Array *val)
 
OdVariantsetUInt64ArrayPtr (OdUInt64Array *val)
 
OdVariantsetDoubleArrayPtr (OdDoubleArray *val)
 

Static Public Member Functions

static const OdVariant::TypeFactorytypeFactory (int type)
 
static Type kVariantArray (OdUInt16 nDims, OdUInt32 itemType)
 
static Type kVariantArray (OdUInt16 nDims, OdTfVariant::Type itemType)
 
static Type kVariantArray (OdUInt32 itemType)
 
static Type kVariantArray (OdTfVariant::Type type)
 
static Type getItemType (OdTfVariant::Type type)
 
static OdUInt16 getDimsCount (OdTfVariant::Type type)
 
static OdTfVariant empty ()
 
- Static Public Member Functions inherited from OdVariant
static const TypeFactorytypeFactory (int type)
 

Protected Member Functions

void setVarType (int newType, int &type, void *data)
 
void makeEmpty ()
 
- Protected Member Functions inherited from OdVariant
voiddata () const
 
virtual void setVarType (int newType, int &type, void *data)
 

Additional Inherited Members

- Protected Attributes inherited from OdVariant
int m_type
 
union {
   OdUInt8   uint8 [nOdVariantDataSize]
 
   double   dbl
 
   void *   ptr
 
m_uData
 

Detailed Description

A class that implements an extension of the <exref target="https://docs.opendesign.com/tkernel/OdVariant.html">OdVariant</exref> class that can be used as an universal storage of typified data. Corresponding C++ library: Od_Tf <group OdTf_Classes>

Definition at line 53 of file TfVariant.h.

Member Enumeration Documentation

◆ Type

Data types for Tf variant objects. <group OdTf_Types>

Enumerator
kGUID 
kEmpty 
kDEPRECARED0 
kDbStubPtr 
kRxObjectWeakPtr 
kTuple 
kNextType 

Definition at line 67 of file TfVariant.h.

Constructor & Destructor Documentation

◆ OdTfVariant() [1/7]

OdTfVariant::OdTfVariant ( )

Creates an empty Tf variant object.

◆ OdTfVariant() [2/7]

OdTfVariant::OdTfVariant ( const OdVariant value)

Creates a new Tf variant object that is a copy of another variant object represented with the OdVariant class instance.

Parameters
value[in] An OdVariant object that is copied to a created Tf variant object.

◆ OdTfVariant() [3/7]

OdTfVariant::OdTfVariant ( const OdTfVariant value)

Creates a new Tf variant object that is a copy of another Tf variant object (copy constructor).

Parameters
value[in] An OdTfVariant object that is copied to a created Tf variant object.

◆ OdTfVariant() [4/7]

OdTfVariant::OdTfVariant ( const OdGUID value)

Creates a new Tf variant object with a specified GUID.

Parameters
value[in] A GUID value.

◆ OdTfVariant() [5/7]

OdTfVariant::OdTfVariant ( const OdTfVariantTuple value)

Creates a new tuple of Tf variant objects from an existing variant object tuple.

Parameters
value[in] An original variant object tuple that is copied to the created one.

◆ OdTfVariant() [6/7]

OdTfVariant::OdTfVariant ( OdTfVariant::Type  type,
const OdTfVariantArray value 
)

Creates a new array of Tf variant objects of a specified data type from an existing array.

Parameters
type[in] A data type.
value[in] An original variant object array that is copied to the created one.

◆ OdTfVariant() [7/7]

OdTfVariant::OdTfVariant ( OdDbStub *const  value)

Creates a new Tf variant object from a specified raw data stub.

Parameters
value[in] A pointer to a raw stub.

◆ ~OdTfVariant()

virtual OdTfVariant::~OdTfVariant ( )
virtual

Destroys the variant object.

Member Function Documentation

◆ asVariantArray()

OdTfVariantArray & OdTfVariant::asVariantArray ( )

Retrieves the current variant data as a variant array.

Returns
Returns the array of variant values.
Remarks
In the variant object has a data type that differs from the array data type, the method throws an exception.

◆ asVariantTuple()

OdTfVariantTuple & OdTfVariant::asVariantTuple ( )

Retrieves the current variant data as a variant tuple.

Returns
Returns the tuple of variant values.
Remarks
In the variant object has a data type that differs from the tuple data type, the method throws an exception.

◆ empty()

static OdTfVariant OdTfVariant::empty ( )
static

Creates a new Tf variant object with an empty value. The created variant object has the OdTfVriantType::kEmpty type.

Returns
Returns a new Tf variant object with an empty value.

◆ getDbStubPtr()

OdDbStub * OdTfVariant::getDbStubPtr ( ) const

Retrieves the current raw data stub associated with the variant object.

Returns
Returns a pointer to the raw data stub.

◆ getDimsCount()

static OdUInt16 OdTfVariant::getDimsCount ( OdTfVariant::Type  type)
static

Retrieves the dimension quantity for a specified data type.

Parameters
type[in] A data type.
Returns
Returns dimensions count.

◆ getGUID()

const OdGUID & OdTfVariant::getGUID ( ) const

Retrieves the current GUID of the variant object.

Returns
Returns the current GUID of the variant object.

◆ getItemType()

static Type OdTfVariant::getItemType ( OdTfVariant::Type  type)
static

Retrieves the data type of an element of a multi-dimensional array defined with its data type.

Parameters
type[in] A data type that represents a multi-dimensional array.
Returns
Returns the data type that any element of specified multi-dimension array has.

◆ getRxObjectWeakPtr()

OdRxObject * OdTfVariant::getRxObjectWeakPtr ( ) const

Retrieves the weak pointer to an OdRxObject class instance associated with the variant object.

Returns
Returns a raw pointer to the OdRxObject class instance.

◆ getVariantArray()

const OdTfVariantArray & OdTfVariant::getVariantArray ( ) const

Retrieves the current array of variant values from the object.

Returns
Returns the array of variant values.

◆ getVariantTuple()

const OdTfVariantTuple & OdTfVariant::getVariantTuple ( ) const

Retrieves the current tuple of variant values from the object.

Returns
Returns the tuple of variant values.

◆ isEmpty()

bool OdTfVariant::isEmpty ( ) const

Retrieves whether the variant object is empty.

Returns
Returns true if the variant object is empty; otherwise returns false.

◆ isVariantArray()

bool OdTfVariant::isVariantArray ( ) const

Retrieves whether the variant object is an instance of a variant array.

Returns
Returns true if the variant object is a variant arrey; otherwise returns false.

◆ kVariantArray() [1/4]

static Type OdTfVariant::kVariantArray ( OdTfVariant::Type  type)
static

Dynamically generates a variant data type that represents an array of values with a specified data type.

Parameters
itemType[in] A data type.
Returns
Returns the requested data type.

◆ kVariantArray() [2/4]

static Type OdTfVariant::kVariantArray ( OdUInt16  nDims,
OdTfVariant::Type  itemType 
)
static

Dynamically generates a variant data type that represents a multi-dimensional array of values with a specified data type.

Parameters
nDims[in] A quantity of the array's dimensions.
itemType[in] A data type.
Returns
Returns the requested data type.

◆ kVariantArray() [3/4]

static Type OdTfVariant::kVariantArray ( OdUInt16  nDims,
OdUInt32  itemType 
)
static

Dynamically generates a variant data type that represents a multi-dimensional array of values with a specified data type.

Parameters
nDims[in] A quantity of the array's dimensions.
itemType[in] A data type.
Returns
Returns the requested data type.

◆ kVariantArray() [4/4]

static Type OdTfVariant::kVariantArray ( OdUInt32  itemType)
static

Dynamically generates a variant data type that represents an array of values with a specified data type.

Parameters
itemType[in] A data type.
Returns
Returns the requested data type.

◆ makeEmpty()

void OdTfVariant::makeEmpty ( )
protected

◆ operator=()

OdTfVariant & OdTfVariant::operator= ( const OdTfVariant value)

The assignment operator for two OdTfVariant objects.

Parameters
value[in] A right operand of the assignment operation.
Returns
Returns this variant object after the assignment operation.

◆ setDbStubPtr()

OdTfVariant & OdTfVariant::setDbStubPtr ( OdDbStub *const  value)

Sets a new raw data stub for the variant object.

Parameters
value[in] A new pointer to the stub.
Returns
Returns the reference to the modified variant object.

◆ setGUID()

OdTfVariant & OdTfVariant::setGUID ( const OdGUID value)

Sets a new GUID for the variant object.

Parameters
value[in] A new GUID value.
Returns
Returns the reference to the modified variant object.

◆ setRxObjectWeakPtr()

OdTfVariant & OdTfVariant::setRxObjectWeakPtr ( OdRxObject *const  value)

Sets a new weak pointer to the OdRxObject class instance associated with the variant object.

Parameters
value[in] A pointer to the OdRxObject class instance.
Returns
Returns the reference to the modified variant object.

◆ setVariantArray()

OdTfVariant & OdTfVariant::setVariantArray ( OdTfVariant::Type  type,
const OdTfVariantArray value 
)

Sets a new data type and variant values array for the variant object.

Parameters
type[in] A new data type value.
value[in] A new values array.
Returns
Returns the reference to the modified variant object.

◆ setVariantTuple()

OdTfVariant & OdTfVariant::setVariantTuple ( const OdTfVariantTuple value)

Sets a new variant value tuple for the variant object.

Parameters
value[in] A new values tuple.
Returns
Returns the reference to the modified variant object.

◆ setVarType()

void OdTfVariant::setVarType ( int  newType,
int &  type,
void data 
)
protectedvirtual

Reimplemented from OdVariant.

◆ typeFactory()

static const OdVariant::TypeFactory * OdTfVariant::typeFactory ( int  type)
static

Creates a factory (if it was not created previously) for variant objects of a specified data type.

Parameters
type[in] A data type of objects that are created by the factory.
Returns
Returns a raw pointer to a factory object.

The documentation for this class was generated from the following file: