CFx SDK Documentation  2020SP3
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
OdRxValue Class Reference

#include <RxValue.h>

Public Member Functions

 OdRxValue () throw ()
 
 OdRxValue (const OdRxValue &rhs) throw ()
 
 OdRxValue (const OdRxValueType &type, const OdRxValue &value) throw ()
 
const OdRxValueoperator= (const OdRxValue &rhs) throw ()
 
 ~OdRxValue () throw ()
 
const OdRxValueTypetype () const throw ()
 
bool isEmpty () const throw ()
 
bool isVaries () const throw ()
 
OdString toString (OdRxValueType::StringFormat format=OdRxValueType::kStringFormatGlobal) const throw ()
 
bool operator== (const OdRxValue &value) const throw ()
 
bool operator!= (const OdRxValue &value) const throw ()
 
const OdAnsiString typePath () const
 
template<typename ValueType >
 OdRxValue (const ValueType &value) throw ()
 
template<typename ValueType >
OdRxValueoperator= (const ValueType &rhs) throw ()
 
const OdRxEnumTaggetEnumTag () const throw ()
 
size_t serializeOut (void *pBytes, size_t &maxBytesToWrite) const
 
size_t serializeIn (const void *pBytes, size_t maxBytesToRead)
 
template<typename ValueType >
void operator<< (const ValueType &val)
 
template<typename ValueType >
bool operator>> (ValueType &val) const
 
template<>
 OdRxValue (const OdChar *const &) throw ()
 
template<>
 OdRxValue (const char *const &) throw ()
 

Static Public Member Functions

static const OdRxValueempty () throw ()
 
static const OdRxValuevaries () throw ()
 
static const OdRxValueunbox (const OdRxObject *pO) throw ()
 
static OdRxValueunbox (OdRxObject *pO) throw ()
 

Friends

template<typename ValueType >
ValueType * rxvalue_cast (OdRxValue *value) throw ()
 
template<typename ValueType >
ValueType * rxenum_cast (OdRxValue *value) throw ()
 
template<typename ValueType >
const ValueType * rxvalue_cast (const OdRxValue *value) throw ()
 
template<typename ValueType >
const ValueType * rxenum_cast (const OdRxValue *value) throw ()
 

Detailed Description

<group OdRx_Classes>

Generic variant type. May contain any C++ type. Contained type is described by OdRxValueType.

Definition at line 63 of file RxValue.h.

Constructor & Destructor Documentation

◆ OdRxValue() [1/6]

OdRxValue::OdRxValue ( )
throw (
)
inline

Default constructor.

Definition at line 69 of file RxValue.h.

◆ OdRxValue() [2/6]

OdRxValue::OdRxValue ( const OdRxValue rhs)
throw (
)
inline

Copy constructor.

Definition at line 77 of file RxValue.h.

◆ OdRxValue() [3/6]

OdRxValue::OdRxValue ( const OdRxValueType type,
const OdRxValue value 
)
throw (
)
inline

Create value with a given type. Source value should be "compatible" with the target type, e.g. enumeration may be constructed from integer. (Like reinterpret_cast<> for underlying C++ type)

Definition at line 86 of file RxValue.h.

◆ ~OdRxValue()

OdRxValue::~OdRxValue ( )
throw (
)
inline

Definition at line 133 of file RxValue.h.

◆ OdRxValue() [4/6]

template<typename ValueType >
OdRxValue::OdRxValue ( const ValueType &  value)
throw (
)
inline

This constructor may be used for blittable (POD) types. For non-blittable types specialization should be declared.

Definition at line 211 of file RxValue.h.

◆ OdRxValue() [5/6]

template<>
OdRxValue::OdRxValue ( const OdChar *const &  )
throw (
)

◆ OdRxValue() [6/6]

template<>
OdRxValue::OdRxValue ( const char *const &  )
throw (
)

Member Function Documentation

◆ empty()

static const OdRxValue& OdRxValue::empty ( )
throw (
)
static

Canonical empty value.

◆ getEnumTag()

const OdRxEnumTag* OdRxValue::getEnumTag ( ) const
throw (
)

If this value contains enumeration item, returns corresponding descriptor.

◆ isEmpty()

bool OdRxValue::isEmpty ( ) const
throw (
)
inline

Returns true if the value is empty.

Definition at line 154 of file RxValue.h.

◆ isVaries()

bool OdRxValue::isVaries ( ) const
throw (
)
inline

Returns true if the value is undefined. This is represented by assigning special singleton value "varies".

Definition at line 164 of file RxValue.h.

◆ operator!=()

bool OdRxValue::operator!= ( const OdRxValue value) const
throw (
)
inline

Returns true if values are not equal.

Definition at line 192 of file RxValue.h.

◆ operator<<()

template<typename ValueType >
void OdRxValue::operator<< ( const ValueType &  val)
inline

Definition at line 296 of file RxValue.h.

◆ operator=() [1/2]

const OdRxValue& OdRxValue::operator= ( const OdRxValue rhs)
throw (
)
inline

Assignment operator.

Definition at line 94 of file RxValue.h.

◆ operator=() [2/2]

template<typename ValueType >
OdRxValue& OdRxValue::operator= ( const ValueType &  rhs)
throw (
)
inline

This assignment operator may be optionally specialized.

Definition at line 244 of file RxValue.h.

◆ operator==()

bool OdRxValue::operator== ( const OdRxValue value) const
throw (
)
inline

Returns true if values are equal.

Definition at line 182 of file RxValue.h.

◆ operator>>()

template<typename ValueType >
bool OdRxValue::operator>> ( ValueType &  val) const
inline

Output this value into the C++ variable. Unlike rxvalue_cast<> takes into account type propagations supported by type().toValueType or OdRxValueType::Desc<ValueType>::value().fromValueType

Definition at line 306 of file RxValue.h.

◆ serializeIn()

size_t OdRxValue::serializeIn ( const void pBytes,
size_t  maxBytesToRead 
)

Read value from the byte array.

◆ serializeOut()

size_t OdRxValue::serializeOut ( void pBytes,
size_t &  maxBytesToWrite 
) const

Store value in the byte array.

◆ toString()

OdString OdRxValue::toString ( OdRxValueType::StringFormat  format = OdRxValueType::kStringFormatGlobal) const
throw (
)
inline

Convert value to string. (Mostly for debug purposes.)

Definition at line 174 of file RxValue.h.

◆ type()

const OdRxValueType& OdRxValue::type ( ) const
throw (
)
inline

Metaclass describing C++ type of the stored value.

Definition at line 146 of file RxValue.h.

◆ typePath()

const OdAnsiString OdRxValue::typePath ( ) const
inline

Retreives an ansi string in format of path that elaborates the sense of value of the value type. Can be interpreted additionally when working with RxValue.

Returns
Returns an ansi string with clarification of value sense.

Definition at line 202 of file RxValue.h.

◆ unbox() [1/2]

static const OdRxValue* OdRxValue::unbox ( const OdRxObject pO)
throw (
)
static

Unwraps RxValue contained in OdRxBoxedValue

◆ unbox() [2/2]

static OdRxValue* OdRxValue::unbox ( OdRxObject pO)
throw (
)
static

Unwraps RxValue contained in OdRxBoxedValue

◆ varies()

static const OdRxValue& OdRxValue::varies ( )
throw (
)
static

Singleton representing undefined value.

Friends And Related Function Documentation

◆ rxenum_cast [1/2]

template<typename ValueType >
const ValueType* rxenum_cast ( const OdRxValue value)
throw (
)
friend

Const correct safe cast for enumerations. Returns non-null only if ValueType is contained in this value.

Definition at line 263 of file RxValue.h.

◆ rxenum_cast [2/2]

template<typename ValueType >
ValueType* rxenum_cast ( OdRxValue value)
throw (
)
friend

Safe cast for enumerations. Returns non-null only if ValueType is contained in this value.

Definition at line 232 of file RxValue.h.

◆ rxvalue_cast [1/2]

template<typename ValueType >
const ValueType* rxvalue_cast ( const OdRxValue value)
throw (
)
friend

Const correct safe cast version. Returns non-null only if ValueType is contained in this value.

Const correct safe cast. Returns non-null only if ValueType is contained in this value.

Definition at line 254 of file RxValue.h.

◆ rxvalue_cast [2/2]

template<typename ValueType >
ValueType* rxvalue_cast ( OdRxValue value)
throw (
)
friend

Safe cast to contained C++ type. Returns non-null only if ValueType is contained in this value.

Safe cast. Returns non-null only if ValueType is contained in this value.

Definition at line 223 of file RxValue.h.


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