3using Datalayer.Internal;
4using Google.FlatBuffers;
6using System.Collections;
7using System.Diagnostics;
9using System.Runtime.InteropServices;
16 [DebuggerDisplay(
"{Value}")]
20 private readonly
bool _skipDelete;
21 private unsafe
void* _nativePtr;
23 #region Internal Constructors
37 internal unsafe
Variant(
void* nativePtr)
39 _nativePtr = nativePtr;
45 #region Internal Properties
50 internal unsafe
bool IsNullPtr => _nativePtr ==
null;
55 unsafe
void* INative.NativePtr => _nativePtr;
70 protected virtual void Dispose(
bool disposing)
99 NativeMethods.Datalayer.DLR_variantDelete(_nativePtr);
120 GC.SuppressFinalize(
this);
125 #region Public Constructors
134 _nativePtr = NativeMethods.Datalayer.DLR_variantCreate();
148 throw new ArgumentNullException(nameof(other));
153 if (NativeMethods.Datalayer.DLR_variantCopy(_nativePtr, other.ToNativePtr()).IsBad())
155 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
168 if (SetBool(value).IsBad())
170 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
183 if (SetString(value).IsBad())
185 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
197 if (SetInt8(value).IsBad())
199 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
211 if (SetInt16(value).IsBad())
213 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
225 if (SetInt32(value).IsBad())
227 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
239 if (SetInt64(value).IsBad())
241 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
253 if (SetTimestamp(value).IsBad())
255 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
267 if (SetUInt8(value).IsBad())
269 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
281 if (SetUInt16(value).IsBad())
283 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
295 if (SetUInt32(value).IsBad())
297 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
309 if (SetUInt64(value).IsBad())
311 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
323 if (SetFloat32(value).IsBad())
325 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
337 if (SetFloat64(value).IsBad())
339 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
352 if (SetArrayOfBool(value).IsBad())
354 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
367 if (SetArrayOfString(value).IsBad())
369 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
382 if (SetArrayOfInt8(value).IsBad())
384 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
397 if (SetArrayOfInt16(value).IsBad())
399 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
412 if (SetArrayOfInt32(value).IsBad())
414 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
427 if (SetArrayOfInt64(value).IsBad())
429 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
440 public Variant(
byte[] value,
bool raw =
false)
445 if (SetArrayOfRawBytes(value).IsBad())
447 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
452 if (SetArrayOfUInt8(value).IsBad())
454 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
468 if (SetArrayOfUInt16(value).IsBad())
470 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
483 if (SetArrayOfUInt32(value).IsBad())
485 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
498 if (SetArrayOfUInt64(value).IsBad())
500 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
513 if (SetArrayOfFloat32(value).IsBad())
515 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
528 if (SetArrayOfFloat64(value).IsBad())
530 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
544 if (SetArrayOfTimestamp(value).IsBad())
546 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
559 if (SetFlatbuffers(flatBuffers).IsBad())
561 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
576 throw new ArgumentNullException(nameof(builder));
579 if (SetFlatbuffers(builder.DataBuffer).IsBad())
581 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCreatable);
587 #region Public Overrides
612 if (ReferenceEquals(
this, other))
624 if (Utils.IsArray(dataType))
626 return StructuralComparisons.StructuralEqualityComparer.Equals(
Value, other.
Value);
632 return StructuralComparisons.StructuralEqualityComparer.Equals(
ToFlatbuffers().ToSizedArray(), other.
ToFlatbuffers().ToSizedArray());
646 return v !=
null ? base.GetHashCode() ^ v.GetHashCode() : base.GetHashCode();
663 var length = Convert.ToInt32(GetSize().
ToUInt32()) - 1;
670 StringBuffer.FromNativePtr(NativeMethods.Datalayer.DLR_variantGetSTRING(_nativePtr), length);
671 return stringBuffer.ToString();
725 #region Public Statics
764 #region Public Getters
873 throw new ObjectDisposedException(Utils.Strings.ErrorObjectDisposed);
891 throw new ObjectDisposedException(Utils.Strings.ErrorObjectDisposed);
912 return NativeMethods.Datalayer.DLR_variantGetBOOL8(_nativePtr);
930 return NativeMethods.Datalayer.DLR_variantGetINT8(_nativePtr);
948 return NativeMethods.Datalayer.DLR_variantGetUINT8(_nativePtr);
966 return NativeMethods.Datalayer.DLR_variantGetINT16(_nativePtr);
984 return NativeMethods.Datalayer.DLR_variantGetUINT16(_nativePtr);
1002 return NativeMethods.Datalayer.DLR_variantGetINT32(_nativePtr);
1020 return NativeMethods.Datalayer.DLR_variantGetUINT32(_nativePtr);
1038 return NativeMethods.Datalayer.DLR_variantGetINT64(_nativePtr);
1056 return NativeMethods.Datalayer.DLR_variantGetUINT64(_nativePtr);
1067 return DateTime.FromFileTimeUtc(Convert.ToInt64(
ToUInt64()));
1084 return NativeMethods.Datalayer.DLR_variantGetFLOAT32(_nativePtr);
1102 return NativeMethods.Datalayer.DLR_variantGetFLOAT64(_nativePtr);
1120 bool* p = NativeMethods.Datalayer.DLR_variantGetArrayOfBOOL8(_nativePtr);
1123 return Array.Empty<
bool>();
1131 var count = GetCount().ToUInt32();
1132 var array =
new bool[count];
1133 for (var i = 0; i < count; i++)
1155 sbyte* p = NativeMethods.Datalayer.DLR_variantGetArrayOfINT8(_nativePtr);
1158 return Array.Empty<sbyte>();
1166 var count = GetCount().ToUInt32();
1167 var array =
new sbyte[count];
1168 for (var i = 0; i < count; i++)
1190 byte* p = NativeMethods.Datalayer.DLR_variantGetArrayOfUINT8(_nativePtr);
1193 return Array.Empty<
byte>();
1196 var array =
new byte[GetCount().ToUInt32()];
1197 Marshal.Copy((IntPtr)p, array, 0, array.Length);
1216 short* p = NativeMethods.Datalayer.DLR_variantGetArrayOfINT16(_nativePtr);
1219 return Array.Empty<
short>();
1222 var array =
new short[GetCount().ToUInt32()];
1223 Marshal.Copy((IntPtr)p, array, 0, array.Length);
1242 ushort* p = NativeMethods.Datalayer.DLR_variantGetArrayOfUINT16(_nativePtr);
1245 return Array.Empty<ushort>();
1252 var count = GetCount().ToUInt32();
1253 var array =
new ushort[count];
1254 for (var i = 0; i < count; i++)
1276 int* p = NativeMethods.Datalayer.DLR_variantGetArrayOfINT32(_nativePtr);
1279 return Array.Empty<
int>();
1282 var array =
new int[GetCount().ToUInt32()];
1283 Marshal.Copy((IntPtr)p, array, 0, array.Length);
1302 uint* p = NativeMethods.Datalayer.DLR_variantGetArrayOfUINT32(_nativePtr);
1305 return Array.Empty<uint>();
1313 var count = GetCount().ToUInt32();
1314 var array =
new uint[count];
1315 for (var i = 0; i < count; i++)
1337 long* p = NativeMethods.Datalayer.DLR_variantGetArrayOfINT64(_nativePtr);
1340 return Array.Empty<
long>();
1343 var array =
new long[GetCount().ToUInt32()];
1344 Marshal.Copy((IntPtr)p, array, 0, array.Length);
1363 ulong* p = NativeMethods.Datalayer.DLR_variantGetArrayOfUINT64(_nativePtr);
1366 return Array.Empty<ulong>();
1374 var count = GetCount().ToUInt32();
1375 var array =
new ulong[count];
1376 for (var i = 0; i < count; i++)
1398 float* p = NativeMethods.Datalayer.DLR_variantGetArrayOfFLOAT32(_nativePtr);
1401 return Array.Empty<
float>();
1404 var array =
new float[GetCount().ToUInt32()];
1405 Marshal.Copy((IntPtr)p, array, 0, array.Length);
1424 double* p = NativeMethods.Datalayer.DLR_variantGetArrayOfFLOAT64(_nativePtr);
1427 return Array.Empty<
double>();
1430 var array =
new double[GetCount().ToUInt32()];
1431 Marshal.Copy((IntPtr)p, array, 0, array.Length);
1450 sbyte** p = NativeMethods.Datalayer.DLR_variantGetArrayOfSTRING(_nativePtr);
1453 return Array.Empty<
string>();
1456 var count = GetCount().ToUInt32();
1457 var stringBufferArray = StringBufferArray.FromNativePtr(p, count);
1458 return stringBufferArray.ToStringArray();
1470 return ToUInt64Array()?.Select(v => DateTime.FromFileTimeUtc(Convert.ToInt64(v))).ToArray();
1483 throw new ObjectDisposedException(Utils.Strings.ErrorObjectDisposed);
1493 return NativeMethods.Datalayer.DLR_variantGetType(_nativePtr);
1508 throw new ObjectDisposedException(Utils.Strings.ErrorObjectDisposed);
1511 return Utils.ToJsonDataType(
DataType);
1534 byte* p = NativeMethods.Datalayer.DLR_variantGetData(_nativePtr);
1540 var array =
new byte[GetCount().ToUInt32()];
1541 Marshal.Copy((IntPtr)p, array, 0, array.Length);
1542 return new ByteBuffer(array);
1560 byte* p = NativeMethods.Datalayer.DLR_variantGetData(_nativePtr);
1563 return Array.Empty<
byte>();
1566 var array =
new byte[GetCount().ToUInt32()];
1567 Marshal.Copy((IntPtr)p, array, 0, array.Length);
1574 #region Public Methods
1588 throw new ObjectDisposedException(Utils.Strings.ErrorObjectDisposed);
1591 if (typeFlatbuffers ==
null)
1593 throw new ArgumentNullException(nameof(typeFlatbuffers));
1598 throw new ArgumentNullException(nameof(query));
1606 var dataValue =
new Variant();
1607 var queryBuffer = StringBuffer.FromString(query);
1611 return (NativeMethods.Datalayer.DLR_getDataFromFlatbuffers(
1613 typeFlatbuffers.ToNativePtr(),
1614 queryBuffer.ToNativePtr(),
1615 dataValue.ToNativePtr()), dataValue);
1628 throw new ObjectDisposedException(Utils.Strings.ErrorObjectDisposed);
1639 if (NativeMethods.Datalayer.DLR_variantCopy(clone.ToNativePtr(),
this.ToNativePtr()).IsBad())
1641 throw new InvalidOperationException(Utils.Strings.ErrorObjectNotCloneable);
1663 return NativeMethods.Datalayer.DLR_variantCheckConvert(_nativePtr, type);
1669 #region Public Implicit Operators
1675 public static implicit
operator Variant(
bool source)
1684 public static implicit
operator Variant(
bool[] source)
1693 public static implicit
operator Variant(sbyte source)
1701 public static implicit
operator Variant(sbyte[] source)
1710 public static implicit
operator Variant(
byte source)
1718 public static implicit
operator Variant(
byte[] source)
1727 public static implicit
operator Variant(
short source)
1735 public static implicit
operator Variant(
short[] source)
1743 public static implicit
operator Variant(ushort source)
1751 public static implicit
operator Variant(ushort[] source)
1760 public static implicit
operator Variant(
int source)
1769 public static implicit
operator Variant(
int[] source)
1778 public static implicit
operator Variant(uint source)
1787 public static implicit
operator Variant(uint[] source)
1796 public static implicit
operator Variant(
long source)
1805 public static implicit
operator Variant(
long[] source)
1814 public static implicit
operator Variant(ulong source)
1822 public static implicit
operator Variant(ulong[] source)
1831 public static implicit
operator Variant(
float source)
1839 public static implicit
operator Variant(
float[] source)
1848 public static implicit
operator Variant(
double source)
1856 public static implicit
operator Variant(
double[] source)
1865 public static implicit
operator Variant(
string source)
1874 public static implicit
operator Variant(
string[] source)
1883 public static implicit
operator Variant(DateTime source)
1892 public static implicit
operator Variant(DateTime[] source)
1901 public static implicit
operator Variant(FlatBufferBuilder source)
1910 public static implicit
operator Variant(ByteBuffer source)
1917 #region Private Setter
1928 return NativeMethods.Datalayer.DLR_variantSetBOOL8(_nativePtr, Convert.ToByte(value));
1941 return NativeMethods.Datalayer.DLR_variantSetINT8(_nativePtr, value);
1954 return NativeMethods.Datalayer.DLR_variantSetUINT8(_nativePtr, value);
1967 return NativeMethods.Datalayer.DLR_variantSetINT16(_nativePtr, value);
1980 return NativeMethods.Datalayer.DLR_variantSetUINT16(_nativePtr, value);
1993 return NativeMethods.Datalayer.DLR_variantSetINT32(_nativePtr, value);
2006 return NativeMethods.Datalayer.DLR_variantSetUINT32(_nativePtr, value);
2019 return NativeMethods.Datalayer.DLR_variantSetINT64(_nativePtr, value);
2032 return NativeMethods.Datalayer.DLR_variantSetUINT64(_nativePtr, value);
2045 return NativeMethods.Datalayer.DLR_variantSetFLOAT32(_nativePtr, value);
2058 return NativeMethods.Datalayer.DLR_variantSetFLOAT64(_nativePtr, value);
2072 throw new ArgumentNullException(nameof(value));
2075 var valueBuffer = StringBuffer.FromString(value);
2078 return NativeMethods.Datalayer.DLR_variantSetSTRING(_nativePtr, valueBuffer.ToNativePtr());
2087 private DLR_RESULT SetTimestamp(DateTime value)
2094 return NativeMethods.Datalayer.DLR_variantSetTimestamp(_nativePtr, Convert.ToUInt64(value.ToFileTimeUtc()));
2096 catch (ArgumentOutOfRangeException)
2110 private DLR_RESULT SetArrayOfBool(
bool[] value)
2114 throw new ArgumentNullException(nameof(value));
2119 fixed (
bool* p = value)
2121 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_BOOL8(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2132 private DLR_RESULT SetArrayOfInt8(sbyte[] value)
2136 throw new ArgumentNullException(nameof(value));
2141 fixed (sbyte* p = value)
2143 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_INT8(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2154 private DLR_RESULT SetArrayOfUInt8(
byte[] value)
2158 throw new ArgumentNullException(nameof(value));
2163 fixed (
byte* p = value)
2165 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_UINT8(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2176 private DLR_RESULT SetArrayOfInt16(
short[] value)
2180 throw new ArgumentNullException(nameof(value));
2185 fixed (
short* p = value)
2187 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_INT16(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2198 private DLR_RESULT SetArrayOfUInt16(ushort[] value)
2202 throw new ArgumentNullException(nameof(value));
2207 fixed (ushort* p = value)
2209 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_UINT16(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2220 private DLR_RESULT SetArrayOfInt32(
int[] value)
2224 throw new ArgumentNullException(nameof(value));
2229 fixed (
int* p = value)
2231 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_INT32(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2242 private DLR_RESULT SetArrayOfUInt32(uint[] value)
2246 throw new ArgumentNullException(nameof(value));
2251 fixed (uint* p = value)
2253 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_UINT32(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2264 private DLR_RESULT SetArrayOfInt64(
long[] value)
2268 throw new ArgumentNullException(nameof(value));
2273 fixed (
long* p = value)
2275 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_INT64(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2286 private DLR_RESULT SetArrayOfUInt64(ulong[] value)
2290 throw new ArgumentNullException(nameof(value));
2295 fixed (ulong* p = value)
2297 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_UINT64(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2308 private DLR_RESULT SetArrayOfFloat32(
float[] value)
2312 throw new ArgumentNullException(nameof(value));
2317 fixed (
float* p = value)
2319 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_FLOAT32(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2330 private DLR_RESULT SetArrayOfFloat64(
double[] value)
2334 throw new ArgumentNullException(nameof(value));
2339 fixed (
double* p = value)
2341 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_FLOAT64(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(value.Length)));
2352 private DLR_RESULT SetArrayOfTimestamp(DateTime[] value)
2356 throw new ArgumentNullException(nameof(value));
2364 var timeStamps = value.Select(v => Convert.ToUInt64(v.ToFileTimeUtc())).ToArray();
2366 fixed (ulong* p = timeStamps)
2368 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_TIMESTAMP(_nativePtr, p,
new UIntPtr(Convert.ToUInt32(timeStamps.Length)));
2371 catch (ArgumentOutOfRangeException)
2385 private DLR_RESULT SetArrayOfString(
string[] value)
2389 throw new ArgumentNullException(nameof(value));
2393 var stringBufferArray = StringBufferArray.FromStringArray(value);
2396 return NativeMethods.Datalayer.DLR_variantSetARRAY_OF_STRING(_nativePtr, stringBufferArray.ToNativePtr(),
new UIntPtr(Convert.ToUInt32(value.Length)));
2406 private DLR_RESULT SetFlatbuffers(ByteBuffer value)
2410 throw new ArgumentNullException(nameof(value));
2438 var byteArray = value.ToSizedArray();
2441 fixed (
byte* p = byteArray)
2443 sbyte* psByte = (sbyte*)p;
2444 return NativeMethods.Datalayer.DLR_variantSetFlatbuffers(_nativePtr, psByte,
new UIntPtr(Convert.ToUInt32(byteArray.Length)));
2455 private DLR_RESULT SetArrayOfRawBytes(
byte[] value)
2459 throw new ArgumentNullException(nameof(value));
2464 fixed (
byte* p = value)
2466 sbyte* psByte = (sbyte*)p;
2467 return NativeMethods.Datalayer.DLR_variantSetRaw(_nativePtr, psByte,
new UIntPtr(Convert.ToUInt32(value.Length)));
2474 #region Private Methods
2480 internal UIntPtr GetSize()
2484 return UIntPtr.Zero;
2489 return NativeMethods.Datalayer.DLR_variantGetSize(_nativePtr);
2497 internal UIntPtr GetCount()
2501 return UIntPtr.Zero;
2506 return NativeMethods.Datalayer.DLR_variantGetCount(_nativePtr);
Provides the implementation for IVariant.
string[] ToStringArray()
Gets the value as string array.
short ToInt16()
Gets the value as short.
long[] ToInt64Array()
Gets the value as long array.
sbyte ToSByte()
Gets the value as sbyte.
float[] ToFloatArray()
Gets the value as float array.
double ToDouble()
Gets the value as double.
Variant(sbyte[] value)
Initializes a new instance of the Variant class.
Variant(string value)
Initializes a new instance of the Variant class.
sbyte[] ToSByteArray()
Gets the value as sbyte array.
ushort[] ToUInt16Array()
Gets the value as ushort array.
Variant(int value)
Initializes a new instance of the Variant class.
Variant(ByteBuffer flatBuffers)
Initializes a new instance of the Variant class.
static readonly Variant Zero
Gets a Variant with value '0' of data type 'int' (Int32).
object Value
Gets the value.
Variant(DateTime value)
Initializes a new instance of the Variant class.
DateTime ToDateTime()
Converts the value to a timestamp.
short[] ToInt16Array()
Gets the value as short array.
Variant()
Initializes a new instance of the Variant class.
Variant(bool[] value)
Initializes a new instance of the Variant class.
double[] ToDoubleArray()
Gets the value as double array.
ByteBuffer ToFlatbuffers()
Gets the value as Flatbuffers.
uint ToUInt32()
Gets the value as uint.
Variant(DateTime[] value)
Initializes a new instance of the Variant class.
byte ToByte()
Gets the value as byte.
ulong[] ToUInt64Array()
Gets the value as ulong array.
bool IsString
Gets a value that indicates whether the Variant contains a string value.
byte[] ToByteArray()
Gets the value as byte array.
Variant(ulong value)
Initializes a new instance of the Variant class.
static readonly Variant One
Gets a Variant with value '1' of data type 'int' (Int32).
Variant(ushort value)
Initializes a new instance of the Variant class.
Variant(sbyte value)
Initializes a new instance of the Variant class.
bool IsNull
Gets a value that indicates whether the Variant is null.
Variant(short[] value)
Initializes a new instance of the Variant class.
void Dispose()
Disposes the instance.
Variant(IVariant other)
Initializes a new instance of the Variant class.
bool Equals(Variant other)
Returns a value that indicates if this Variant equals given Variant.
Variant(byte[] value, bool raw=false)
Initializes a new instance of the Variant class.
override int GetHashCode()
Gets the HashCode of this Variant.
bool IsFlatbuffers
Gets a value that indicates whether the Variant contains Flatbuffers.
Variant(long value)
Initializes a new instance of the Variant class.
byte[] ToRawByteArray()
Gets the value as raw byte array (UTF8).
DLR_VARIANT_TYPE DataType
Gets the data type.
DLR_RESULT result
Gets data of a complex Variant (flatbuffers) by query.
bool ToBool()
Gets the value as bool.
Variant(bool value)
Initializes a new instance of the Variant class.
uint[] ToUInt32Array()
Gets the value as uint array.
virtual void Dispose(bool disposing)
Disposes the instance.
Variant(byte value)
Initializes a new instance of the Variant class.
static readonly int DefaultFlatbuffersInitialSize
Gets the default Flatbuffers initial size in bytes.
Variant(float value)
Initializes a new instance of the Variant class.
Variant(uint[] value)
Initializes a new instance of the Variant class.
static readonly Variant Null
Gets a Variant with no value of data type 'DLR_VARIANT_TYPE_UNKNOWN'.
Variant(double value)
Initializes a new instance of the Variant class.
long ToInt64()
Gets the value as long.
Variant Clone()
Clones the instance.
Variant(double[] value)
Initializes a new instance of the Variant class.
override string ToString()
Gets the value as string.
static bool operator!=(Variant l, Variant r)
s Unequality Operator.
ulong ToUInt64()
Gets the value as ulong.
override bool Equals(object obj)
Returns a value that indicates if this Variant equals given object.
string JsonDataType
Gets the Json data type.
Variant(string[] value)
Initializes a new instance of the Variant class.
bool IsDisposed
Gets a value that indicates whether the instance is disposed.
Variant(short value)
Initializes a new instance of the Variant class.
Variant(ushort[] value)
Initializes a new instance of the Variant class.
bool IsBool
Gets a value that indicates whether the Variant contains a boolean value.
static readonly Variant True
Gets a Variant with boolean value 'true'.
Variant(float[] 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.
static bool operator==(Variant l, Variant r)
Equality Operator.
ushort ToUInt16()
Gets the value as ushort.
Variant(uint value)
Initializes a new instance of the Variant class.
float ToFloat()
Gets the value as float.
Variant(ulong[] value)
Initializes a new instance of the Variant class.
static readonly Variant False
Gets a Variant with boolean value 'false'.
int ToInt32()
Gets the value as int.
static readonly Variant Empty
Gets a Variant with empty string value.
bool IsNumber
Gets a value that indicates whether the Variant contains a numeric value. Returns false for numeric a...
Variant(long[] value)
Initializes a new instance of the Variant class.
Variant(FlatBufferBuilder builder)
Initializes a new instance of the Variant class.
int[] ToInt32Array()
Gets the value as int array.
bool IsArray
Gets a value that indicates whether the Variant is an array.
Variant(int[] value)
Initializes a new instance of the Variant class.
DateTime[] ToDateTimeArray()
Gets the value as DateTime array.
bool[] ToBoolArray()
Gets the value as bool array.
DLR_VARIANT_TYPE
DLR_VARIANT_TYPE.