ctrlX Data Layer API for Python  1.6.0
The ctrlX Data Layer API allows access to the ctrlX Data Layer with Python
Variant Class Reference
+ Inheritance diagram for Variant:

Public Member Functions

def __init__ (self, C_DLR_VARIANT c_variant=None)
 
def __del__ (self)
 
def __enter__ (self)
 
def __exit__ (self, exc_type, exc_val, exc_tb)
 
Result check_convert (self, VariantType datatype)
 
def clone (self)
 
def close (self)
 
typing.List[bool] get_array_bool8 (self)
 
typing.List[float] get_array_float32 (self)
 
typing.List[float] get_array_float64 (self)
 
typing.List[int] get_array_int16 (self)
 
typing.List[int] get_array_int32 (self)
 
typing.List[int] get_array_int64 (self)
 
typing.List[int] get_array_int8 (self)
 
typing.List[str] get_array_string (self)
 
typing.List[int] get_array_uint16 (self)
 
typing.List[int] get_array_uint32 (self)
 
typing.List[int] get_array_uint64 (self)
 
typing.List[int] get_array_uint8 (self)
 
bool get_bool8 (self)
 
int get_count (self)
 
bytearray get_data (self)
 
bytearray get_flatbuffers (self)
 
float get_float32 (self)
 
float get_float64 (self)
 
def get_handle (self)
 
int get_int16 (self)
 
int get_int32 (self)
 
int get_int64 (self)
 
int get_int8 (self)
 
int get_size (self)
 
str get_string (self)
 
VariantType get_type (self)
 
int get_uint16 (self)
 
int get_uint32 (self)
 
int get_uint64 (self)
 
int get_uint8 (self)
 
Result set_array_bool8 (self, typing.List[bool] data)
 
Result set_array_float32 (self, typing.List[float] data)
 
Result set_array_float64 (self, typing.List[float] data)
 
Result set_array_int16 (self, typing.List[int] data)
 
Result set_array_int32 (self, typing.List[int] data)
 
Result set_array_int64 (self, typing.List[int] data)
 
Result set_array_int8 (self, typing.List[int] data)
 
Result set_array_string (self, typing.List[str] data)
 
Result set_array_uint16 (self, typing.List[int] data)
 
Result set_array_uint32 (self, typing.List[int] data)
 
Result set_array_uint64 (self, typing.List[int] data)
 
Result set_array_uint8 (self, typing.List[int] data)
 
Result set_bool8 (self, bool data)
 
Result set_flatbuffers (self, bytearray data)
 
Result set_float32 (self, float data)
 
Result set_float64 (self, float data)
 
Result set_int16 (self, int data)
 
Result set_int32 (self, int data)
 
Result set_int64 (self, int data)
 
Result set_int8 (self, int data)
 
Result set_string (self, str data)
 
Result set_uint16 (self, int data)
 
Result set_uint32 (self, int data)
 
Result set_uint64 (self, int data)
 
Result set_uint8 (self, int data)
 

Static Public Member Functions

def copy (C_DLR_VARIANT c_variant)
 

Detailed Description

Variant is a container for a many types of data.

Hint see python context manager for instance handling

Definition at line 131 of file variant.py.

Member Function Documentation

◆ check_convert()

◆ clone()

def clone (   self)

clones the content of a variant to another variant

Returns
tuple (Result, Variant)
<Result>, status of function call,
<Variant>, clones of variant

Definition at line 237 of file variant.py.

References Variant._variant.

◆ copy()

def copy ( C_DLR_VARIANT  c_variant)
static

copies the content of a variant to another variant

Returns
tuple (Result, Variant)
<Result>, status of function call,
<Variant>, copy of variant

Definition at line 225 of file variant.py.

◆ get_array_bool8()

typing.List[bool] get_array_bool8 (   self)

Returns the array of int8 if the type is a array of int8 otherwise null.

Returns
array of bool8

Definition at line 344 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_float32()

typing.List[float] get_array_float32 (   self)

Returns the array of float if the type is a array of float otherwise null.

Returns
array of float32

Definition at line 462 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_float64()

typing.List[float] get_array_float64 (   self)

Returns the array of double if the type is a array of double otherwise null.

Returns
array of float64

Definition at line 475 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_int16()

typing.List[int] get_array_int16 (   self)

Returns the array of int16 if the type is a array of int16 otherwise null.

Returns
array of int16

Definition at line 384 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_int32()

typing.List[int] get_array_int32 (   self)

Returns the array of int32 if the type is a array of int32 otherwise null.

Returns
array of int32

Definition at line 410 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_int64()

typing.List[int] get_array_int64 (   self)

Returns the array of int64 if the type is a array of int64 otherwise null.

Returns
array of int64

Definition at line 436 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_int8()

typing.List[int] get_array_int8 (   self)

Returns the array of int8 if the type is a array of int8 otherwise null.

Returns
array of int8

Definition at line 358 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_string()

typing.List[str] get_array_string (   self)

Returns the type of the variant.

Returns
array of strings

Definition at line 488 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_uint16()

typing.List[int] get_array_uint16 (   self)

Returns the array of uint16 if the type is a array of uint16 otherwise null.

Returns
array of uint16

Definition at line 397 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_uint32()

typing.List[int] get_array_uint32 (   self)

Returns the array of uint32 if the type is a array of uint32 otherwise null.

Returns
array of uint32

Definition at line 423 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_uint64()

typing.List[int] get_array_uint64 (   self)

Returns the array of uint64 if the type is a array of uint64 otherwise null.

Returns
array of uint64

Definition at line 449 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_array_uint8()

typing.List[int] get_array_uint8 (   self)

Returns the array of uint8 if the type is a array of uint8 otherwise null.

Returns
array of uint8

Definition at line 371 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_bool8()

bool get_bool8 (   self)

Returns the value of the variant as a bool (auto convert if possible) otherwise 0.

Returns
[True, False]

Definition at line 244 of file variant.py.

References Variant._variant.

◆ get_count()

int get_count (   self)

Returns the count of elements in the variant (scalar data types = 1, array = count of elements in array)

Returns
count of a type

Definition at line 207 of file variant.py.

References Variant._variant.

◆ get_data()

bytearray get_data (   self)

Returns the pointer to the data of the variant.

Returns
array of bytes

Definition at line 190 of file variant.py.

References Variant._variant.

Referenced by Variant.get_flatbuffers().

◆ get_flatbuffers()

bytearray get_flatbuffers (   self)

Returns the flatbuffers if the type is a flatbuffers otherwise null.

Returns
flatbuffer (bytearray)

Definition at line 334 of file variant.py.

References Variant.check_convert(), NotifyItem.get_data(), and Variant.get_data().

◆ get_float32()

float get_float32 (   self)

Returns the value of the variant as a float (auto convert if possible) otherwise 0.

Returns
[1.2E-38, 3.4E+38]

Definition at line 307 of file variant.py.

References Variant._variant.

◆ get_float64()

float get_float64 (   self)

Returns the value of the variant as a double (auto convert if possible) otherwise 0.

Returns
[2.3E-308, 1.7E+308]

Definition at line 314 of file variant.py.

References Variant._variant.

◆ get_int16()

int get_int16 (   self)

Returns the value of the variant as a int16 (auto convert if possible) otherwise 0.

Returns
[-32768, 32767]

Definition at line 265 of file variant.py.

References Variant._variant.

◆ get_int32()

int get_int32 (   self)

Returns the value of the variant as a int32 (auto convert if possible) otherwise 0.

Returns
[-2.147.483.648, 2.147.483.647]

Definition at line 279 of file variant.py.

References Variant._variant.

◆ get_int64()

int get_int64 (   self)

Returns the value of the variant as a int64 (auto convert if possible) otherwise 0.

Returns
[-9.223.372.036.854.775.808, 9.223.372.036.854.775.807]

Definition at line 293 of file variant.py.

References Variant._variant.

◆ get_int8()

int get_int8 (   self)

Returns the value of the variant as a int8 (auto convert if possible) otherwise 0.

Returns
[-128, 127]

Definition at line 251 of file variant.py.

References Variant._variant.

◆ get_size()

int get_size (   self)
Returns
size of the type in bytes

Definition at line 200 of file variant.py.

References Variant._variant.

◆ get_string()

str get_string (   self)

Returns the array of bool8 if the type is a array of bool otherwise null.

Returns
string

Definition at line 321 of file variant.py.

References Variant._variant, and Variant.check_convert().

◆ get_type()

VariantType get_type (   self)

Returns the type of the variant.

Returns
<VariantType>

Definition at line 183 of file variant.py.

References Variant._variant.

◆ get_uint16()

int get_uint16 (   self)

Returns the value of the variant as a uint16 (auto convert if possible) otherwise 0.

Returns
[0, 65.535]

Definition at line 272 of file variant.py.

References Variant._variant.

◆ get_uint32()

int get_uint32 (   self)

Returns the value of the variant as a Uint32 (auto convert if possible) otherwise 0.

Returns
[0, 4.294.967.295]

Definition at line 286 of file variant.py.

References Variant._variant.

◆ get_uint64()

int get_uint64 (   self)

Returns the value of the variant as a uint64 (auto convert if possible) otherwise 0.

Returns
[0, 18446744073709551615]

Definition at line 300 of file variant.py.

References Variant._variant.

◆ get_uint8()

int get_uint8 (   self)

Returns the value of the variant as a uint8 (auto convert if possible) otherwise 0.

Returns
[0, 255]

Definition at line 258 of file variant.py.

References Variant._variant.

◆ set_array_bool8()

Result set_array_bool8 (   self,
typing.List[bool]  data 
)

Set array of bool8.

Returns
<Result>, status of function call

Definition at line 598 of file variant.py.

References Variant._variant.

◆ set_array_float32()

Result set_array_float32 (   self,
typing.List[float]  data 
)

Set array of float32.

Returns
<Result>, status of function call

Definition at line 697 of file variant.py.

References Variant._variant.

◆ set_array_float64()

Result set_array_float64 (   self,
typing.List[float]  data 
)

Set array of float64.

Returns
<Result>, status of function call

Definition at line 708 of file variant.py.

References Variant._variant.

◆ set_array_int16()

Result set_array_int16 (   self,
typing.List[int]  data 
)

Set array of int16.

Returns
<Result>, status of function call

Definition at line 631 of file variant.py.

References Variant._variant.

◆ set_array_int32()

Result set_array_int32 (   self,
typing.List[int]  data 
)

Set array of int32.

Returns
<Result>, status of function call

Definition at line 653 of file variant.py.

References Variant._variant.

◆ set_array_int64()

Result set_array_int64 (   self,
typing.List[int]  data 
)

Set array of int64.

Returns
<Result>, status of function call

Definition at line 675 of file variant.py.

References Variant._variant.

◆ set_array_int8()

Result set_array_int8 (   self,
typing.List[int]  data 
)

Set array of int8.

Returns
<Result>, status of function call

Definition at line 609 of file variant.py.

References Variant._variant.

◆ set_array_string()

Result set_array_string (   self,
typing.List[str]  data 
)

Set array of strings.

Returns
<Result>, status of function call

Definition at line 719 of file variant.py.

References Variant._variant.

◆ set_array_uint16()

Result set_array_uint16 (   self,
typing.List[int]  data 
)

Set array of uint16.

Returns
<Result>, status of function call

Definition at line 642 of file variant.py.

References Variant._variant.

◆ set_array_uint32()

Result set_array_uint32 (   self,
typing.List[int]  data 
)

Set array of uint32.

Returns
<Result>, status of function call

Definition at line 664 of file variant.py.

References Variant._variant.

◆ set_array_uint64()

Result set_array_uint64 (   self,
typing.List[int]  data 
)

Set array of uint64.

Returns
<Result>, status of function call

Definition at line 686 of file variant.py.

References Variant._variant.

◆ set_array_uint8()

Result set_array_uint8 (   self,
typing.List[int]  data 
)

Set array of uint8.

Returns
<Result>, status of function call

Definition at line 620 of file variant.py.

References Variant._variant.

◆ set_bool8()

Result set_bool8 (   self,
bool  data 
)

Set a bool value.

Returns
<Result>, status of function call

Definition at line 501 of file variant.py.

References Variant._variant.

◆ set_flatbuffers()

Result set_flatbuffers (   self,
bytearray  data 
)

Set an flatbuffers.

Returns
<Result>, status of function call

Definition at line 586 of file variant.py.

References Variant._variant.

◆ set_float32()

Result set_float32 (   self,
float  data 
)

Set a float value.

Returns
<Result>, status of function call

Definition at line 564 of file variant.py.

References Variant._variant.

◆ set_float64()

Result set_float64 (   self,
float  data 
)

Set a double value.

Returns
<Result>, status of function call

Definition at line 571 of file variant.py.

References Variant._variant.

◆ set_int16()

Result set_int16 (   self,
int  data 
)

Set a int16 value.

Returns
<Result>, status of function call

Definition at line 522 of file variant.py.

References Variant._variant.

◆ set_int32()

Result set_int32 (   self,
int  data 
)

Set a int32 value.

Returns
<Result>, status of function call

Definition at line 536 of file variant.py.

References Variant._variant.

◆ set_int64()

Result set_int64 (   self,
int  data 
)

Set a int64 value.

Returns
<Result>, status of function call

Definition at line 550 of file variant.py.

References Variant._variant.

◆ set_int8()

Result set_int8 (   self,
int  data 
)

Set a int8 value.

Returns
<Result>, status of function call

Definition at line 508 of file variant.py.

References Variant._variant.

◆ set_string()

Result set_string (   self,
str  data 
)

Set a string.

Returns
<Result>, status of function call

Definition at line 578 of file variant.py.

References Variant._variant.

◆ set_uint16()

Result set_uint16 (   self,
int  data 
)

Set a uint16 value.

Returns
<Result>, status of function call

Definition at line 529 of file variant.py.

References Variant._variant.

◆ set_uint32()

Result set_uint32 (   self,
int  data 
)

Set a uint32 value.

Returns
<Result>, status of function call

Definition at line 543 of file variant.py.

References Variant._variant.

◆ set_uint64()

Result set_uint64 (   self,
int  data 
)

Set a uint64 value.

Returns
<Result>, status of function call

Definition at line 557 of file variant.py.

References Variant._variant.

◆ set_uint8()

Result set_uint8 (   self,
int  data 
)

Set a uint8 value.

Returns
<Result>, status of function call

Definition at line 515 of file variant.py.

References Variant._variant.