PCL
pcl::Variant Class Reference

Acts like a union to store instances of different data types. More...

#include <Variant.h>

Public Types

using data_type = VariantType::value_type
 

Public Member Functions

 Variant ()
 
 Variant (bool b)
 
 Variant (const ByteArray &ba)
 
 Variant (const ByteMatrix &bm)
 
 Variant (const ByteVector &bv)
 
 Variant (const C32Matrix &c32m)
 
 Variant (const C32Vector &c32v)
 
 Variant (const C64Matrix &c64m)
 
 Variant (const C64Vector &c64v)
 
 Variant (const char *cp)
 
 Variant (const CharMatrix &cm)
 
 Variant (const CharVector &cv)
 
 Variant (const DMatrix &dm)
 
 Variant (const DPoint &dp)
 
 Variant (const DRect &dr)
 
 Variant (const DVector &dv)
 
 Variant (const FMatrix &fm)
 
 Variant (const FPoint &fp)
 
 Variant (const FRect &fr)
 
 Variant (const FVector &fv)
 
 Variant (const I16Matrix &i16m)
 
 Variant (const I16Vector &i16v)
 
 Variant (const I64Matrix &i64m)
 
 Variant (const I64Vector &i64v)
 
 Variant (const IMatrix &im)
 
 Variant (const IsoString &s8)
 
 Variant (const IsoStringKeyValue &iskv)
 
 Variant (const IsoStringKeyValueList &iskvl)
 
 Variant (const IsoStringList &isl)
 
 Variant (const IVector &iv)
 
 Variant (const Point &p)
 
 Variant (const Rect &r)
 
 Variant (const String &s)
 
 Variant (const StringKeyValue &skv)
 
 Variant (const StringKeyValueList &skvl)
 
 Variant (const StringList &sl)
 
 Variant (const TimePoint &t)
 
 Variant (const UI16Matrix &ui16m)
 
 Variant (const UI16Vector &ui16v)
 
 Variant (const UI64Matrix &ui64m)
 
 Variant (const UI64Vector &ui64v)
 
 Variant (const UIMatrix &uim)
 
 Variant (const UIVector &uiv)
 
 Variant (const Variant &x)
 
 Variant (dcomplex dc)
 
 Variant (double d)
 
 Variant (fcomplex fc)
 
 Variant (float f)
 
 Variant (int16 i16)
 
 Variant (int32 i32)
 
 Variant (int64 i64)
 
 Variant (int8 i8)
 
 Variant (uint16 u16)
 
 Variant (uint32 u32)
 
 Variant (uint64 u64)
 
 Variant (uint8 u8)
 
 Variant (Variant &&x)
 
virtual ~Variant ()
 
void Assign (const Variant &x)
 
size_type BlockSize () const
 
int BytesPerBlockElement () const
 
bool CanConvertToBool () const noexcept
 
bool CanConvertToBoolean () const noexcept
 
bool CanConvertToByteArray () const noexcept
 
bool CanConvertToByteMatrix () const noexcept
 
bool CanConvertToByteVector () const noexcept
 
bool CanConvertToC32Matrix () const noexcept
 
bool CanConvertToC32Vector () const noexcept
 
bool CanConvertToC64Matrix () const noexcept
 
bool CanConvertToC64Vector () const noexcept
 
bool CanConvertToCharMatrix () const noexcept
 
bool CanConvertToCharVector () const noexcept
 
bool CanConvertToComplex () const noexcept
 
bool CanConvertToDComplex () const noexcept
 
bool CanConvertToDMatrix () const noexcept
 
bool CanConvertToDouble () const noexcept
 
bool CanConvertToDPoint () const noexcept
 
bool CanConvertToDRect () const noexcept
 
bool CanConvertToDVector () const noexcept
 
bool CanConvertToFComplex () const noexcept
 
bool CanConvertToFloat () const noexcept
 
bool CanConvertToFMatrix () const noexcept
 
bool CanConvertToFPoint () const noexcept
 
bool CanConvertToFRect () const noexcept
 
bool CanConvertToFVector () const noexcept
 
bool CanConvertToI16Matrix () const noexcept
 
bool CanConvertToI16Vector () const noexcept
 
bool CanConvertToI64Matrix () const noexcept
 
bool CanConvertToI64Vector () const noexcept
 
bool CanConvertToIMatrix () const noexcept
 
bool CanConvertToInt () const noexcept
 
bool CanConvertToInt64 () const noexcept
 
bool CanConvertToIsoString () const noexcept
 
bool CanConvertToIsoStringList () const noexcept
 
bool CanConvertToIVector () const noexcept
 
bool CanConvertToMatrix () const noexcept
 
bool CanConvertToPoint () const noexcept
 
bool CanConvertToRect () const noexcept
 
bool CanConvertToString () const noexcept
 
bool CanConvertToStringList () const noexcept
 
bool CanConvertToTimePoint () const noexcept
 
bool CanConvertToUI16Matrix () const noexcept
 
bool CanConvertToUI16Vector () const noexcept
 
bool CanConvertToUI64Matrix () const noexcept
 
bool CanConvertToUI64Vector () const noexcept
 
bool CanConvertToUIMatrix () const noexcept
 
bool CanConvertToUInt () const noexcept
 
bool CanConvertToUInt64 () const noexcept
 
bool CanConvertToUIVector () const noexcept
 
bool CanConvertToVector () const noexcept
 
void Clear ()
 
int Compare (const Variant &x) const
 
const void * InternalBlockAddress () const
 
bool IsComplex () const
 
bool IsMatrix () const
 
bool IsScalar () const
 
bool IsString () const
 
bool IsStructured () const
 
bool IsTimePoint () const
 
bool IsValid () const
 
bool IsVector () const
 
Rect MatrixDimensions () const
 
bool operator< (const Variant &x) const
 
Variantoperator= (const Variant &x)
 
Variantoperator= (Variant &&x)
 
bool operator== (const Variant &x) const
 
bool ToBool () const
 
bool ToBoolean () const
 
ByteArray ToByteArray () const
 
ByteMatrix ToByteMatrix () const
 
ByteVector ToByteVector () const
 
C32Matrix ToC32Matrix () const
 
C32Vector ToC32Vector () const
 
C64Matrix ToC64Matrix () const
 
C64Vector ToC64Vector () const
 
CharMatrix ToCharMatrix () const
 
CharVector ToCharVector () const
 
complex ToComplex () const
 
dcomplex ToDComplex () const
 
DMatrix ToDMatrix () const
 
double ToDouble () const
 
DPoint ToDPoint () const
 
DRect ToDRect () const
 
DVector ToDVector () const
 
fcomplex ToFComplex () const
 
float ToFloat () const
 
FMatrix ToFMatrix () const
 
FPoint ToFPoint () const
 
FRect ToFRect () const
 
FVector ToFVector () const
 
I16Matrix ToI16Matrix () const
 
I16Vector ToI16Vector () const
 
I64Matrix ToI64Matrix () const
 
I64Vector ToI64Vector () const
 
IMatrix ToIMatrix () const
 
int ToInt () const
 
int64 ToInt64 () const
 
IsoString ToIsoString () const
 
IsoStringKeyValue ToIsoStringKeyValue () const
 
IsoStringKeyValueList ToIsoStringKeyValueList () const
 
IsoStringList ToIsoStringList () const
 
IVector ToIVector () const
 
Matrix ToMatrix () const
 
Point ToPoint () const
 
Rect ToRect () const
 
String ToString () const
 
StringKeyValue ToStringKeyValue () const
 
StringKeyValueList ToStringKeyValueList () const
 
StringList ToStringList () const
 
TimePoint ToTimePoint () const
 
Variant ToType (data_type type) const
 
UI16Matrix ToUI16Matrix () const
 
UI16Vector ToUI16Vector () const
 
UI64Matrix ToUI64Matrix () const
 
UI64Vector ToUI64Vector () const
 
UIMatrix ToUIMatrix () const
 
unsigned int ToUInt () const
 
uint64 ToUInt64 () const
 
UIVector ToUIVector () const
 
Vector ToVector () const
 
void Transfer (Variant &&x)
 
void Transfer (Variant &x)
 
data_type Type () const
 
size_type VectorLength () const
 

Static Public Member Functions

static int BytesPerBlockElementForType (int type)
 
static bool IsComplexType (int type)
 
static bool IsMatrixType (int type)
 
static bool IsScalarType (int type)
 
static bool IsStringType (int type)
 
static bool IsStructuredType (int type)
 
static bool IsTimePointType (int type)
 
static bool IsVectorType (int type)
 
static const char * TypeAsString (int type)
 

Detailed Description

Sometimes you have to implement a single class or function able to work with several data types. In C++ and other languages supporting template metaprogramming, the obvious way to implement this functionality is by using class or function templates.

However, in order to use templates all of the types must be known without ambiguity at compile time, which is not always feasible. When the data types can only be known at runtime, variant constructs are the only practical way to implement code able to work with multiple data types dynamically.

An instance of the Variant class can store one object of any of the supported Variant types, which have been enumerated in the VariantType namespace. In this way Variant can be used as a sort of envelope to transport objects of different types under a common interface.

Variant supports explicit type conversions through a set of dedicated ToXXX() member functions. For example, one of the most useful and often used conversion functions is Variant::ToString():

Variant v( 3 ); // v transports an integer value
Console().WriteLn( v.ToString() ); // writes "3" to the console

This conversion function is extremely useful for object serialization. Using this conversion, a function can generate string representations of all the data types supported by Variant:

void PrintVariable( const String& name, const Variant& value )
{
Console().WriteLn( name + " = " + value.ToString() );
}

A Variant instance owns its stored object and cannot share it with other objects, including other Variant instances; it can only provide temporary rvalues generated from its stored object, but never references to it. This prevents unexpected object destruction and other problems with the objects transported by Variant instances.

Variant is an essential component of the introspection mechanisms implemented by the Process, ProcessParameter and ProcessInstance classes. Thanks to Variant, these classes are able to represent and interface with any installed process on the PixInsight platform.

Definition at line 331 of file Variant.h.

Member Typedef Documentation

◆ data_type

using pcl::Variant::data_type = VariantType::value_type

An enumeration of all supported Variant data types.

Definition at line 338 of file Variant.h.

Constructor & Destructor Documentation

◆ Variant() [1/57]

pcl::Variant::Variant ( )
inline

Constructs an invalid Variant instance that stores no object.

Definition at line 343 of file Variant.h.

◆ Variant() [2/57]

pcl::Variant::Variant ( bool  b)
inline

Constructs a Variant instance to store a bool value.

Definition at line 352 of file Variant.h.

◆ Variant() [3/57]

pcl::Variant::Variant ( int8  i8)
inline

Constructs a Variant instance to store a signed 8-bit integer value.

Definition at line 361 of file Variant.h.

◆ Variant() [4/57]

pcl::Variant::Variant ( int16  i16)
inline

Constructs a Variant instance to store a signed 16-bit integer value.

Definition at line 370 of file Variant.h.

◆ Variant() [5/57]

pcl::Variant::Variant ( int32  i32)
inline

Constructs a Variant instance to store a signed 32-bit integer value.

Definition at line 379 of file Variant.h.

◆ Variant() [6/57]

pcl::Variant::Variant ( int64  i64)
inline

Constructs a Variant instance to store a signed 64-bit integer value.

Definition at line 388 of file Variant.h.

◆ Variant() [7/57]

pcl::Variant::Variant ( uint8  u8)
inline

Constructs a Variant instance to store an unsigned 8-bit integer value.

Definition at line 397 of file Variant.h.

◆ Variant() [8/57]

pcl::Variant::Variant ( uint16  u16)
inline

Constructs a Variant instance to store an unsigned 16-bit integer value.

Definition at line 406 of file Variant.h.

◆ Variant() [9/57]

pcl::Variant::Variant ( uint32  u32)
inline

Constructs a Variant instance to store an unsigned 32-bit integer value.

Definition at line 415 of file Variant.h.

◆ Variant() [10/57]

pcl::Variant::Variant ( uint64  u64)
inline

Constructs a Variant instance to store an unsigned 64-bit integer value.

Definition at line 423 of file Variant.h.

◆ Variant() [11/57]

pcl::Variant::Variant ( float  f)
inline

Constructs a Variant instance to store a float value (32-bit floating point).

Definition at line 433 of file Variant.h.

◆ Variant() [12/57]

pcl::Variant::Variant ( double  d)
inline

Constructs a Variant instance to store a double value (64-bit floating point).

Definition at line 443 of file Variant.h.

◆ Variant() [13/57]

pcl::Variant::Variant ( fcomplex  fc)
inline

Constructs a Variant instance to store a complex number with float components (fcomplex).

Definition at line 453 of file Variant.h.

◆ Variant() [14/57]

pcl::Variant::Variant ( dcomplex  dc)
inline

Constructs a Variant instance to store a complex number with double components (dcomplex).

Definition at line 464 of file Variant.h.

◆ Variant() [15/57]

pcl::Variant::Variant ( const TimePoint t)
inline

Constructs a Variant instance to store a time point value (TimePoint).

Definition at line 474 of file Variant.h.

◆ Variant() [16/57]

pcl::Variant::Variant ( const Point p)
inline

Constructs a Variant instance to store a two-dimensional point with integer coordinates (Point).

Definition at line 485 of file Variant.h.

◆ Variant() [17/57]

pcl::Variant::Variant ( const FPoint fp)
inline

Constructs a Variant instance to store a two-dimensional point with float coordinates (FPoint).

Definition at line 496 of file Variant.h.

◆ Variant() [18/57]

pcl::Variant::Variant ( const DPoint dp)
inline

Constructs a Variant instance to store a two-dimensional point with double coordinates (DPoint).

Definition at line 507 of file Variant.h.

◆ Variant() [19/57]

pcl::Variant::Variant ( const Rect r)
inline

Constructs a Variant instance to store a two-dimensional rectangle with integer coordinates (Rect).

Definition at line 518 of file Variant.h.

◆ Variant() [20/57]

pcl::Variant::Variant ( const FRect fr)
inline

Constructs a Variant instance to store a two-dimensional rectangle with float coordinates (FRect).

Definition at line 529 of file Variant.h.

◆ Variant() [21/57]

pcl::Variant::Variant ( const DRect dr)
inline

Constructs a Variant instance to store a two-dimensional rectangle with double coordinates (DRect).

Definition at line 540 of file Variant.h.

◆ Variant() [22/57]

pcl::Variant::Variant ( const CharVector cv)
inline

Constructs a Variant instance to store a vector of 8-bit signed integer components (CharVector).

Definition at line 551 of file Variant.h.

◆ Variant() [23/57]

pcl::Variant::Variant ( const ByteVector bv)
inline

Constructs a Variant instance to store a vector of 8-bit unsigned integer components (ByteVector).

Definition at line 562 of file Variant.h.

◆ Variant() [24/57]

pcl::Variant::Variant ( const I16Vector i16v)
inline

Constructs a Variant instance to store a vector of 16-bit signed integer components (I16Vector).

Definition at line 573 of file Variant.h.

◆ Variant() [25/57]

pcl::Variant::Variant ( const UI16Vector ui16v)
inline

Constructs a Variant instance to store a vector of 16-bit unsigned integer components (UI16Vector).

Definition at line 584 of file Variant.h.

◆ Variant() [26/57]

pcl::Variant::Variant ( const IVector iv)
inline

Constructs a Variant instance to store a vector of 32-bit signed integer components (IVector).

Definition at line 595 of file Variant.h.

◆ Variant() [27/57]

pcl::Variant::Variant ( const UIVector uiv)
inline

Constructs a Variant instance to store a vector of 32-bit unsigned integer components (UIVector).

Definition at line 606 of file Variant.h.

◆ Variant() [28/57]

pcl::Variant::Variant ( const I64Vector i64v)
inline

Constructs a Variant instance to store a vector of 64-bit signed integer components (I64Vector).

Definition at line 617 of file Variant.h.

◆ Variant() [29/57]

pcl::Variant::Variant ( const UI64Vector ui64v)
inline

Constructs a Variant instance to store a vector of 64-bit unsigned integer components (UI64Vector).

Definition at line 628 of file Variant.h.

◆ Variant() [30/57]

pcl::Variant::Variant ( const FVector fv)
inline

Constructs a Variant instance to store a vector of 32-bit floating point real components (FVector).

Definition at line 639 of file Variant.h.

◆ Variant() [31/57]

pcl::Variant::Variant ( const DVector dv)
inline

Constructs a Variant instance to store a vector of 64-bit floating point real components (DVector).

Definition at line 650 of file Variant.h.

◆ Variant() [32/57]

pcl::Variant::Variant ( const C32Vector c32v)
inline

Constructs a Variant instance to store a vector of 32-bit floating point complex components (C32Vector).

Definition at line 661 of file Variant.h.

◆ Variant() [33/57]

pcl::Variant::Variant ( const C64Vector c64v)
inline

Constructs a Variant instance to store a vector of 64-bit floating point complex components (C64Vector).

Definition at line 672 of file Variant.h.

◆ Variant() [34/57]

pcl::Variant::Variant ( const CharMatrix cm)
inline

Constructs a Variant instance to store a matrix of 8-bit signed integer elements (CharMatrix).

Definition at line 683 of file Variant.h.

◆ Variant() [35/57]

pcl::Variant::Variant ( const ByteMatrix bm)
inline

Constructs a Variant instance to store a matrix of 8-bit unsigned integer elements (ByteMatrix).

Definition at line 694 of file Variant.h.

◆ Variant() [36/57]

pcl::Variant::Variant ( const I16Matrix i16m)
inline

Constructs a Variant instance to store a matrix of 16-bit signed integer elements (I16Matrix).

Definition at line 705 of file Variant.h.

◆ Variant() [37/57]

pcl::Variant::Variant ( const UI16Matrix ui16m)
inline

Constructs a Variant instance to store a matrix of 16-bit unsigned integer elements (UI16Matrix).

Definition at line 716 of file Variant.h.

◆ Variant() [38/57]

pcl::Variant::Variant ( const IMatrix im)
inline

Constructs a Variant instance to store a matrix of 32-bit signed integer elements (IMatrix).

Definition at line 727 of file Variant.h.

◆ Variant() [39/57]

pcl::Variant::Variant ( const UIMatrix uim)
inline

Constructs a Variant instance to store a matrix of 32-bit unsigned integer elements (UIMatrix).

Definition at line 738 of file Variant.h.

◆ Variant() [40/57]

pcl::Variant::Variant ( const I64Matrix i64m)
inline

Constructs a Variant instance to store a matrix of 64-bit integer elements (I64Matrix).

Definition at line 749 of file Variant.h.

◆ Variant() [41/57]

pcl::Variant::Variant ( const UI64Matrix ui64m)
inline

Constructs a Variant instance to store a matrix of 64-bit unsigned integer elements (UI64Matrix).

Definition at line 760 of file Variant.h.

◆ Variant() [42/57]

pcl::Variant::Variant ( const FMatrix fm)
inline

Constructs a Variant instance to store a matrix of 32-bit floating point real elements (FMatrix).

Definition at line 771 of file Variant.h.

◆ Variant() [43/57]

pcl::Variant::Variant ( const DMatrix dm)
inline

Constructs a Variant instance to store a matrix of 64-bit floating point real elements (DMatrix).

Definition at line 782 of file Variant.h.

◆ Variant() [44/57]

pcl::Variant::Variant ( const C32Matrix c32m)
inline

Constructs a Variant instance to store a matrix of 32-bit floating point complex elements (C32Matrix).

Definition at line 793 of file Variant.h.

◆ Variant() [45/57]

pcl::Variant::Variant ( const C64Matrix c64m)
inline

Constructs a Variant instance to store a matrix of 64-bit floating point complex elements (C64Matrix).

Definition at line 804 of file Variant.h.

◆ Variant() [46/57]

pcl::Variant::Variant ( const ByteArray ba)
inline

Constructs a Variant instance to store a dynamic array of unsigned 8-bit integers (ByteArray).

Definition at line 815 of file Variant.h.

◆ Variant() [47/57]

pcl::Variant::Variant ( const String s)
inline

Constructs a Variant instance to store a UTF-16 Unicode string (String).

Definition at line 825 of file Variant.h.

◆ Variant() [48/57]

pcl::Variant::Variant ( const IsoString s8)
inline

Constructs a Variant instance to store an 8-bit ISO/IEC 8859-1 or UTF-8 Unicode string (IsoString).

Definition at line 836 of file Variant.h.

◆ Variant() [49/57]

pcl::Variant::Variant ( const char *  cp)
inline

Constructs a Variant instance to store an 8-bit ISO/IEC 8859-1 or UTF-8 Unicode string (IsoString), constructed from a null-terminated C string.

Definition at line 847 of file Variant.h.

◆ Variant() [50/57]

pcl::Variant::Variant ( const StringList sl)
inline

Constructs a Variant instance to store a list of UTF-16 Unicode strings (StringList).

Definition at line 858 of file Variant.h.

◆ Variant() [51/57]

pcl::Variant::Variant ( const IsoStringList isl)
inline

Constructs a Variant instance to store a list of 8-bit strings (IsoStringList).

Definition at line 869 of file Variant.h.

◆ Variant() [52/57]

pcl::Variant::Variant ( const StringKeyValue skv)
inline

Constructs a Variant instance to store a key/value pair of UTF-16 Unicode strings (StringKeyValue).

Definition at line 880 of file Variant.h.

◆ Variant() [53/57]

pcl::Variant::Variant ( const IsoStringKeyValue iskv)
inline

Constructs a Variant instance to store a key/value pair of 8-bit strings (IsoStringKeyValue).

Definition at line 891 of file Variant.h.

◆ Variant() [54/57]

pcl::Variant::Variant ( const StringKeyValueList skvl)
inline

Constructs a Variant instance to store a list of key/value pairs of UTF-16 Unicode strings (StringKeyValueList).

Definition at line 902 of file Variant.h.

◆ Variant() [55/57]

pcl::Variant::Variant ( const IsoStringKeyValueList iskvl)
inline

Constructs a Variant instance to store a list of key/value pairs of 8-bit strings (IsoStringKeyValueList).

Definition at line 913 of file Variant.h.

◆ Variant() [56/57]

pcl::Variant::Variant ( const Variant x)
inline

Copy constructor. This Variant will store a copy of the object stored in another Variant x.

Definition at line 924 of file Variant.h.

◆ Variant() [57/57]

pcl::Variant::Variant ( Variant &&  x)
inline

Move constructor.

Definition at line 934 of file Variant.h.

◆ ~Variant()

virtual pcl::Variant::~Variant ( )
inlinevirtual

Virtual destructor. The object stored in this Variant will be destroyed.

Definition at line 944 of file Variant.h.

Member Function Documentation

◆ Assign()

void pcl::Variant::Assign ( const Variant x)
inline

Causes this Variant to store a copy of the object stored in another Variant x.

Definition at line 963 of file Variant.h.

◆ BlockSize()

size_type pcl::Variant::BlockSize ( ) const

Returns the size in bytes of the scalar, complex, vector, matrix or string object transported by this Variant object.

The value returned by this function can be used along with InternalBlockAddress() for object serialization purposes.

If this Variant does not transport a scalar, complex, vector, matrix or string object, this member function throws an Error exception.

◆ BytesPerBlockElement()

int pcl::Variant::BytesPerBlockElement ( ) const
inline

Returns the length in bytes of a block element, if this Variant object transports a scalar, complex, vector, matrix or string object.

If this Variant does not transport a scalar, complex, vector, matrix or string object, this function throws an Error exception.

Definition at line 1942 of file Variant.h.

◆ BytesPerBlockElementForType()

static int pcl::Variant::BytesPerBlockElementForType ( int  type)
static

Returns the length in bytes of a block element for the specified type.

type must be a scalar, complex, vector, matrix or string type. Otherwise this function will throw an Error exception.

◆ CanConvertToBool()

bool pcl::Variant::CanConvertToBool ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a Boolean value.

◆ CanConvertToBoolean()

bool pcl::Variant::CanConvertToBoolean ( ) const
inlinenoexcept

A convenience synonym for CanConvertToBool().

Definition at line 1118 of file Variant.h.

◆ CanConvertToByteArray()

bool pcl::Variant::CanConvertToByteArray ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a dynamic array of unsigned 8-bit integers.

◆ CanConvertToByteMatrix()

bool pcl::Variant::CanConvertToByteMatrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of 8-bit unsigned integer elements.

◆ CanConvertToByteVector()

bool pcl::Variant::CanConvertToByteVector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of 8-bit unsigned integer components.

◆ CanConvertToC32Matrix()

bool pcl::Variant::CanConvertToC32Matrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of 32-bit floating point complex elements.

◆ CanConvertToC32Vector()

bool pcl::Variant::CanConvertToC32Vector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of 32-bit floating point complex components.

◆ CanConvertToC64Matrix()

bool pcl::Variant::CanConvertToC64Matrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of 64-bit floating point complex elements.

◆ CanConvertToC64Vector()

bool pcl::Variant::CanConvertToC64Vector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of 64-bit floating point complex components.

◆ CanConvertToCharMatrix()

bool pcl::Variant::CanConvertToCharMatrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of 8-bit signed integer elements.

◆ CanConvertToCharVector()

bool pcl::Variant::CanConvertToCharVector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of 8-bit signed integer components.

◆ CanConvertToComplex()

bool pcl::Variant::CanConvertToComplex ( ) const
inlinenoexcept

A convenience synonym for CanConvertToDComplex().

Definition at line 1254 of file Variant.h.

◆ CanConvertToDComplex()

bool pcl::Variant::CanConvertToDComplex ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a complex value with double components

◆ CanConvertToDMatrix()

bool pcl::Variant::CanConvertToDMatrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of double elements.

◆ CanConvertToDouble()

bool pcl::Variant::CanConvertToDouble ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a 32-bit floating point value.

◆ CanConvertToDPoint()

bool pcl::Variant::CanConvertToDPoint ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a two-dimensional point with double coordinates.

◆ CanConvertToDRect()

bool pcl::Variant::CanConvertToDRect ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a two-dimensional rectangle with double coordinates.

◆ CanConvertToDVector()

bool pcl::Variant::CanConvertToDVector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of double components.

◆ CanConvertToFComplex()

bool pcl::Variant::CanConvertToFComplex ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a complex value with float components

◆ CanConvertToFloat()

bool pcl::Variant::CanConvertToFloat ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a 32-bit floating point value.

◆ CanConvertToFMatrix()

bool pcl::Variant::CanConvertToFMatrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of float elements.

◆ CanConvertToFPoint()

bool pcl::Variant::CanConvertToFPoint ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a two-dimensional point with float coordinates.

◆ CanConvertToFRect()

bool pcl::Variant::CanConvertToFRect ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a two-dimensional rectangle with float coordinates.

◆ CanConvertToFVector()

bool pcl::Variant::CanConvertToFVector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of float components.

◆ CanConvertToI16Matrix()

bool pcl::Variant::CanConvertToI16Matrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of 16-bit signed integer elements.

◆ CanConvertToI16Vector()

bool pcl::Variant::CanConvertToI16Vector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of 16-bit signed integer components.

◆ CanConvertToI64Matrix()

bool pcl::Variant::CanConvertToI64Matrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of 64-bit integer elements.

◆ CanConvertToI64Vector()

bool pcl::Variant::CanConvertToI64Vector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of 64-bit integer components.

◆ CanConvertToIMatrix()

bool pcl::Variant::CanConvertToIMatrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of integer elements.

◆ CanConvertToInt()

bool pcl::Variant::CanConvertToInt ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a 32-bit integer value.

◆ CanConvertToInt64()

bool pcl::Variant::CanConvertToInt64 ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a 64-bit integer value.

◆ CanConvertToIsoString()

bool pcl::Variant::CanConvertToIsoString ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to an 8-bit ISO/IEC 8859-1 or UTF-8 Unicode string.

◆ CanConvertToIsoStringList()

bool pcl::Variant::CanConvertToIsoStringList ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a dynamic list of 8-bit strings.

◆ CanConvertToIVector()

bool pcl::Variant::CanConvertToIVector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of integer components.

◆ CanConvertToMatrix()

bool pcl::Variant::CanConvertToMatrix ( ) const
inlinenoexcept

A convenience synonym for CanConvertToDMatrix().

Definition at line 1726 of file Variant.h.

◆ CanConvertToPoint()

bool pcl::Variant::CanConvertToPoint ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a two-dimensional point with integer coordinates.

◆ CanConvertToRect()

bool pcl::Variant::CanConvertToRect ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a two-dimensional rectangle with integer coordinates.

◆ CanConvertToString()

bool pcl::Variant::CanConvertToString ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a UTF-16 Unicode string.

◆ CanConvertToStringList()

bool pcl::Variant::CanConvertToStringList ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a dynamic list of UTF-16 Unicode strings.

◆ CanConvertToTimePoint()

bool pcl::Variant::CanConvertToTimePoint ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a TimePoint value.

◆ CanConvertToUI16Matrix()

bool pcl::Variant::CanConvertToUI16Matrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of 16-bit unsigned integer elements.

◆ CanConvertToUI16Vector()

bool pcl::Variant::CanConvertToUI16Vector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of 16-bit unsigned integer components.

◆ CanConvertToUI64Matrix()

bool pcl::Variant::CanConvertToUI64Matrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of 64-bit unsigned integer elements.

◆ CanConvertToUI64Vector()

bool pcl::Variant::CanConvertToUI64Vector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of 64-bit unsigned integer components.

◆ CanConvertToUIMatrix()

bool pcl::Variant::CanConvertToUIMatrix ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a matrix of unsigned integer elements.

◆ CanConvertToUInt()

bool pcl::Variant::CanConvertToUInt ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to an unsigned 32-bit integer value.

◆ CanConvertToUInt64()

bool pcl::Variant::CanConvertToUInt64 ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to an unsigned 64-bit integer value.

◆ CanConvertToUIVector()

bool pcl::Variant::CanConvertToUIVector ( ) const
noexcept

Returns true iff the object stored in this Variant can be converted to a vector of unsigned integer components.

◆ CanConvertToVector()

bool pcl::Variant::CanConvertToVector ( ) const
inlinenoexcept

A convenience synonym for CanConvertToDVector().

Definition at line 1528 of file Variant.h.

◆ Clear()

void pcl::Variant::Clear ( )

Destroys the object stored in this Variant and leaves this object in an invalid state.

◆ Compare()

int pcl::Variant::Compare ( const Variant x) const

Compares the object stored in this Variant with the object stored in another Variant x.

If both Variant instances store objects of different types, the object in x is converted to the type of this Variant as a temporary object, and the comparison is made between the object in this variant and the temporary object. If the object in x cannot be converted to the type of this Variant, an Error exception is thrown.

On success, returns an integer indicating the comparison result:

0 if the objects are equal.
-1 if this object precedes the object in x.
+1 if this object postcedes the object in x.

See also
operator ==(), operator <()

◆ InternalBlockAddress()

const void* pcl::Variant::InternalBlockAddress ( ) const

Returns a pointer to the immutable block of data stored in this Variant object.

For scalar and complex data types (bool, int32, float, fcomplex, etc.), this member function returns a pointer to the transported object.

For vector, matrix and string types, this function returns the starting address of the contiguous data block stored by the transported object. For example, if a ByteArray object is being transported by this Variant object, this function returns ByteArray::Begin().

For other structured types such as points, rectangles and lists, this function throws an Error exception.

◆ IsComplex()

bool pcl::Variant::IsComplex ( ) const
inline

Returns true only if the object transported by this Variant is of a complex type: Complex32 or Complex64.

Definition at line 1977 of file Variant.h.

◆ IsComplexType()

static bool pcl::Variant::IsComplexType ( int  type)
inlinestatic

Returns true only if the specified type is a complex Variant type: Complex32 or Complex64.

Definition at line 1968 of file Variant.h.

◆ IsMatrix()

bool pcl::Variant::IsMatrix ( ) const
inline

Returns true only if the object transported by this Variant is of a matrix type: CharMatrix, ByteMatrix, IMatrix, UIMatrix, I64Matrix, UI64Matrix, FMatrix or DMatrix.

Definition at line 2028 of file Variant.h.

◆ IsMatrixType()

static bool pcl::Variant::IsMatrixType ( int  type)
static

Returns true only if the specified type is a matrix Variant type: CharMatrix, ByteMatrix, IMatrix, UIMatrix, I64Matrix, UI64Matrix, FMatrix or DMatrix.

◆ IsScalar()

bool pcl::Variant::IsScalar ( ) const
inline

Returns true only if the object transported by this Variant is of a scalar type: bool, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float or double.

Definition at line 1959 of file Variant.h.

◆ IsScalarType()

static bool pcl::Variant::IsScalarType ( int  type)
static

Returns true only if the specified type is a scalar Variant type: bool, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float or double.

◆ IsString()

bool pcl::Variant::IsString ( ) const
inline

Returns true only if the object transported by this Variant is of a character string type: String or IsoString.

Definition at line 2046 of file Variant.h.

◆ IsStringType()

static bool pcl::Variant::IsStringType ( int  type)
inlinestatic

Returns true only if the specified type is a character string Variant type: String or IsoString.

Definition at line 2037 of file Variant.h.

◆ IsStructured()

bool pcl::Variant::IsStructured ( ) const
inline

Returns true only if the object transported by this Variant is of a structured type: TimePoint, Point, FPoint, DPoint, Rect, FRect, DRect, StringList, IsoStringList, StringKeyValue, IsoStringKeyValue, StringKeyValueList or IsoStringKeyValueList.

For structured objects the InternalBlockAddress() and BlockSize() member functions cannot be used, since these objects cannot be accessed through a unique pointer and a length in bytes.

Definition at line 2069 of file Variant.h.

◆ IsStructuredType()

static bool pcl::Variant::IsStructuredType ( int  type)
static

Returns true only if the specified type is a structured Variant type: TimePoint, Point, FPoint, DPoint, Rect, FRect, DRect, StringList, IsoStringList, StringKeyValue, IsoStringKeyValue, StringKeyValueList or IsoStringKeyValueList.

◆ IsTimePoint()

bool pcl::Variant::IsTimePoint ( ) const
inline

Returns true only if the object transported by this Variant is of the TimePoint type.

Definition at line 1994 of file Variant.h.

◆ IsTimePointType()

static bool pcl::Variant::IsTimePointType ( int  type)
inlinestatic

Returns true only if the specified type is VariantType::TimePoint.

Definition at line 1985 of file Variant.h.

◆ IsValid()

bool pcl::Variant::IsValid ( ) const
inline

Returns true iff this Variant stores an object. Returns false if this is an invalid Variant object.

Definition at line 1015 of file Variant.h.

◆ IsVector()

bool pcl::Variant::IsVector ( ) const
inline

Returns true only if the object transported by this Variant is of a vector or vector-like type: CharVector, ByteVector, IVector, UIVector, I64Vector, UI64Vector, FVector, DVector, ByteArray, String or IsoString.

Definition at line 2011 of file Variant.h.

◆ IsVectorType()

static bool pcl::Variant::IsVectorType ( int  type)
static

Returns true only if the specified type is a vector or vector-like Variant type: CharVector, ByteVector, IVector, UIVector, I64Vector, UI64Vector, FVector, DVector, ByteArray, String or IsoString.

◆ MatrixDimensions()

Rect pcl::Variant::MatrixDimensions ( ) const

Returns the dimensions of the matrix stored in this Variant object.

If this Variant does not transport a matrix object (IMatrix, FMatrix, DMatrix), this member function throws an Error exception.

The returned rectangle is anchored at {0,0} and has the same dimensions as the transported matrix: Rect::Height() or Rect::y1 is the number of matrix rows, and Rect::Width() or Rect::x1 is the number of matrix columns.

◆ operator<()

bool pcl::Variant::operator< ( const Variant x) const
inline

Returns true iff the object stored in this Variant precedes the object in another Variant x.

This operator is equivalent to:

Compare( x ) < 0;

Definition at line 1087 of file Variant.h.

References pcl::Compare().

◆ operator=() [1/2]

Variant& pcl::Variant::operator= ( const Variant x)
inline

Copy assignment operator. This Variant will store a copy of the object stored in another Variant x. Returns a reference to this object.

Definition at line 953 of file Variant.h.

◆ operator=() [2/2]

Variant& pcl::Variant::operator= ( Variant &&  x)
inline

Move assignment operator.

Definition at line 975 of file Variant.h.

◆ operator==()

bool pcl::Variant::operator== ( const Variant x) const
inline

Returns true iff the object stored in this Variant is equal to the object in another Variant x.

This operator is equivalent to:

Compare( x ) == 0;

Definition at line 1074 of file Variant.h.

References pcl::Compare().

◆ ToBool()

bool pcl::Variant::ToBool ( ) const

Converts the object stored in this Variant to a Boolean value, and returns the result of the conversion.

Throws an Error exception if a Boolean conversion is not possible for the object currently stored in this Variant.

◆ ToBoolean()

bool pcl::Variant::ToBoolean ( ) const
inline

A convenience synonym for ToBool().

Definition at line 1110 of file Variant.h.

◆ ToByteArray()

ByteArray pcl::Variant::ToByteArray ( ) const

Converts the object stored in this Variant to a dynamic array of unsigned 8-bit integers, and returns the result of the conversion.

Throws an Error exception if a conversion to the ByteArray class is not possible for the object currently stored in this Variant.

◆ ToByteMatrix()

ByteMatrix pcl::Variant::ToByteMatrix ( ) const

Converts the object stored in this Variant to a matrix of 8-bit unsigned integer elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the ByteMatrix class is not possible for the object currently stored in this Variant.

◆ ToByteVector()

ByteVector pcl::Variant::ToByteVector ( ) const

Converts the object stored in this Variant to a vector of 8-bit unsigned integer components, and returns the result of the conversion.

Throws an Error exception if a conversion to the ByteVector class is not possible for the object currently stored in this Variant.

◆ ToC32Matrix()

C32Matrix pcl::Variant::ToC32Matrix ( ) const

Converts the object stored in this Variant to a matrix of 32-bit floating point complex elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the C32Matrix class is not possible for the object currently stored in this Variant.

◆ ToC32Vector()

C32Vector pcl::Variant::ToC32Vector ( ) const

Converts the object stored in this Variant to a vector of 32-bit floating point complex components, and returns the result of the conversion.

Throws an Error exception if a conversion to the C32Vector class is not possible for the object currently stored in this Variant.

◆ ToC64Matrix()

C64Matrix pcl::Variant::ToC64Matrix ( ) const

Converts the object stored in this Variant to a matrix of 64-bit floating point complex elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the C64Matrix class is not possible for the object currently stored in this Variant.

◆ ToC64Vector()

C64Vector pcl::Variant::ToC64Vector ( ) const

Converts the object stored in this Variant to a vector of 64-bit floating point complex components, and returns the result of the conversion.

Throws an Error exception if a conversion to the C64Vector class is not possible for the object currently stored in this Variant.

◆ ToCharMatrix()

CharMatrix pcl::Variant::ToCharMatrix ( ) const

Converts the object stored in this Variant to a matrix of 8-bit signed integer elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the CharMatrix class is not possible for the object currently stored in this Variant.

◆ ToCharVector()

CharVector pcl::Variant::ToCharVector ( ) const

Converts the object stored in this Variant to a vector of 8-bit signed integer components, and returns the result of the conversion.

Throws an Error exception if a conversion to the CharVector class is not possible for the object currently stored in this Variant.

◆ ToComplex()

complex pcl::Variant::ToComplex ( ) const
inline

A convenience synonym for ToDComplex().

Definition at line 1246 of file Variant.h.

◆ ToDComplex()

dcomplex pcl::Variant::ToDComplex ( ) const

Converts the object stored in this Variant to a complex value with double components, and returns the result of the conversion.

Throws an Error exception if a conversion to the dcomplex type is not possible for the object currently stored in this Variant.

◆ ToDMatrix()

DMatrix pcl::Variant::ToDMatrix ( ) const

Converts the object stored in this Variant to a matrix of double elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the DMatrix class is not possible for the object currently stored in this Variant.

◆ ToDouble()

double pcl::Variant::ToDouble ( ) const

Converts the object stored in this Variant to a 64-bit floating point value, and returns the result of the conversion.

Throws an Error exception if a conversion to the double type is not possible for the object currently stored in this Variant.

◆ ToDPoint()

DPoint pcl::Variant::ToDPoint ( ) const

Converts the object stored in this Variant to a two-dimensional point with double coordinates, and returns the result of the conversion.

Throws an Error exception if a conversion to the DPoint class is not possible for the object currently stored in this Variant.

◆ ToDRect()

DRect pcl::Variant::ToDRect ( ) const

Converts the object stored in this Variant to a two-dimensional rectangle with double coordinates, and returns the result of the conversion.

Throws an Error exception if a conversion to the DRect class is not possible for the object currently stored in this Variant.

◆ ToDVector()

DVector pcl::Variant::ToDVector ( ) const

Converts the object stored in this Variant to a vector of double components, and returns the result of the conversion.

Throws an Error exception if a conversion to the DVector class is not possible for the object currently stored in this Variant.

◆ ToFComplex()

fcomplex pcl::Variant::ToFComplex ( ) const

Converts the object stored in this Variant to a complex value with float components, and returns the result of the conversion.

Throws an Error exception if a conversion to the fcomplex type is not possible for the object currently stored in this Variant.

◆ ToFloat()

float pcl::Variant::ToFloat ( ) const

Converts the object stored in this Variant to a 32-bit floating point value, and returns the result of the conversion.

Throws an Error exception if a conversion to the float type is not possible for the object currently stored in this Variant.

◆ ToFMatrix()

FMatrix pcl::Variant::ToFMatrix ( ) const

Converts the object stored in this Variant to a matrix of float elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the FMatrix class is not possible for the object currently stored in this Variant.

◆ ToFPoint()

FPoint pcl::Variant::ToFPoint ( ) const

Converts the object stored in this Variant to a two-dimensional point with float coordinates, and returns the result of the conversion.

Throws an Error exception if a conversion to the FPoint class is not possible for the object currently stored in this Variant.

◆ ToFRect()

FRect pcl::Variant::ToFRect ( ) const

Converts the object stored in this Variant to a two-dimensional rectangle with float coordinates, and returns the result of the conversion.

Throws an Error exception if a conversion to the FRect class is not possible for the object currently stored in this Variant.

◆ ToFVector()

FVector pcl::Variant::ToFVector ( ) const

Converts the object stored in this Variant to a vector of float components, and returns the result of the conversion.

Throws an Error exception if a conversion to the FVector class is not possible for the object currently stored in this Variant.

◆ ToI16Matrix()

I16Matrix pcl::Variant::ToI16Matrix ( ) const

Converts the object stored in this Variant to a matrix of 16-bit signed integer elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the I16Matrix class is not possible for the object currently stored in this Variant.

◆ ToI16Vector()

I16Vector pcl::Variant::ToI16Vector ( ) const

Converts the object stored in this Variant to a vector of 16-bit signed integer components, and returns the result of the conversion.

Throws an Error exception if a conversion to the I16Vector class is not possible for the object currently stored in this Variant.

◆ ToI64Matrix()

I64Matrix pcl::Variant::ToI64Matrix ( ) const

Converts the object stored in this Variant to a matrix of 64-bit integer elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the I64Matrix class is not possible for the object currently stored in this Variant.

◆ ToI64Vector()

I64Vector pcl::Variant::ToI64Vector ( ) const

Converts the object stored in this Variant to a vector of 64-bit integer components, and returns the result of the conversion.

Throws an Error exception if a conversion to the I64Vector class is not possible for the object currently stored in this Variant.

◆ ToIMatrix()

IMatrix pcl::Variant::ToIMatrix ( ) const

Converts the object stored in this Variant to a matrix of integer elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the IMatrix class is not possible for the object currently stored in this Variant.

◆ ToInt()

int pcl::Variant::ToInt ( ) const

Converts the object stored in this Variant to a 32-bit integer value, and returns the result of the conversion.

Throws an Error exception if a conversion to the int type is not possible for the object currently stored in this Variant.

◆ ToInt64()

int64 pcl::Variant::ToInt64 ( ) const

Converts the object stored in this Variant to a 64-bit integer value, and returns the result of the conversion.

Throws an Error exception if a conversion to the int64 type is not possible for the object currently stored in this Variant.

◆ ToIsoString()

IsoString pcl::Variant::ToIsoString ( ) const

Converts the object stored in this Variant to an 8-bit ISO/IEC 8859-1 or UTF-8 Unicode string, and returns the result of the conversion.

Throws an Error exception if a conversion to the IsoString class is not possible for the object currently stored in this Variant.

◆ ToIsoStringKeyValue()

IsoStringKeyValue pcl::Variant::ToIsoStringKeyValue ( ) const

Converts the object stored in this Variant to a key/value pair of 8-bit strings, and returns the result of the conversion.

Throws an Error exception if a conversion to the IsoStringKeyValue class is not possible for the object currently stored in this Variant.

◆ ToIsoStringKeyValueList()

IsoStringKeyValueList pcl::Variant::ToIsoStringKeyValueList ( ) const

Converts the object stored in this Variant to a dynamic list of key/value pairs of 8-bit strings, and returns the result of th conversion.

Throws an Error exception if a conversion to the IsoStringKeyValueList class is not possible for the object currently stored in this Variant.

◆ ToIsoStringList()

IsoStringList pcl::Variant::ToIsoStringList ( ) const

Converts the object stored in this Variant to a dynamic list of 8-bit strings, and returns the result of the conversion.

Throws an Error exception if a conversion to the IsoStringList class is not possible for the object currently stored in this Variant.

◆ ToIVector()

IVector pcl::Variant::ToIVector ( ) const

Converts the object stored in this Variant to a vector of integer components, and returns the result of the conversion.

Throws an Error exception if a conversion to the IVector class is not possible for the object currently stored in this Variant.

◆ ToMatrix()

Matrix pcl::Variant::ToMatrix ( ) const
inline

A convenience synonym for ToDMatrix().

Definition at line 1718 of file Variant.h.

◆ ToPoint()

Point pcl::Variant::ToPoint ( ) const

Converts the object stored in this Variant to a two-dimensional point with integer coordinates, and returns the result of the conversion.

Throws an Error exception if a conversion to the Point class is not possible for the object currently stored in this Variant.

◆ ToRect()

Rect pcl::Variant::ToRect ( ) const

Converts the object stored in this Variant to a two-dimensional rectangle with integer coordinates, and returns the result of the conversion.

Throws an Error exception if a conversion to the Rect class is not possible for the object currently stored in this Variant.

◆ ToString()

String pcl::Variant::ToString ( ) const

Converts the object stored in this Variant to a UTF-16 Unicode string, and returns the result of the conversion.

Throws an Error exception if a conversion to the String class is not possible for the object currently stored in this Variant.

◆ ToStringKeyValue()

StringKeyValue pcl::Variant::ToStringKeyValue ( ) const

Converts the object stored in this Variant to a key/value pair of UTF-16 Unicode strings, and returns the result of the conversion.

Throws an Error exception if a conversion to the StringKeyValue class is not possible for the object currently stored in this Variant.

◆ ToStringKeyValueList()

StringKeyValueList pcl::Variant::ToStringKeyValueList ( ) const

Converts the object stored in this Variant to a dynamic list of key/value pairs of UTF-16 Unicode strings, and returns the result of the conversion.

Throws an Error exception if a conversion to the StringKeyValueList class is not possible for the object currently stored in this Variant.

◆ ToStringList()

StringList pcl::Variant::ToStringList ( ) const

Converts the object stored in this Variant to a dynamic list of UTF-16 Unicode strings, and returns the result of the conversion.

Throws an Error exception if a conversion to the StringList class is not possible for the object currently stored in this Variant.

◆ ToTimePoint()

TimePoint pcl::Variant::ToTimePoint ( ) const

Converts the object stored in this Variant to a time point value, and returns the result of the conversion.

Throws an Error exception if a conversion to the TimePoint class is not possible for the object currently stored in this Variant.

◆ ToType()

Variant pcl::Variant::ToType ( data_type  type) const

Converts the object currently stored in this Variant instance to the specified type.

Returns a Variant object with the result of the conversion.

If this Variant is invalid, or if the currently stored object cannot be converted to the requested type, this function throws an Error exception with a descriptive message.

◆ ToUI16Matrix()

UI16Matrix pcl::Variant::ToUI16Matrix ( ) const

Converts the object stored in this Variant to a matrix of 16-bit unsigned integer elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the UI16Matrix class is not possible for the object currently stored in this Variant.

◆ ToUI16Vector()

UI16Vector pcl::Variant::ToUI16Vector ( ) const

Converts the object stored in this Variant to a vector of 16-bit unsigned integer components, and returns the result of the conversion.

Throws an Error exception if a conversion to the UI16Vector class is not possible for the object currently stored in this Variant.

◆ ToUI64Matrix()

UI64Matrix pcl::Variant::ToUI64Matrix ( ) const

Converts the object stored in this Variant to a matrix of 64-bit unsigned integer elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the UI64Matrix class is not possible for the object currently stored in this Variant.

◆ ToUI64Vector()

UI64Vector pcl::Variant::ToUI64Vector ( ) const

Converts the object stored in this Variant to a vector of 64-bit unsigned integer components, and returns the result of the conversion.

Throws an Error exception if a conversion to the UI64Vector class is not possible for the object currently stored in this Variant.

◆ ToUIMatrix()

UIMatrix pcl::Variant::ToUIMatrix ( ) const

Converts the object stored in this Variant to a matrix of unsigned integer elements, and returns the result of the conversion.

Throws an Error exception if a conversion to the UIMatrix class is not possible for the object currently stored in this Variant.

◆ ToUInt()

unsigned int pcl::Variant::ToUInt ( ) const

Converts the object stored in this Variant to an unsigned 32-bit integer value, and returns the result of the conversion.

Throws an Error exception if a conversion to the unsigned int type is not possible for the object currently stored in this Variant.

◆ ToUInt64()

uint64 pcl::Variant::ToUInt64 ( ) const

Converts the object stored in this Variant to an unsigned 64-bit integer value, and returns the result of the conversion.

Throws an Error exception if a conversion to the uint64 type is not possible for the object currently stored in this Variant.

◆ ToUIVector()

UIVector pcl::Variant::ToUIVector ( ) const

Converts the object stored in this Variant to a vector of unsigned integer components, and returns the result of the conversion.

Throws an Error exception if a conversion to the UIVector class is not possible for the object currently stored in this Variant.

◆ ToVector()

Vector pcl::Variant::ToVector ( ) const
inline

A convenience synonym for ToDVector().

Definition at line 1520 of file Variant.h.

◆ Transfer() [1/2]

void pcl::Variant::Transfer ( Variant &&  x)
inline

Transfers the object stored in another Variant x to this Variant. The source object x is left empty/invalid.

Definition at line 1000 of file Variant.h.

◆ Transfer() [2/2]

void pcl::Variant::Transfer ( Variant x)
inline

Transfers the object stored in another Variant x to this Variant. The source object x is left empty/invalid.

Definition at line 985 of file Variant.h.

◆ Type()

data_type pcl::Variant::Type ( ) const
inline

Returns the type of the object currently stored in this Variant.

Definition at line 1023 of file Variant.h.

◆ TypeAsString()

static const char* pcl::Variant::TypeAsString ( int  type)
static

Returns a static null-terminated string with the name of the specified Variant type.

◆ VectorLength()

size_type pcl::Variant::VectorLength ( ) const

Returns the length of the vector stored in this Variant object.

If this Variant does not transport a vector or vector-like object (IVector, FVector, DVector, ByteArray, String or IsoString), this member function throws an Error exception.


The documentation for this class was generated from the following file:
pcl::Variant::Variant
Variant()
Definition: Variant.h:343
pcl::Variant::Compare
int Compare(const Variant &x) const