ctrlX Data Layer .NET API  4.3.0
Loading...
Searching...
No Matches
Variant Class Reference

Provides the implementation for IVariant. More...

Inheritance diagram for Variant:
IVariant INativeDisposable

Public Member Functions

 Variant ()
 Initializes a new instance of the Variant class.
 
 Variant (bool value)
 Initializes a new instance of the Variant class.
 
 Variant (bool[] value)
 Initializes a new instance of the Variant class.
 
 Variant (byte value)
 Initializes a new instance of the Variant class.
 
 Variant (byte[] value, bool raw=false)
 Initializes a new instance of the Variant class.
 
 Variant (ByteBuffer flatBuffers)
 Initializes a new instance of the Variant class.
 
 Variant (DateTime value)
 Initializes a new instance of the Variant class.
 
 Variant (DateTime[] value)
 Initializes a new instance of the Variant class.
 
 Variant (double value)
 Initializes a new instance of the Variant class.
 
 Variant (double[] value)
 Initializes a new instance of the Variant class.
 
 Variant (FlatBufferBuilder builder)
 Initializes a new instance of the Variant class.
 
 Variant (float value)
 Initializes a new instance of the Variant class.
 
 Variant (float[] value)
 Initializes a new instance of the Variant class.
 
 Variant (int value)
 Initializes a new instance of the Variant class.
 
 Variant (int[] value)
 Initializes a new instance of the Variant class.
 
 Variant (IVariant other)
 Initializes a new instance of the Variant class.
 
 Variant (long value)
 Initializes a new instance of the Variant class.
 
 Variant (long[] value)
 Initializes a new instance of the Variant class.
 
 Variant (sbyte value)
 Initializes a new instance of the Variant class.
 
 Variant (sbyte[] value)
 Initializes a new instance of the Variant class.
 
 Variant (short value)
 Initializes a new instance of the Variant class.
 
 Variant (short[] value)
 Initializes a new instance of the Variant class.
 
 Variant (string value)
 Initializes a new instance of the Variant class.
 
 Variant (string[] value)
 Initializes a new instance of the Variant class.
 
 Variant (uint value)
 Initializes a new instance of the Variant class.
 
 Variant (uint[] value)
 Initializes a new instance of the Variant class.
 
 Variant (ulong value)
 Initializes a new instance of the Variant class.
 
 Variant (ulong[] value)
 Initializes a new instance of the Variant class.
 
 Variant (ushort value)
 Initializes a new instance of the Variant class.
 
 Variant (ushort[] value)
 Initializes a new instance of the Variant class.
 
DLR_RESULT CheckConvert (DLR_VARIANT_TYPE type)
 Checks if the Variant is convertable to given data type.
 
Variant Clone ()
 Clones the instance.
 
void Dispose ()
 Disposes the instance.
 
override bool Equals (object obj)
 Returns a value that indicates if this Variant equals given object.
 
bool Equals (Variant other)
 Returns a value that indicates if this Variant equals given Variant.
 
DLR_RESULT IVariant value GetDataFromFlatbuffers (IVariant typeFlatbuffers, string query)
 
override int GetHashCode ()
 Gets the HashCode of this Variant.
 
bool ToBool ()
 Gets the value as bool.
 
bool[] ToBoolArray ()
 Gets the value as bool array.
 
byte ToByte ()
 Gets the value as byte.
 
byte[] ToByteArray ()
 Gets the value as byte array.
 
DateTime ToDateTime ()
 Converts the value to a timestamp.
 
DateTime[] ToDateTimeArray ()
 Gets the value as DateTime array.
 
double ToDouble ()
 Gets the value as double.
 
double[] ToDoubleArray ()
 Gets the value as double array.
 
ByteBuffer ToFlatbuffers ()
 Gets the value as Flatbuffers.
 
float ToFloat ()
 Gets the value as float.
 
float[] ToFloatArray ()
 Gets the value as float array.
 
short ToInt16 ()
 Gets the value as short.
 
short[] ToInt16Array ()
 Gets the value as short array.
 
int ToInt32 ()
 Gets the value as int.
 
int[] ToInt32Array ()
 Gets the value as int array.
 
long ToInt64 ()
 Gets the value as long.
 
long[] ToInt64Array ()
 Gets the value as long array.
 
byte[] ToRawByteArray ()
 Gets the value as raw byte array (UTF8).
 
sbyte ToSByte ()
 Gets the value as sbyte.
 
sbyte[] ToSByteArray ()
 Gets the value as sbyte array.
 
override string ToString ()
 Gets the value as string.
 
string[] ToStringArray ()
 Gets the value as string array.
 
ushort ToUInt16 ()
 Gets the value as ushort.
 
ushort[] ToUInt16Array ()
 Gets the value as ushort array.
 
uint ToUInt32 ()
 Gets the value as uint.
 
uint[] ToUInt32Array ()
 Gets the value as uint array.
 
ulong ToUInt64 ()
 Gets the value as ulong.
 
ulong[] ToUInt64Array ()
 Gets the value as ulong array.
 
DLR_RESULT CheckConvert (DLR_VARIANT_TYPE dataType)
 Gets a value that indicates whether the variant can be converted to another type.
 
Variant Clone ()
 Clones the value.
 
bool Equals (Variant other)
 Gets a value that indicates whether the values are equal.
 
DLR_RESULT IVariant value GetDataFromFlatbuffers (IVariant typeFlatbuffers, string query)
 
int GetHashCode ()
 Gets the hash code of the variant.
 
bool ToBool ()
 Converts the value to bool.
 
bool[] ToBoolArray ()
 Converts the value to an array of bool value.
 
byte ToByte ()
 Converts the value to an 8-bit unsigned integer.
 
byte[] ToByteArray ()
 Converts the value to an array of 8-bit unsigned integers.
 
DateTime ToDateTime ()
 Converts the value to DateTime.
 
DateTime[] ToDateTimeArray ()
 Converts the value to an array of DateTime.
 
double ToDouble ()
 Converts the value to a double-precision floating-point number.
 
double[] ToDoubleArray ()
 Converts the value to an array of double-precision floating-point numbers.
 
ByteBuffer ToFlatbuffers ()
 Converts the value to flatbuffers.
 
float ToFloat ()
 Converts the value to float.
 
float[] ToFloatArray ()
 Converts the value to an array of float.
 
short ToInt16 ()
 Converts the value to a 16-bit signed integer.
 
short[] ToInt16Array ()
 Converts the value to an array of 16-bit signed integers.
 
int ToInt32 ()
 Converts the value to a 32-bit signed integer.
 
int[] ToInt32Array ()
 Converts the value to an array of 32-bit signed integers.
 
long ToInt64 ()
 Converts the value to a 64-bit signed integer.
 
long[] ToInt64Array ()
 Converts the value to an array of 64-bit signed integers.
 
byte[] ToRawByteArray ()
 Converts the value to an array of 8-bit raw integers.
 
sbyte ToSByte ()
 Converts the value to an 8-bit signed integer.
 
sbyte[] ToSByteArray ()
 Converts the value to an array of an 8-bit signed integers.
 
string ToString ()
 Converts the value to string. If the value can't be converted for any reason, an empty string is returned. For arrays and numbers an empty string is returned (not implemented yet).
 
string[] ToStringArray ()
 Converts the value to an array of strings.
 
ushort ToUInt16 ()
 Converts the value to a 16-bit unsigned integer.
 
ushort[] ToUInt16Array ()
 Converts the value to an array of 16-bit unsigned integers.
 
uint ToUInt32 ()
 Converts the value to a 32-bit unsigned integer.
 
uint[] ToUInt32Array ()
 Converts the value to an array of 32-bit unsigned integers.
 
ulong ToUInt64 ()
 Converts the value to a 64-bit unsigned integer.
 
ulong[] ToUInt64Array ()
 Converts the value to an array of 64-bit unsigned integers.
 

Static Public Member Functions

static implicit operator Variant (bool source)
 Implicit operator.
 
static implicit operator Variant (bool[] source)
 Implicit operator.
 
static implicit operator Variant (byte source)
 Implicit operator.
 
static implicit operator Variant (byte[] source)
 Implicit operator.
 
static implicit operator Variant (ByteBuffer source)
 Implicit operator.
 
static implicit operator Variant (DateTime source)
 Implicit operator.
 
static implicit operator Variant (DateTime[] source)
 Implicit operator.
 
static implicit operator Variant (double source)
 Implicit operator.
 
static implicit operator Variant (double[] source)
 Implicit operator.
 
static implicit operator Variant (FlatBufferBuilder source)
 Implicit operator.
 
static implicit operator Variant (float source)
 Implicit operator.
 
static implicit operator Variant (float[] source)
 Implicit operator.
 
static implicit operator Variant (int source)
 Implicit operator.
 
static implicit operator Variant (int[] source)
 Implicit operator.
 
static implicit operator Variant (long source)
 Implicit operator.
 
static implicit operator Variant (long[] source)
 Implicit operator.
 
static implicit operator Variant (sbyte source)
 Implicit operator.
 
static implicit operator Variant (sbyte[] source)
 Implicit operator.
 
static implicit operator Variant (short source)
 Implicit operator.
 
static implicit operator Variant (short[] source)
 Implicit operator.
 
static implicit operator Variant (string source)
 Implicit operator.
 
static implicit operator Variant (string[] source)
 Implicit operator.
 
static implicit operator Variant (uint source)
 Implicit operator.
 
static implicit operator Variant (uint[] source)
 Implicit operator.
 
static implicit operator Variant (ulong source)
 Implicit operator.
 
static implicit operator Variant (ulong[] source)
 Implicit operator.
 
static implicit operator Variant (ushort source)
 Implicit operator.
 
static implicit operator Variant (ushort[] source)
 Implicit operator.
 
static bool operator!= (Variant l, Variant r)
 s Unequality Operator.
 
static bool operator== (Variant l, Variant r)
 Equality Operator.
 

Public Attributes

DLR_RESULT result
 Gets data of a complex Variant (flatbuffers) by query.
 
- Public Attributes inherited from IVariant
DLR_RESULT result
 Gets data of a complex Variant (flatbuffers) by query.
 

Static Public Attributes

static readonly int DefaultFlatbuffersInitialSize = 1024
 Gets the default Flatbuffers initial size in bytes.
 
static readonly Variant Empty = new Variant(string.Empty)
 Gets a Variant with empty string value.
 
static readonly Variant False = new Variant(false)
 Gets a Variant with boolean value 'false'.
 
static readonly Variant Null = new Variant()
 Gets a Variant with no value of data type 'DLR_VARIANT_TYPE_UNKNOWN'.
 
static readonly Variant One = new Variant(1)
 Gets a Variant with value '1' of data type 'int' (Int32).
 
static readonly Variant True = new Variant(true)
 Gets a Variant with boolean value 'true'.
 
static readonly Variant Zero = new Variant(0)
 Gets a Variant with value '0' of data type 'int' (Int32).
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Disposes the instance.
 

Properties

DLR_VARIANT_TYPE DataType [get]
 Gets the data type.
 
bool IsArray [get]
 Gets a value that indicates whether the Variant is an array.
 
bool IsBool [get]
 Gets a value that indicates whether the Variant contains a boolean value.
 
bool IsDisposed [get]
 Gets a value that indicates whether the instance is disposed.
 
bool IsFlatbuffers [get]
 Gets a value that indicates whether the Variant contains Flatbuffers.
 
bool IsNull [get]
 Gets a value that indicates whether the Variant is null.
 
bool IsNumber [get]
 Gets a value that indicates whether the Variant contains a numeric value. Returns false for numeric arrays and booleans.
 
bool IsString [get]
 Gets a value that indicates whether the Variant contains a string value.
 
string JsonDataType [get]
 Gets the Json data type.
 
object Value [get]
 Gets the value.
 
- Properties inherited from IVariant
DLR_VARIANT_TYPE DataType [get]
 Gets the data type of the variant.
 
bool IsArray [get]
 Checks if the value is an array.
 
bool IsBool [get]
 Gets a value that indicates whether the Variant contains a boolean value.
 
bool IsFlatbuffers [get]
 Checks if the value is flatbuffers.
 
bool IsNull [get]
 Checks if the value is null.
 
bool IsNumber [get]
 Gets a value that indicates whether the Variant contains a numeric value Returns false for numeric arrays and booleans.
 
bool IsString [get]
 Gets a value that indicates whether the Variant contains a string value.
 
string JsonDataType [get]
 Gets the data type as JSON string.
 
object Value [get]
 Gets the value of the variant.
 
- Properties inherited from INativeDisposable
bool IsDisposed [get]
 Checks disposed.
 

Detailed Description

Provides the implementation for IVariant.

Definition at line 17 of file Variant.cs.

Constructor & Destructor Documentation

◆ Variant() [1/30]

Variant ( )
inline

Initializes a new instance of the Variant class.

Definition at line 130 of file Variant.cs.

Referenced by Variant.Clone(), and Variant.operator Variant().

◆ Variant() [2/30]

Variant ( IVariant  other)
inline

Initializes a new instance of the Variant class.

Exceptions
ArgumentNullExceptionArgument cannot be null.
InvalidOperationExceptionObject can't be created

Definition at line 143 of file Variant.cs.

◆ Variant() [3/30]

Variant ( bool  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 165 of file Variant.cs.

◆ Variant() [4/30]

Variant ( string  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 180 of file Variant.cs.

◆ Variant() [5/30]

Variant ( sbyte  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 194 of file Variant.cs.

◆ Variant() [6/30]

Variant ( short  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 208 of file Variant.cs.

◆ Variant() [7/30]

Variant ( int  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 222 of file Variant.cs.

◆ Variant() [8/30]

Variant ( long  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 236 of file Variant.cs.

◆ Variant() [9/30]

Variant ( DateTime  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 250 of file Variant.cs.

◆ Variant() [10/30]

Variant ( byte  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 264 of file Variant.cs.

◆ Variant() [11/30]

Variant ( ushort  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 278 of file Variant.cs.

◆ Variant() [12/30]

Variant ( uint  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 292 of file Variant.cs.

◆ Variant() [13/30]

Variant ( ulong  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 306 of file Variant.cs.

◆ Variant() [14/30]

Variant ( float  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 320 of file Variant.cs.

◆ Variant() [15/30]

Variant ( double  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created

Definition at line 334 of file Variant.cs.

◆ Variant() [16/30]

Variant ( bool[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 349 of file Variant.cs.

◆ Variant() [17/30]

Variant ( string[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 364 of file Variant.cs.

◆ Variant() [18/30]

Variant ( sbyte[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 379 of file Variant.cs.

◆ Variant() [19/30]

Variant ( short[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 394 of file Variant.cs.

◆ Variant() [20/30]

Variant ( int[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 409 of file Variant.cs.

◆ Variant() [21/30]

Variant ( long[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 424 of file Variant.cs.

◆ Variant() [22/30]

Variant ( byte[]  value,
bool  raw = false 
)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
rawIf set to true, the data type of the variant is DLR_VARIANT_TYPE_RAW, else DLR_VARIANT_TYPE_ARRAY_OF_UINT8.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 440 of file Variant.cs.

◆ Variant() [23/30]

Variant ( ushort[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 465 of file Variant.cs.

◆ Variant() [24/30]

Variant ( uint[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 480 of file Variant.cs.

◆ Variant() [25/30]

Variant ( ulong[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 495 of file Variant.cs.

◆ Variant() [26/30]

Variant ( float[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 510 of file Variant.cs.

◆ Variant() [27/30]

Variant ( double[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 525 of file Variant.cs.

◆ Variant() [28/30]

Variant ( DateTime[]  value)
inline

Initializes a new instance of the Variant class.

Parameters
valueThe value of the Variant.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 541 of file Variant.cs.

◆ Variant() [29/30]

Variant ( ByteBuffer  flatBuffers)
inline

Initializes a new instance of the Variant class.

Parameters
flatBuffersThe Flatbuffers.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 556 of file Variant.cs.

◆ Variant() [30/30]

Variant ( FlatBufferBuilder  builder)
inline

Initializes a new instance of the Variant class.

Parameters
builderThe FlatBufferBuilder.
Exceptions
InvalidOperationExceptionObject can't be created
ArgumentNullExceptionArgument cannot be null.

Definition at line 571 of file Variant.cs.

Member Function Documentation

◆ CheckConvert()

DLR_RESULT CheckConvert ( DLR_VARIANT_TYPE  type)
inline

Checks if the Variant is convertable to given data type.

Parameters
typeThe target type.
Returns
True if convertable, else false.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1654 of file Variant.cs.

References Variant.IsNull.

◆ Clone()

Variant Clone ( )
inline

Clones the instance.

Returns
Clone of the instance.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1624 of file Variant.cs.

References Variant.Variant(), and Variant.IsDisposed.

◆ Dispose() [1/2]

void Dispose ( )
inline

Disposes the instance.

Definition at line 116 of file Variant.cs.

References Variant.Dispose().

Referenced by Variant.Dispose().

◆ Dispose() [2/2]

virtual void Dispose ( bool  disposing)
inlineprotectedvirtual

Disposes the instance.

Parameters
disposingFalse if called by Finalizer, else true.

Definition at line 70 of file Variant.cs.

References Variant.IsDisposed.

◆ Equals() [1/2]

override bool Equals ( object  obj)
inline

Returns a value that indicates if this Variant equals given object.

Parameters
objThe other object.
Returns
True if equal, else false.

Definition at line 594 of file Variant.cs.

References Variant.Equals().

Referenced by Variant.Equals(), Variant.operator!=(), and Variant.operator==().

◆ Equals() [2/2]

bool Equals ( Variant  other)
inline

Returns a value that indicates if this Variant equals given Variant.

Parameters
otherThe other Variant.
Returns
True if equal, else false.

Implements IVariant.

Definition at line 605 of file Variant.cs.

References Variant.DataType, Variant.Equals(), Variant.ToFlatbuffers(), and Variant.Value.

◆ GetDataFromFlatbuffers()

DLR_RESULT IVariant value GetDataFromFlatbuffers ( IVariant  typeFlatbuffers,
string  query 
)
inline

Implements IVariant.

Definition at line 1584 of file Variant.cs.

◆ GetHashCode()

override int GetHashCode ( )
inline

Gets the HashCode of this Variant.

Returns
The HashCode.

Implements IVariant.

Definition at line 643 of file Variant.cs.

References Variant.Value.

◆ operator Variant() [1/28]

static implicit operator Variant ( bool  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1675 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [2/28]

static implicit operator Variant ( bool[]  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1684 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [3/28]

static implicit operator Variant ( byte  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1710 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [4/28]

static implicit operator Variant ( byte[]  source)
inlinestatic

Implicit operator.

Definition at line 1718 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [5/28]

static implicit operator Variant ( ByteBuffer  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1910 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [6/28]

static implicit operator Variant ( DateTime  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1883 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [7/28]

static implicit operator Variant ( DateTime[]  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1892 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [8/28]

static implicit operator Variant ( double  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1848 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [9/28]

static implicit operator Variant ( double[]  source)
inlinestatic

Implicit operator.

Definition at line 1856 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [10/28]

static implicit operator Variant ( FlatBufferBuilder  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1901 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [11/28]

static implicit operator Variant ( float  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1831 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [12/28]

static implicit operator Variant ( float[]  source)
inlinestatic

Implicit operator.

Definition at line 1839 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [13/28]

static implicit operator Variant ( int  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1760 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [14/28]

static implicit operator Variant ( int[]  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1769 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [15/28]

static implicit operator Variant ( long  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1796 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [16/28]

static implicit operator Variant ( long[]  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1805 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [17/28]

static implicit operator Variant ( sbyte  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1693 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [18/28]

static implicit operator Variant ( sbyte[]  source)
inlinestatic

Implicit operator.

Definition at line 1701 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [19/28]

static implicit operator Variant ( short  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1727 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [20/28]

static implicit operator Variant ( short[]  source)
inlinestatic

Implicit operator.

Definition at line 1735 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [21/28]

static implicit operator Variant ( string  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1865 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [22/28]

static implicit operator Variant ( string[]  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1874 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [23/28]

static implicit operator Variant ( uint  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1778 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [24/28]

static implicit operator Variant ( uint[]  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1787 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [25/28]

static implicit operator Variant ( ulong  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1814 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [26/28]

static implicit operator Variant ( ulong[]  source)
inlinestatic

Implicit operator.

Definition at line 1822 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [27/28]

static implicit operator Variant ( ushort  source)
inlinestatic

Implicit operator.

Parameters
sourceThe source

Definition at line 1743 of file Variant.cs.

References Variant.Variant().

◆ operator Variant() [28/28]

static implicit operator Variant ( ushort[]  source)
inlinestatic

Implicit operator.

Definition at line 1751 of file Variant.cs.

References Variant.Variant().

◆ operator!=()

static bool operator!= ( Variant  l,
Variant  r 
)
inlinestatic

s Unequality Operator.

Parameters
lThe left argument.
rThe right argument.
Returns
True if not equal, else false.

Definition at line 705 of file Variant.cs.

References Variant.Equals().

◆ operator==()

static bool operator== ( Variant  l,
Variant  r 
)
inlinestatic

Equality Operator.

Parameters
lThe left argument.
rThe right argument.
Returns
True if equal, else false.

Definition at line 681 of file Variant.cs.

References Variant.Equals().

◆ ToBool()

bool ToBool ( )
inline

Gets the value as bool.

Returns
The value as bool.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 903 of file Variant.cs.

References Variant.IsNull.

◆ ToBoolArray()

bool[] ToBoolArray ( )
inline

Gets the value as bool array.

Returns
The value as bool array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1111 of file Variant.cs.

References Variant.IsNull.

◆ ToByte()

byte ToByte ( )
inline

Gets the value as byte.

Returns
The value as byte.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 939 of file Variant.cs.

References Variant.IsNull.

◆ ToByteArray()

byte[] ToByteArray ( )
inline

Gets the value as byte array.

Returns
The value as byte array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1181 of file Variant.cs.

References Variant.IsNull.

◆ ToDateTime()

DateTime ToDateTime ( )
inline

Converts the value to a timestamp.

Returns
Value of the variant as a timestamp.

Implements IVariant.

Definition at line 1064 of file Variant.cs.

References Variant.ToUInt64().

◆ ToDateTimeArray()

DateTime[] ToDateTimeArray ( )
inline

Gets the value as DateTime array.

Returns
The value as DateTime array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1467 of file Variant.cs.

References Variant.ToUInt64Array().

◆ ToDouble()

double ToDouble ( )
inline

Gets the value as double.

Returns
The value as double.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1093 of file Variant.cs.

References Variant.IsNull.

◆ ToDoubleArray()

double[] ToDoubleArray ( )
inline

Gets the value as double array.

Returns
The value as double array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1415 of file Variant.cs.

References Variant.IsNull.

◆ ToFlatbuffers()

ByteBuffer ToFlatbuffers ( )
inline

Gets the value as Flatbuffers.

Returns
The value as Flatbuffers.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1520 of file Variant.cs.

References Variant.IsFlatbuffers, and Variant.IsNull.

Referenced by Variant.Equals().

◆ ToFloat()

float ToFloat ( )
inline

Gets the value as float.

Returns
The value as float.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1075 of file Variant.cs.

References Variant.IsNull.

◆ ToFloatArray()

float[] ToFloatArray ( )
inline

Gets the value as float array.

Returns
The value as float array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1389 of file Variant.cs.

References Variant.IsNull.

◆ ToInt16()

short ToInt16 ( )
inline

Gets the value as short.

Returns
The value as short.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 957 of file Variant.cs.

References Variant.IsNull.

◆ ToInt16Array()

short[] ToInt16Array ( )
inline

Gets the value as short array.

Returns
The value as short array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1207 of file Variant.cs.

References Variant.IsNull.

◆ ToInt32()

int ToInt32 ( )
inline

Gets the value as int.

Returns
The value as int.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 993 of file Variant.cs.

References Variant.IsNull.

◆ ToInt32Array()

int[] ToInt32Array ( )
inline

Gets the value as int array.

Returns
The value as int array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1267 of file Variant.cs.

References Variant.IsNull.

◆ ToInt64()

long ToInt64 ( )
inline

Gets the value as long.

Returns
The value as long.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1029 of file Variant.cs.

References Variant.IsNull.

◆ ToInt64Array()

long[] ToInt64Array ( )
inline

Gets the value as long array.

Returns
The value as long array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1328 of file Variant.cs.

References Variant.IsNull.

◆ ToRawByteArray()

byte[] ToRawByteArray ( )
inline

Gets the value as raw byte array (UTF8).

Returns
The value as raw byte array (UTF8).
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1551 of file Variant.cs.

References Variant.IsNull.

◆ ToSByte()

sbyte ToSByte ( )
inline

Gets the value as sbyte.

Returns
The value as sbyte.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 921 of file Variant.cs.

References Variant.IsNull.

◆ ToSByteArray()

sbyte[] ToSByteArray ( )
inline

Gets the value as sbyte array.

Returns
The value as sbyte array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1146 of file Variant.cs.

References Variant.IsNull.

◆ ToString()

override string ToString ( )
inline

Gets the value as string.

Returns
The value as string.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 654 of file Variant.cs.

References Variant.IsNull, and Variant.ToUInt32().

◆ ToStringArray()

string[] ToStringArray ( )
inline

Gets the value as string array.

Returns
The value as string array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1441 of file Variant.cs.

References Variant.IsNull.

◆ ToUInt16()

ushort ToUInt16 ( )
inline

Gets the value as ushort.

Returns
The value as ushort.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 975 of file Variant.cs.

References Variant.IsNull.

◆ ToUInt16Array()

ushort[] ToUInt16Array ( )
inline

Gets the value as ushort array.

Returns
The value as ushort array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1233 of file Variant.cs.

References Variant.IsNull.

◆ ToUInt32()

uint ToUInt32 ( )
inline

Gets the value as uint.

Returns
The value as uint.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1011 of file Variant.cs.

References Variant.IsNull.

Referenced by Variant.ToString().

◆ ToUInt32Array()

uint[] ToUInt32Array ( )
inline

Gets the value as uint array.

Returns
The value as uint array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1293 of file Variant.cs.

References Variant.IsNull.

◆ ToUInt64()

ulong ToUInt64 ( )
inline

Gets the value as ulong.

Returns
The value as ulong.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1047 of file Variant.cs.

References Variant.IsNull.

Referenced by Variant.ToDateTime().

◆ ToUInt64Array()

ulong[] ToUInt64Array ( )
inline

Gets the value as ulong array.

Returns
The value as ulong array.
Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1354 of file Variant.cs.

References Variant.IsNull.

Referenced by Variant.ToDateTimeArray().

Member Data Documentation

◆ DefaultFlatbuffersInitialSize

readonly int DefaultFlatbuffersInitialSize = 1024
static

Gets the default Flatbuffers initial size in bytes.

Definition at line 730 of file Variant.cs.

Referenced by MetadataBuilder.MetadataBuilder(), and SubscriptionPropertiesBuilder.SubscriptionPropertiesBuilder().

◆ Empty

readonly Variant Empty = new Variant(string.Empty)
static

Gets a Variant with empty string value.

Definition at line 750 of file Variant.cs.

◆ False

readonly Variant False = new Variant(false)
static

Gets a Variant with boolean value 'false'.

Definition at line 760 of file Variant.cs.

◆ Null

readonly Variant Null = new Variant()
static

Gets a Variant with no value of data type 'DLR_VARIANT_TYPE_UNKNOWN'.

Definition at line 735 of file Variant.cs.

◆ One

readonly Variant One = new Variant(1)
static

Gets a Variant with value '1' of data type 'int' (Int32).

Definition at line 745 of file Variant.cs.

◆ result

DLR_RESULT result

Gets data of a complex Variant (flatbuffers) by query.

Parameters
typeFlatbuffersType (schema) of the object
queryQuery string
Returns
Result of the method call.
Exceptions
ArgumentNullExceptionArgument cannot be null.
ObjectDisposedExceptionCannot access a disposed object.

Definition at line 1584 of file Variant.cs.

◆ True

readonly Variant True = new Variant(true)
static

Gets a Variant with boolean value 'true'.

Definition at line 755 of file Variant.cs.

◆ Zero

readonly Variant Zero = new Variant(0)
static

Gets a Variant with value '0' of data type 'int' (Int32).

Definition at line 740 of file Variant.cs.

Property Documentation

◆ DataType

DLR_VARIANT_TYPE DataType
get

Gets the data type.

Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1477 of file Variant.cs.

Referenced by Variant.Equals().

◆ IsArray

bool IsArray
get

Gets a value that indicates whether the Variant is an array.

Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 867 of file Variant.cs.

◆ IsBool

bool IsBool
get

Gets a value that indicates whether the Variant contains a boolean value.

Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 855 of file Variant.cs.

◆ IsDisposed

bool IsDisposed
get

Gets a value that indicates whether the instance is disposed.

Implements INativeDisposable.

Definition at line 64 of file Variant.cs.

Referenced by Variant.Clone(), and Variant.Dispose().

◆ IsFlatbuffers

bool IsFlatbuffers
get

Gets a value that indicates whether the Variant contains Flatbuffers.

Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 861 of file Variant.cs.

Referenced by Variant.ToFlatbuffers().

◆ IsNull

◆ IsNumber

bool IsNumber
get

Gets a value that indicates whether the Variant contains a numeric value. Returns false for numeric arrays and booleans.

Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 885 of file Variant.cs.

◆ IsString

bool IsString
get

Gets a value that indicates whether the Variant contains a string value.

Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 849 of file Variant.cs.

◆ JsonDataType

string JsonDataType
get

Gets the Json data type.

Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 1502 of file Variant.cs.

◆ Value

object Value
get

Gets the value.

Exceptions
ObjectDisposedExceptionCannot access a disposed object.

Implements IVariant.

Definition at line 770 of file Variant.cs.

Referenced by Variant.Equals(), and Variant.GetHashCode().


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