#include <RxValue.h>
<group OdRx_Classes>
Generic variant type. Can contain any C++ type. Contained type is described by OdRxValueType.
Definition at line 88 of file RxValue.h.
◆ OdRxValue() [1/6]
OdRxValue::OdRxValue |
( |
| ) |
|
throw | ( | |
| ) | | |
|
inline |
◆ OdRxValue() [2/6]
OdRxValue::OdRxValue |
( |
const OdRxValue & |
rhs | ) |
|
throw | ( | |
| ) | | |
|
inline |
Copy constructor for objects of the OdRxValue class. Clones an existing instance of the OdRxValue class.
- Parameters
-
rhs | [in] Object of the OdRxValue class to be cloned. |
Definition at line 105 of file RxValue.h.
◆ OdRxValue() [3/6]
Constructor for objects of the OdRxValue class. Creates an OdRxValue object with the specified type and value. Source value should be compatible with the target type, e.g. enumeration can be constructed from integer (like reinterpret_cast<> for underlying C++ type).
- Parameters
-
type | [in] Value type of the object to be created. |
value | [in] Value to be assigned to the created object. |
Definition at line 119 of file RxValue.h.
◆ ~OdRxValue()
OdRxValue::~OdRxValue |
( |
| ) |
|
throw | ( | |
| ) | | |
|
inline |
◆ OdRxValue() [4/6]
template<typename ValueType >
OdRxValue::OdRxValue |
( |
const ValueType & |
value | ) |
|
throw | ( | |
| ) | | |
|
inline |
This constructor can be used for blittable (POD) types. For non-blittable types specialization should be declared.
- Parameters
-
value | [in] Value type for the constructed value object. |
Definition at line 289 of file RxValue.h.
◆ OdRxValue() [5/6]
template<>
OdRxValue::OdRxValue |
( |
const OdChar *const & |
| ) |
|
throw | ( | |
| ) | | |
◆ OdRxValue() [6/6]
template<>
OdRxValue::OdRxValue |
( |
const char *const & |
| ) |
|
throw | ( | |
| ) | | |
◆ empty()
static const OdRxValue & OdRxValue::empty |
( |
| ) |
|
throw | ( | |
| ) | | |
|
static |
Returns canonical empty value.
- Returns
- Canonical empty value.
◆ getEnumTag()
const OdRxEnumTag * OdRxValue::getEnumTag |
( |
| ) |
const |
throw | ( | |
| ) | | |
Gets the corresponding descriptor, if this value contains an enumeration item.
- Returns
- Enumeration item descriptor.
◆ isEmpty()
bool OdRxValue::isEmpty |
( |
| ) |
const |
throw | ( | |
| ) | | |
|
inline |
Checks if the value is empty.
- Returns
- true if the value is empty; false otherwise.
Definition at line 198 of file RxValue.h.
◆ isVaries()
bool OdRxValue::isVaries |
( |
| ) |
const |
throw | ( | |
| ) | | |
|
inline |
Checks whether the value is undefined. This is represented by assigning a special singleton value "varies".
- Returns
- true if the value is undefined; false otherwise.
Definition at line 215 of file RxValue.h.
◆ operator!=()
bool OdRxValue::operator!= |
( |
const OdRxValue & |
value | ) |
const |
throw | ( | |
| ) | | |
|
inline |
Negative comparison operator.
- Parameters
-
value | [in] Value to compare with the current value. |
- Returns
- true if values are not equal; false otherwise.
Definition at line 264 of file RxValue.h.
◆ operator<<()
template<typename ValueType >
void OdRxValue::operator<< |
( |
const ValueType & |
val | ) |
|
|
inline |
Assignment operator. Assigns a value from a C++ variable to this value.
- Parameters
-
val | [in] Value type of the corresponding C++ type to be assigned to this value. |
Definition at line 433 of file RxValue.h.
◆ operator=() [1/2]
Assignment operator.
- Parameters
-
rhs | [in] Value to be assigned. |
Definition at line 129 of file RxValue.h.
◆ operator=() [2/2]
template<typename ValueType >
OdRxValue & OdRxValue::operator= |
( |
const ValueType & |
rhs | ) |
|
throw | ( | |
| ) | | |
|
inline |
This assignment operator can be optionally specialized.
- Parameters
-
rhs | [in] Value type to be assigned to this value. |
- Returns
- This value.
Definition at line 339 of file RxValue.h.
◆ operator==()
bool OdRxValue::operator== |
( |
const OdRxValue & |
value | ) |
const |
throw | ( | |
| ) | | |
|
inline |
Comparison operator.
- Parameters
-
value | [in] Value to compare with the current value. |
- Returns
- true if values are equal; false otherwise.
Definition at line 249 of file RxValue.h.
◆ operator>>()
template<typename ValueType >
bool OdRxValue::operator>> |
( |
ValueType & |
val | ) |
const |
|
inline |
Outputs this value to a C++ variable. Unlike rxvalue_cast<>, it takes into account type propagations supported by type().toValueType or OdRxValueType::Desc<ValueType>::value().fromValueType.
- Parameters
-
val | [out] Value type of the corresponding C++ type. |
- Returns
- true if the operation was successful; false otherwise.
Definition at line 449 of file RxValue.h.
◆ serializeIn()
size_t OdRxValue::serializeIn |
( |
const void * |
pBytes, |
|
|
size_t |
maxBytesToRead |
|
) |
| |
Reads the value from the byte array.
- Parameters
-
pBytes | [out] Pointer to the byte array. |
maxBytesToRead | [in] Maximum number of the bytes to read. |
- Returns
- Actual number of the bytes read.
◆ serializeOut()
size_t OdRxValue::serializeOut |
( |
void * |
pBytes, |
|
|
size_t & |
maxBytesToWrite |
|
) |
| const |
Stores the value in the byte array.
- Parameters
-
pBytes | [out] Pointer to the byte array. |
maxBytesToWrite | [in] Maximum number of the bytes to write. |
- Returns
- Actual number of the bytes written.
◆ toString()
Converts the value to a string.
- Parameters
-
format | [in] Defines the format of the resulting string. |
- Returns
- Converted value.
Definition at line 236 of file RxValue.h.
◆ type()
Gets the metaclass describing the C++ type of the stored value.
- Returns
- Metaclass describing the C++ type of the stored value.
Definition at line 187 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
- ANSI string with clarification of value sense.
Definition at line 277 of file RxValue.h.
◆ unbox() [1/2]
Unwraps RxValue contained in OdRxBoxedValue.
- Parameters
-
- Returns
- Unwrapped value.
◆ unbox() [2/2]
Unwraps RxValue contained in OdRxBoxedValue.
- Parameters
-
- Returns
- Unwrapped value.
◆ varies()
static const OdRxValue & OdRxValue::varies |
( |
| ) |
|
throw | ( | |
| ) | | |
|
static |
Returns singleton, representing undefined value.
- Returns
- Singleton, representing undefined value.
◆ rxenum_cast [1/2]
template<typename ValueType >
const ValueType * rxenum_cast |
( |
const OdRxValue * |
value | ) |
|
throw | ( | |
| ) | | |
|
friend |
Constant correct safe cast for enumerations. Returns non-null only if ValueType is contained in this value.
- Parameters
-
value | [in] Value to be casted. |
- Returns
- Value type if it is contained in value; NULL otherwise.
Const correct safe cast for enumerations. Returns non-NULL only if ValueType is contained in this value.
- Parameters
-
value | [in] Enumeration value which to cast a value type from. |
- Returns
- Value type if ValueType is contained in the specified enumeration value. NULL otherwise.
Definition at line 370 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.
- Parameters
-
value | [in] Value to be casted. |
- Returns
- Value type if it is contained in value; NULL otherwise.
Safe cast for enumerations. Returns non-NULL only if ValueType is contained in this value.
- Parameters
-
value | [in] Enumeration value which to cast a value type from. |
- Returns
- Value type if ValueType is contained in the specified enumeration value. NULL otherwise.
Definition at line 322 of file RxValue.h.
◆ rxvalue_cast [1/2]
template<typename ValueType >
const ValueType * rxvalue_cast |
( |
const OdRxValue * |
value | ) |
|
throw | ( | |
| ) | | |
|
friend |
Constant correct safe cast version. Returns non-null only if ValueType is contained in this value.
- Parameters
-
value | [in] Value to be casted. |
- Returns
- Value type if it is contained in value; NULL otherwise.
Const correct safe cast. Returns non-NULL only if ValueType is contained in this value.
- Parameters
-
value | [in] Value which to cast a value type from. |
- Returns
- Value type if ValueType is contained in the specified value. NULL otherwise.
Definition at line 355 of file RxValue.h.
◆ rxvalue_cast [2/2]
template<typename ValueType >
ValueType * rxvalue_cast |
( |
OdRxValue * |
value | ) |
|
throw | ( | |
| ) | | |
|
friend |
Safe cast to the contained C++ type. Returns non-null only if ValueType is contained in this value.
- Parameters
-
value | [in] Value to be casted. |
- Returns
- Value type if it is contained in value; NULL otherwise.
Safe cast. Returns non-NULL only if ValueType is contained in this value.
- Parameters
-
value | [in] Value which to cast a value type from. |
- Returns
- Value type if ValueType is contained in the specified value. NULL otherwise.
Definition at line 307 of file RxValue.h.
The documentation for this class was generated from the following file: