Variant-like object used to set and retrieve property values in ECInstances. More...
#include <ECValue.h>
Classes | |
struct | BinaryInfo |
Structure to hold information about a binary type. More... | |
struct | DateTimeInfo |
struct | StringInfo |
Structure to hold information about String values. More... | |
Public Member Functions | |
void | ShallowCopy (ECValueCR v) |
Performs a shallow copy. More... | |
void | Clear () |
Clears memory, if necessary, and sets the value back to an uninitialized state. More... | |
ECValueR | operator= (ECValueCR rhs) |
Compares two ECValues for equality. More... | |
~ECValue () | |
Destructor. More... | |
ECValue () | |
Initializes a new instance of the ECValue type. More... | |
ECValue (ECValueCR v) | |
Initializes a new instance of the ECValue type from the given ECValue. More... | |
ECValue (ValueKind classification) | |
Constructs an uninitialized ECValue of the specified ValueKind. More... | |
ECValue (PrimitiveType primitiveType) | |
Constructs an uninitialized ECValue of the specified PrimitiveType. More... | |
ECValue (::Int32 integer32) | |
Initializes a new instance of ECValue from the given value. More... | |
ECValue (::Int64 long64) | |
Initializes a new instance of ECValue from the given value. More... | |
ECValue (double doubleVal) | |
Initializes a new instance of ECValue from the given value. More... | |
ECValue (WCharCP string, bool holdADuplicate=true) | |
Initializes a new instance of ECValue from the given value. More... | |
ECValue (Utf8CP string, bool holdADuplicate=true) | |
Initializes a new instance of ECValue from the given value. More... | |
ECValue (Utf16CP string, bool holdADuplicate=true) | |
Initializes a new instance of ECValue from the given value. More... | |
ECValue (const Byte *blob, size_t size) | |
Initializes a new instance of ECValue from the given value. More... | |
ECValue (DPoint2dCR point2d) | |
Initializes a new instance of ECValue from the given value. More... | |
ECValue (DPoint3dCR point3d) | |
Initializes a new instance of ECValue from the given value. More... | |
ECValue (bool value) | |
Initializes a new instance of ECValue from the given value. More... | |
ECValue (DateTimeCR dateTime) | |
Initializes a new instance of the ECValue type. More... | |
void | SetIsReadOnly (bool isReadOnly) |
Sets whether this ECValue is read-only. More... | |
bool | IsReadOnly () const |
Gets whether this ECValue is read-only or not. More... | |
void | SetIsNull (bool isNull) |
Sets whether this ECValue is NULL. More... | |
bool | IsNull () const |
Gets whether this ECValue is NULL or not. More... | |
void | SetIsLoaded (bool isLoaded) |
Sets whether this ECValue has had its value loaded. More... | |
bool | IsLoaded () const |
Gets whether this ECValue's value has been loaded. More... | |
void | SetToNull () |
Frees the values memory, if necessary, and sets the state to NULL. More... | |
void | From (ECValueCR v) |
Does a ShallowCopy of the supplied ECValue. More... | |
ValueKind | GetKind () const |
Returns the ValueKind of this value. More... | |
bool | IsUninitialized () const |
Checks whether this ECValue is uninitialized. More... | |
bool | IsString () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_String (regardless of encoding). More... | |
bool | IsUtf8 () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_String and is encoded in UTF-8. More... | |
bool | IsInteger () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_Integer. More... | |
bool | IsLong () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_Long. More... | |
bool | IsDouble () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_Double. More... | |
bool | IsBinary () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_Binary. More... | |
bool | IsBoolean () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_Boolean. More... | |
bool | IsPoint2D () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_Point2D. More... | |
bool | IsPoint3D () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_Point3D. More... | |
bool | IsDateTime () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_DateTime. More... | |
bool | IsIGeometry () const |
Indicates whether the content of this ECValue is of type DgnPlatform::PRIMITIVETYPE_IGeometry. More... | |
bool | IsArray () const |
Indicates whether the content of this ECValue is an array (DgnPlatform::VALUEKIND_Array). More... | |
bool | IsStruct () const |
Indicates whether the content of this ECValue is a struct (DgnPlatform::VALUEKIND_Struct). More... | |
bool | IsPrimitive () const |
Indicates whether the content of this ECValue is of a primitive type (DgnPlatform::VALUEKIND_Primitive). More... | |
PrimitiveType | GetPrimitiveType () const |
Gets the PrimitiveType of this ECValue. More... | |
BentleyStatus | SetPrimitiveType (PrimitiveType primitiveElementType) |
Sets the PrimitiveType of this ECValue. More... | |
bool | CanConvertToPrimitiveType (PrimitiveType type) const |
ECObjectsStatus | SetStructArrayInfo (uint32_t count, bool isFixedSize) |
Defines the StructArray for this ECValue. More... | |
ECObjectsStatus | SetPrimitiveArrayInfo (PrimitiveType primitiveElementtype, uint32_t count, bool isFixedSize) |
Defines the primitive array for this ECValue. More... | |
ArrayInfo | GetArrayInfo () const |
Returns the array information defining this ECValue. More... | |
int32_t | GetInteger () const |
Returns the integer value, if this ECValue holds an Integer. More... | |
BentleyStatus | SetInteger (int32_t integer) |
Sets the value of this ECValue to the given integer. More... | |
int64_t | GetLong () const |
Returns the long value, if this ECValue holds a long. More... | |
BentleyStatus | SetLong (int64_t long64) |
Sets the value of this ECValue to the given long. More... | |
bool | GetBoolean () const |
Returns the boolean value, if this ECValue holds a boolean. More... | |
BentleyStatus | SetBoolean (bool value) |
Sets the value of this ECValue to the given bool. More... | |
double | GetDouble () const |
BentleyStatus | SetDouble (double value) |
Sets the value of this ECValue to the given double. More... | |
WCharCP | GetString () const |
Gets the string content of this ECValue. More... | |
Utf8CP | GetUtf8CP () const |
Gets the string content of this ECValue in UTF-8 encoding. More... | |
Utf16CP | GetUtf16CP () const |
Returns the string value as a Utf16CP, if this ECValue holds a string. More... | |
BentleyStatus | SetString (WCharCP string, bool holdADuplicate=true) |
Sets the value of this ECValue to the given string. More... | |
BentleyStatus | SetUtf8CP (Utf8CP string, bool holdADuplicate=true) |
Sets the value of this ECValue to the given string. More... | |
BentleyStatus | SetUtf16CP (Utf16CP string, bool holdADuplicate=true) |
Sets the value of this ECValue to the given string. More... | |
const Byte * | GetBinary (size_t &size) const |
Returns the binary value, if this ECValue holds binary data. More... | |
BentleyStatus | SetBinary (const Byte *data, size_t size, bool holdADuplicate=false) |
Sets the value of this ECValue to the given byte array. More... | |
IGeometryPtr | GetIGeometry () const |
Returns the IGeometry, if this ECValue holds a geometry value. More... | |
BentleyStatus | SetIGeometry (IGeometryCR geometry) |
IECInstancePtr | GetStruct () const |
Gets the struct instance of this ECValue, if the ECValue holds a struct. More... | |
BentleyStatus | SetStruct (IECInstanceP structInstance) |
Sets the specified struct instance in the ECValue. More... | |
DateTime | GetDateTime () const |
Gets the DateTime value. More... | |
BentleyStatus | SetDateTime (DateTimeCR dateTime) |
Sets the DateTime value. More... | |
int64_t | GetDateTimeTicks () const |
Gets the DateTime value as ticks since the beginning of the Common Era epoch. More... | |
int64_t | GetDateTimeUnixMillis () const |
Returns the DateTime value as milliseconds since the beginning of the Unix epoch. More... | |
int64_t | GetDateTimeTicks (bool &hasMetadata, DateTime::Info &metadata) const |
Gets the DateTime value as ticks since the beginning of the Common Era epoch. More... | |
BentleyStatus | SetDateTimeTicks (int64_t ceTicks) |
Sets the DateTime value as ticks since the beginning of the Common Era epoch. More... | |
BentleyStatus | SetDateTimeTicks (int64_t ceTicks, DateTime::Info const &dateTimeMetadata) |
Sets the DateTime value as ticks since the beginning of the Common Era epoch. More... | |
DPoint2d | GetPoint2D () const |
Returns the DPoint2d value, if this ECValue holds a Point2d. More... | |
BentleyStatus | SetPoint2D (DPoint2dCR value) |
Sets the value of this ECValue to the given DPoint2d. More... | |
DPoint3d | GetPoint3D () const |
Returns the DPoint3d value, if this ECValue holds a Point3d. More... | |
BentleyStatus | SetPoint3D (DPoint3dCR value) |
Sets the value of this ECValue to the given DPoint3d. More... | |
WString | ToString () const |
This is intended for debugging purposes, not for presentation purposes. More... | |
bool | Equals (ECValueCR v) const |
Checks 2 ECValues for equality. More... | |
Static Public Member Functions | |
static uint32_t | GetFixedPrimitiveValueSize (PrimitiveType primitiveType) |
For fixed primitive types, returns the number of bytes required to represent the type. More... | |
Protected Types | |
typedef bvector< ECValue > | ValuesVector |
typedef bvector< ECValue > * | ValuesVectorP |
Protected Member Functions | |
void | ConstructUninitialized () |
Constructs an uninitialized ECValue object. More... | |
void | FreeMemory () |
If appropriate for the value type, frees the memory used to store the value. More... | |
Protected Attributes | |
union { | |
bool m_boolean | |
If a Boolean primitive type, holds the bool value. More... | |
::Int32 m_integer32 | |
If an Int32 primitive type, holds the Int32 value. More... | |
::Int64 m_long64 | |
If an Int64 primitive type, holds the Int64 value. More... | |
double m_double | |
If a double primitive type, holds the double value. More... | |
StringInfo m_stringInfo | |
If a String primitive type, holds the StringInfo struct defining the string. More... | |
DPoint2d m_dPoint2d | |
If a DPoint2d primitive, holds the DPoint2d value. More... | |
DateTimeInfo m_dateTimeInfo | |
If a DateTime primitive, holds the DateTime value. More... | |
DPoint3d m_dPoint3d | |
If a DPoint3d primitive, holds the DPoint3d value. More... | |
ArrayInfo m_arrayInfo | |
If an array value, holds the ArrayInfo struct defining the array. More... | |
BinaryInfo m_binaryInfo | |
If a binary value, holds the BinaryInfo struct defining the binary data. More... | |
IECInstanceP m_structInstance | |
The ECValue class calls AddRef and Release for the member as needed. More... | |
}; | |
The union storing the actual data of this ECValue. More... | |
Variant-like object used to set and retrieve property values in ECInstances.
|
protected |
|
protected |
~ECValue | ( | ) |
Destructor.
ECValue | ( | ECValueCR | v | ) |
|
explicit |
|
explicit |
|
explicit |
Initializes a new instance of ECValue from the given value.
Type is set to DgnPlatform::PRIMITIVETYPE_Binary
blob
is created. Use ECValue::SetBinary otherwise. [in] | blob | Value to initialize this ECValue from |
[in] | size | Size in bytes of the blob |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
Initializes a new instance of the ECValue type.
[in] | dateTime | Date time value to set. |
bool CanConvertToPrimitiveType | ( | PrimitiveType | type | ) | const |
void Clear | ( | ) |
Clears memory, if necessary, and sets the value back to an uninitialized state.
|
protected |
Constructs an uninitialized ECValue object.
bool Equals | ( | ECValueCR | v | ) | const |
Checks 2 ECValues for equality.
|
protected |
If appropriate for the value type, frees the memory used to store the value.
void From | ( | ECValueCR | v | ) |
const Byte* GetBinary | ( | size_t & | size | ) | const |
Returns the binary value, if this ECValue holds binary data.
[in] | size | The size of the binary data |
bool GetBoolean | ( | ) | const |
Returns the boolean value, if this ECValue holds a boolean.
DateTime GetDateTime | ( | ) | const |
Gets the DateTime value.
int64_t GetDateTimeTicks | ( | ) | const |
Gets the DateTime value as ticks since the beginning of the Common Era epoch.
int64_t GetDateTimeTicks | ( | bool & | hasMetadata, |
DateTime::Info & | metadata | ||
) | const |
Gets the DateTime value as ticks since the beginning of the Common Era epoch.
[out] | hasMetadata | true, if this ECValue objects contains date time metadata. false otherwise |
[out] | metadata | if hasMetadata is true, contains the metadata available in this ECValue. |
int64_t GetDateTimeUnixMillis | ( | ) | const |
Returns the DateTime value as milliseconds since the beginning of the Unix epoch.
The Unix epoch begins at 1970-01-01 00:00:00 UTC. DateTimes before the Unix epoch are negative.
double GetDouble | ( | ) | const |
|
static |
For fixed primitive types, returns the number of bytes required to represent the type.
[in] | primitiveType | The type to measure |
IGeometryPtr GetIGeometry | ( | ) | const |
Returns the IGeometry, if this ECValue holds a geometry value.
ValueKind GetKind | ( | ) | const |
Returns the ValueKind of this value.
PrimitiveType GetPrimitiveType | ( | ) | const |
Gets the PrimitiveType of this ECValue.
WCharCP GetString | ( | ) | const |
Gets the string content of this ECValue.
IECInstancePtr GetStruct | ( | ) | const |
Utf8CP GetUtf8CP | ( | ) | const |
Gets the string content of this ECValue in UTF-8 encoding.
bool IsArray | ( | ) | const |
bool IsBinary | ( | ) | const |
bool IsBoolean | ( | ) | const |
bool IsDateTime | ( | ) | const |
bool IsDouble | ( | ) | const |
bool IsIGeometry | ( | ) | const |
bool IsInteger | ( | ) | const |
bool IsLoaded | ( | ) | const |
Gets whether this ECValue's value has been loaded.
bool IsLong | ( | ) | const |
bool IsNull | ( | ) | const |
bool IsPoint2D | ( | ) | const |
bool IsPoint3D | ( | ) | const |
bool IsPrimitive | ( | ) | const |
bool IsReadOnly | ( | ) | const |
bool IsString | ( | ) | const |
bool IsStruct | ( | ) | const |
bool IsUninitialized | ( | ) | const |
Checks whether this ECValue is uninitialized.
bool IsUtf8 | ( | ) | const |
ECValueR operator= | ( | ECValueCR | rhs | ) |
Compares two ECValues for equality.
BentleyStatus SetBinary | ( | const Byte * | data, |
size_t | size, | ||
bool | holdADuplicate = false |
||
) |
Sets the value of this ECValue to the given byte array.
[in] | data | The value to set |
[in] | size | The size of the data |
[in] | holdADuplicate | Flag specifying whether the ECValue should make its own copy of the string, or store the actual pointer passed in |
BentleyStatus SetBoolean | ( | bool | value | ) |
BentleyStatus SetDateTime | ( | DateTimeCR | dateTime | ) |
Sets the DateTime value.
[in] | dateTime | DateTime value to set |
BentleyStatus SetDateTimeTicks | ( | int64_t | ceTicks | ) |
Sets the DateTime value as ticks since the beginning of the Common Era epoch.
[in] | ceTicks | DateTime Common Era ticks to set |
BentleyStatus SetDateTimeTicks | ( | int64_t | ceTicks, |
DateTime::Info const & | dateTimeMetadata | ||
) |
Sets the DateTime value as ticks since the beginning of the Common Era epoch.
[in] | ceTicks | DateTime Common Era ticks to set |
[in] | dateTimeMetadata | DateTime metadata to set along with the ticks. |
BentleyStatus SetDouble | ( | double | value | ) |
BentleyStatus SetIGeometry | ( | IGeometryCR | geometry | ) |
BentleyStatus SetInteger | ( | int32_t | integer | ) |
void SetIsLoaded | ( | bool | isLoaded | ) |
Sets whether this ECValue has had its value loaded.
[in] | isLoaded | Indicates whether the value has been loaded |
void SetIsNull | ( | bool | isNull | ) |
void SetIsReadOnly | ( | bool | isReadOnly | ) |
BentleyStatus SetLong | ( | int64_t | long64 | ) |
BentleyStatus SetPoint2D | ( | DPoint2dCR | value | ) |
BentleyStatus SetPoint3D | ( | DPoint3dCR | value | ) |
ECObjectsStatus SetPrimitiveArrayInfo | ( | PrimitiveType | primitiveElementtype, |
uint32_t | count, | ||
bool | isFixedSize | ||
) |
Defines the primitive array for this ECValue.
[in] | primitiveElementtype | The type of primitive the array will hold |
[in] | count | The initial size of the array |
[in] | isFixedSize | Indicates whether this array can grow or not |
BentleyStatus SetPrimitiveType | ( | PrimitiveType | primitiveElementType | ) |
BentleyStatus SetString | ( | WCharCP | string, |
bool | holdADuplicate = true |
||
) |
Sets the value of this ECValue to the given string.
[in] | string | The value to set |
[in] | holdADuplicate | Flag specifying whether the ECValue should make its own copy of the string, or store the actual pointer passed in |
BentleyStatus SetStruct | ( | IECInstanceP | structInstance | ) |
ECObjectsStatus SetStructArrayInfo | ( | uint32_t | count, |
bool | isFixedSize | ||
) |
Defines the StructArray for this ECValue.
[in] | count | The initial size of the array |
[in] | isFixedSize | Indicates whether this array can grow or not |
void SetToNull | ( | ) |
Frees the values memory, if necessary, and sets the state to NULL.
BentleyStatus SetUtf16CP | ( | Utf16CP | string, |
bool | holdADuplicate = true |
||
) |
Sets the value of this ECValue to the given string.
[in] | string | The value to set |
[in] | holdADuplicate | Flag specifying whether the ECValue should make its own copy of the string, or store the actual pointer passed in |
BentleyStatus SetUtf8CP | ( | Utf8CP | string, |
bool | holdADuplicate = true |
||
) |
Sets the value of this ECValue to the given string.
[in] | string | The value to set |
[in] | holdADuplicate | Flag specifying whether the ECValue should make its own copy of the string, or store the actual pointer passed in |
void ShallowCopy | ( | ECValueCR | v | ) |
Performs a shallow copy.
WString ToString | ( | ) | const |
This is intended for debugging purposes, not for presentation purposes.
union { ... } |
The union storing the actual data of this ECValue.
BinaryInfo m_binaryInfo |
If a binary value, holds the BinaryInfo struct defining the binary data.
bool m_boolean |
If a Boolean primitive type, holds the bool value.
DateTimeInfo m_dateTimeInfo |
If a DateTime primitive, holds the DateTime value.
double m_double |
If a double primitive type, holds the double value.
DPoint2d m_dPoint2d |
If a DPoint2d primitive, holds the DPoint2d value.
DPoint3d m_dPoint3d |
If a DPoint3d primitive, holds the DPoint3d value.
::Int32 m_integer32 |
If an Int32 primitive type, holds the Int32 value.
::Int64 m_long64 |
If an Int64 primitive type, holds the Int64 value.
PrimitiveType m_primitiveType |
|
mutable |
If a String primitive type, holds the StringInfo struct defining the string.
IECInstanceP m_structInstance |
The ECValue class calls AddRef and Release for the member as needed.
ValueKind m_valueKind |