Go to the documentation of this file.
40 #include "vtkCommonCoreModule.h"
43 #include "vtkSetGet.h"
53 #define vtkExtraExtendedTemplateMacro(call) \
54 vtkExtendedTemplateMacro(call); \
55 vtkTemplateMacroCase(VTK_VARIANT, vtkVariant, call)
58 #define vtkExtendedArrayIteratorTemplateMacro(call) \
59 vtkArrayIteratorTemplateMacro(call); \
60 vtkArrayIteratorTemplateMacroCase(VTK_VARIANT, vtkVariant, call);
327 return this->ToFloat(
nullptr); };
330 return this->ToDouble(
nullptr); };
333 return this->ToChar(
nullptr); };
336 return this->ToUnsignedChar(
nullptr); };
339 return this->ToSignedChar(
nullptr); };
342 return this->ToShort(
nullptr); };
345 return this->ToUnsignedShort(
nullptr); };
348 return this->ToInt(
nullptr); };
351 return this->ToUnsignedInt(
nullptr); };
354 return this->ToLong(
nullptr); };
357 return this->ToUnsignedLong(
nullptr); };
360 return this->ToLongLong(
nullptr); };
363 return this->ToUnsignedLongLong(
nullptr); };
366 return this->ToTypeInt64(
nullptr); };
369 return this->ToTypeUInt64(
nullptr); };
437 template <
typename T>
438 T ToNumeric(
bool *valid, T* vtkNotUsed(ignored))
const;
unsigned short ToUnsignedShort() const
unsigned char ToUnsignedChar(bool *valid) const
bool operator()(const vtkVariant &s1, const vtkVariant &s2) const
long long ToLongLong(bool *valid) const
vtkVariant(int value)
Create an integer variant.
const char * GetTypeAsString() const
Get the type of the variant as a string.
unsigned char ToUnsignedChar() const
vtkVariant(vtkObjectBase *value)
Create a vtkObjectBase variant.
vtkVariant(const vtkVariant &other, unsigned int type)
Create a variant of a specific type.
signed char ToSignedChar(bool *valid) const
vtkVariant(unsigned long value)
Create an unsigned long variant.
vtkVariant(char value)
Create a char variant.
bool IsValid() const
Get whether the variant value is valid.
bool IsUnicodeString() const
Get whether the variant is a Unicode string.
bool IsUnsignedChar() const
Get whether the variant is an unsigned char.
float ToFloat(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
unsigned int GetType() const
Get the type of the variant.
bool operator()(const vtkVariant &s1, const vtkVariant &s2) const
unsigned long ToUnsignedLong() const
vtkVariant(const vtkVariant &other)
Copy constructor.
bool IsArray() const
Get whether the variant is a VTK array (i.e.
vtkVariant(long value)
Create an long variant.
VTKCOMMONCORE_EXPORT bool operator<(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
vtkVariant(long long value)
Create a long long variant.
unsigned char UnsignedChar
vtkVariant(vtkStdString value)
Create a string variant from a std string.
vtkVariant(signed char value)
Create a signed char variant.
bool IsChar() const
Get whether the variant is an char.
vtkTypeInt64 ToTypeInt64() const
vtkObjectBase * ToVTKObject() const
Return the VTK object, or nullptr if not of that type.
vtkStdString ToString() const
Convert the variant to a string.
bool IsEqual(const vtkVariant &other) const
Determines whether two variants have the same value.
bool Is__Int64() const
Legacy.
bool IsNumeric() const
Get whether the variant is any numeric type.
vtkVariant(unsigned char value)
Create an unsigned char variant.
bool IsLongLong() const
Get whether the variant is long long.
double ToDouble(bool *valid) const
unsigned int ToUnsignedInt() const
abstract base class for most VTK objects
bool IsString() const
Get whether the variant is a string.
unsigned long ToUnsignedLong(bool *valid) const
bool operator()(const vtkVariant &s1, const vtkVariant &s2) const
vtkVariant(bool value)
Create a bool variant.
unsigned short UnsignedShort
String class that stores Unicode text.
short ToShort(bool *valid) const
bool IsShort() const
Get whether the variant is an short.
vtkVariant(unsigned int value)
Create an unsigned integer variant.
A atomic type representing the union of many types.
long long ToLongLong() const
vtkVariant(double value)
Create a double variant.
bool IsUnsignedInt() const
Get whether the variant is an unsigned int.
unsigned int ToUnsignedInt(bool *valid) const
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkVariant &val)
vtkObjectBase * VTKObject
vtkTypeInt64 ToTypeInt64(bool *valid) const
bool IsLong() const
Get whether the variant is an long.
vtkAbstractArray * ToArray() const
Return the array, or nullptr if not of that type.
vtkVariant(unsigned long long value)
Create an unsigned long long variant.
vtkVariant(const vtkUnicodeString &value)
Create a Unicode string variant.
bool IsSignedChar() const
Get whether the variant is an signed char.
bool IsFloat() const
Get whether the variant is a float.
Abstract superclass for all arrays.
char ToChar(bool *valid) const
bool IsUnsignedLongLong() const
Get whether the variant is unsigned long long.
unsigned long UnsignedLong
int ToInt(bool *valid) const
bool IsUnsignedShort() const
Get whether the variant is an unsigned short.
~vtkVariant()
Destruct the variant.
vtkTypeUInt64 ToTypeUInt64() const
VTKCOMMONCORE_EXPORT bool operator>=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
vtkVariant(const char *value)
Create a string variant from a const char*.
bool IsUnsignedLong() const
Get whether the variant is an unsigned long.
bool IsInt() const
Get whether the variant is an int.
long ToLong(bool *valid) const
vtkVariant(float value)
Create a float variant.
vtkUnicodeString ToUnicodeString() const
convert the variant to a Unicode string.
unsigned short ToUnsignedShort(bool *valid) const
unsigned long long ToUnsignedLongLong() const
vtkUnicodeString * UnicodeString
Wrapper around std::string to keep symbols short.
VTKCOMMONCORE_EXPORT bool operator!=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT bool operator>(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
vtkVariant(short value)
Create a short variant.
bool IsVTKObject() const
Get whether the variant is a VTK object pointer.
bool IsDouble() const
Get whether the variant is a double.
vtkTypeUInt64 ToTypeUInt64(bool *valid) const
vtkVariant(unsigned short value)
Create an unsigned short variant.
VTKCOMMONCORE_EXPORT bool operator<=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
unsigned long long ToUnsignedLongLong(bool *valid) const
signed char ToSignedChar() const
unsigned long long UnsignedLongLong
bool operator()(const vtkVariant &s1, const vtkVariant &s2) const
bool IsUnsigned__Int64() const
Legacy.
vtkVariant()
Create an invalid variant.