vtkVariant Class Reference

#include <vtkVariant.h>

Collaboration diagram for vtkVariant:

Collaboration graph
[legend]

List of all members.


Detailed Description

A atomic type representing the union of many types.

Thanks:
Thanks to Patricia Crossno, Ken Moreland, Andrew Wilson and Brian Wylie from Sandia National Laboratories for their help in developing this class.
Tests:
vtkVariant (Tests)

Definition at line 59 of file vtkVariant.h.

float ToFloat (bool *valid=0) const
double ToDouble (bool *valid=0) const
char ToChar (bool *valid=0) const
unsigned char ToUnsignedChar (bool *valid=0) const
signed char ToSignedChar (bool *valid=0) const
short ToShort (bool *valid=0) const
unsigned short ToUnsignedShort (bool *valid=0) const
int ToInt (bool *valid=0) const
unsigned int ToUnsignedInt (bool *valid=0) const
long ToLong (bool *valid=0) const
unsigned long ToUnsignedLong (bool *valid=0) const
vtkTypeInt64 ToTypeInt64 (bool *valid=0) const
vtkTypeUInt64 ToTypeUInt64 (bool *valid=0) const
vtkObjectBaseToVTKObject () const
vtkAbstractArrayToArray () const
template<typename T>
ToNumeric (bool *valid, T *vtkNotUsed(ignored)) const

Public Member Functions

 vtkVariant ()
 ~vtkVariant ()
 vtkVariant (const vtkVariant &other)
 vtkVariant (char value)
 vtkVariant (unsigned char value)
 vtkVariant (signed char value)
 vtkVariant (short value)
 vtkVariant (unsigned short value)
 vtkVariant (int value)
 vtkVariant (unsigned int value)
 vtkVariant (long value)
 vtkVariant (unsigned long value)
 vtkVariant (float value)
 vtkVariant (double value)
 vtkVariant (const char *value)
 vtkVariant (vtkStdString value)
 vtkVariant (vtkObjectBase *value)
const vtkVariantoperator= (const vtkVariant &other)
bool IsValid () const
bool IsString () const
bool IsNumeric () const
bool IsFloat () const
bool IsDouble () const
bool IsChar () const
bool IsUnsignedChar () const
bool IsSignedChar () const
bool IsShort () const
bool IsUnsignedShort () const
bool IsInt () const
bool IsUnsignedInt () const
bool IsLong () const
bool IsUnsignedLong () const
bool Is__Int64 () const
bool IsUnsigned__Int64 () const
bool IsLongLong () const
bool IsUnsignedLongLong () const
bool IsVTKObject () const
bool IsArray () const
unsigned int GetType () const
const char * GetTypeAsString () const
vtkStdString ToString () const

Constructor & Destructor Documentation

vtkVariant::vtkVariant (  ) 

Create an invalid variant.

vtkVariant::~vtkVariant (  ) 

Destruct the variant.

vtkVariant::vtkVariant ( const vtkVariant other  ) 

Copy constructor.

vtkVariant::vtkVariant ( char  value  ) 

Create a char variant.

vtkVariant::vtkVariant ( unsigned char  value  ) 

Create an unsigned char variant.

vtkVariant::vtkVariant ( signed char  value  ) 

Create a signed char variant.

vtkVariant::vtkVariant ( short  value  ) 

Create a short variant.

vtkVariant::vtkVariant ( unsigned short  value  ) 

Create an unsigned short variant.

vtkVariant::vtkVariant ( int  value  ) 

Create an integer variant.

vtkVariant::vtkVariant ( unsigned int  value  ) 

Create an unsigned integer variant.

vtkVariant::vtkVariant ( long  value  ) 

Create an long variant.

vtkVariant::vtkVariant ( unsigned long  value  ) 

Create an unsigned long variant.

vtkVariant::vtkVariant ( float  value  ) 

Create a float variant.

vtkVariant::vtkVariant ( double  value  ) 

Create a double variant.

vtkVariant::vtkVariant ( const char *  value  ) 

Create a string variant from a const char*.

vtkVariant::vtkVariant ( vtkStdString  value  ) 

Create a string variant from a std string.

vtkVariant::vtkVariant ( vtkObjectBase value  ) 

Create a vtkObjectBase variant.


Member Function Documentation

const vtkVariant& vtkVariant::operator= ( const vtkVariant other  ) 

Copy the value of one variant into another.

bool vtkVariant::IsValid (  )  const

Get whether the variant value is valid.

bool vtkVariant::IsString (  )  const

Get whether the variant is a string.

bool vtkVariant::IsNumeric (  )  const

Get whether the variant is any numeric type.

bool vtkVariant::IsFloat (  )  const

Get whether the variant is a float.

bool vtkVariant::IsDouble (  )  const

Get whether the variant is a double.

bool vtkVariant::IsChar (  )  const

Get whether the variant is an char.

bool vtkVariant::IsUnsignedChar (  )  const

Get whether the variant is an unsigned char.

bool vtkVariant::IsSignedChar (  )  const

Get whether the variant is an signed char.

bool vtkVariant::IsShort (  )  const

Get whether the variant is an short.

bool vtkVariant::IsUnsignedShort (  )  const

Get whether the variant is an unsigned short.

bool vtkVariant::IsInt (  )  const

Get whether the variant is an int.

bool vtkVariant::IsUnsignedInt (  )  const

Get whether the variant is an unsigned int.

bool vtkVariant::IsLong (  )  const

Get whether the variant is an long.

bool vtkVariant::IsUnsignedLong (  )  const

Get whether the variant is an unsigned long.

bool vtkVariant::Is__Int64 (  )  const

Get whether the variant is an __int64.

bool vtkVariant::IsUnsigned__Int64 (  )  const

Get whether the variant is an unsigned __int64.

bool vtkVariant::IsLongLong (  )  const

Get whether the variant is long long.

bool vtkVariant::IsUnsignedLongLong (  )  const

Get whether the variant is unsigned long long.

bool vtkVariant::IsVTKObject (  )  const

Get whether the variant is a VTK object pointer.

bool vtkVariant::IsArray (  )  const

Get whether the variant is a VTK array (i.e. a subclass of vtkAbstractArray).

unsigned int vtkVariant::GetType (  )  const

Get the type of the variant.

const char* vtkVariant::GetTypeAsString (  )  const

Get the type of the variant as a string.

vtkStdString vtkVariant::ToString (  )  const

Convert the variant to a string.

float vtkVariant::ToFloat ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

double vtkVariant::ToDouble ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

char vtkVariant::ToChar ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

unsigned char vtkVariant::ToUnsignedChar ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

signed char vtkVariant::ToSignedChar ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

short vtkVariant::ToShort ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

unsigned short vtkVariant::ToUnsignedShort ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

int vtkVariant::ToInt ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

unsigned int vtkVariant::ToUnsignedInt ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

long vtkVariant::ToLong ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

unsigned long vtkVariant::ToUnsignedLong ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

vtkTypeInt64 vtkVariant::ToTypeInt64 ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

vtkTypeUInt64 vtkVariant::ToTypeUInt64 ( bool *  valid = 0  )  const

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.

vtkObjectBase* vtkVariant::ToVTKObject (  )  const

Return the VTK object, or NULL if not of that type.

vtkAbstractArray* vtkVariant::ToArray (  )  const

Return the array, or NULL if not of that type.

template<typename T>
T vtkVariant::ToNumeric ( bool *  valid,
T *  vtkNotUsedignored 
) const [inline]

Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type. If it holds a string, attempt to convert the string to the appropriate type; set the valid flag to false when the conversion fails. If it holds an array type, cast the first value of the array to the appropriate type. Fail if it holds a VTK object which is not an array.


Member Data Documentation

Definition at line 244 of file vtkVariant.h.

Definition at line 245 of file vtkVariant.h.

Definition at line 246 of file vtkVariant.h.

Definition at line 247 of file vtkVariant.h.

unsigned char vtkVariant::UnsignedChar

Definition at line 248 of file vtkVariant.h.

Definition at line 249 of file vtkVariant.h.

Definition at line 250 of file vtkVariant.h.

unsigned short vtkVariant::UnsignedShort

Definition at line 251 of file vtkVariant.h.

Definition at line 252 of file vtkVariant.h.

Definition at line 253 of file vtkVariant.h.

Definition at line 254 of file vtkVariant.h.

unsigned long vtkVariant::UnsignedLong

Definition at line 255 of file vtkVariant.h.

Definition at line 264 of file vtkVariant.h.


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

Generated on Sat Dec 27 13:57:10 2008 for VTK by  doxygen 1.5.6