MetriVis Overview | Download | User Manual | Development
Reference Overview | Design Documentation | Reference Backend | Reference Frontend

metrivis::MultiType Class Reference

Represents data in a very generic way without using templates. More...

#include <MultiType.h>


Public Member Functions

 MultiType (MT_Type type=MT_NULL)
 Constructor creating a MultiType for one specific input type.
 ~MultiType ()
 Deconstructor.
MultiTypeoperator= (std::string value)
 Assigning a string value to this container.
long double GetDoubleElement (long index_x)
 Accesses an element in the local double data array.
long double * GetDoubleElements (long index_x)
long double GetDoubleElement (long index_x, long index_y)
const std::string & GetStringElement (long index_x, long index_y)
 Accesses an element in the local string data array.
void SetString (const std::string &value)
 Assigning a string value to this container.
void AppendString (const std::string &value)
 Append a string value to this container.
void SetDoubleArray (long double *double_array, long length)
 Assigning a double array to this container.
void SetDoubleArray (long double **double_array, long length_x, long length_y)
 Assigning a double array to this container.
void PushString (long array_index, const std::string &element)
 Pushes a string on a certain string array.
std::string GetString () const
 Returns the value as a string.
long GetSize () const
 Calculates the size of the container needed in memory.
long length_x () const
 Returns the length of the 1D double array.
long length_y () const
 Returns the length of the 2D double array.

Private Member Functions

 MultiType (const MultiType &mt)
 Copy constructor.

Private Attributes

Value value_
 Value of this MultiType class.

Data Structures

struct  Value
 Structure holding value informations about this Multitype. More...


Detailed Description

Represents data in a very generic way without using templates.

Only one Value can be Stored inside this Class, but it can have any type.

See also:
MT_Type

Constructor & Destructor Documentation

metrivis::MultiType::MultiType ( MT_Type  type = MT_NULL  ) 

Constructor creating a MultiType for one specific input type.

Parameters:
type,: The type of the variable this container is used for.
The MultiType class will from this moment on only hold one value of this type. It may be outputable in multiple types.


Member Function Documentation

long double metrivis::MultiType::GetDoubleElement ( long  index_x  ) 

Accesses an element in the local double data array.

Parameters:
index,: The index in the local double array.
Only works if the MultiType is holding a double array.

See header file for more infos.

long double * metrivis::MultiType::GetDoubleElements ( long  index_x  ) 

See header file for more infos.

long double metrivis::MultiType::GetDoubleElement ( long  index_x,
long  index_y 
)

See header file for more infos.

const std::string & metrivis::MultiType::GetStringElement ( long  index_x,
long  index_y 
)

Accesses an element in the local string data array.

Parameters:
index_x,: The index in the local string array.
index_y,: The index in the local string array.
Only works if the MultiType is holding a string array.

See header file for more infos.

void metrivis::MultiType::SetString ( const std::string &  value  ) 

Assigning a string value to this container.

Set the string value.

Parameters:
value,: The value as String.
See header file for more infos.

void metrivis::MultiType::AppendString ( const std::string &  value  ) 

Append a string value to this container.

Parameters:
value,: The value as String.
See header file for more infos.

void metrivis::MultiType::SetDoubleArray ( long double *  double_array,
long  length 
)

Assigning a double array to this container.

Parameters:
double_array,: Pointer to the double array.
length,: Length of the double array.
The memory will from this call on be handeled by this class and be freed once the container is not used anymore.

See header file for more infos.

void metrivis::MultiType::SetDoubleArray ( long double **  double_array,
long  length_x,
long  length_y 
)

Assigning a double array to this container.

Parameters:
double_array,: Pointer to the double array.
length_x,: Length of the first level array.
length_y,: Length of the second level array.
The memory will from this call on be handeled by this class and be freed once the container is not used anymore.

See header file for more infos.

void metrivis::MultiType::PushString ( long  array_index,
const std::string &  element 
)

Pushes a string on a certain string array.

Parameters:
array_index,: The index of the array to be used.
element,: The elemenent containing the string.
See header file for more infos.

std::string metrivis::MultiType::GetString (  )  const

Returns the value as a string.

Set the string value.

See header file for more infos.

long metrivis::MultiType::GetSize (  )  const

Calculates the size of the container needed in memory.

Returns:
The size of the container in bytes.
See header file for more infos.

long metrivis::MultiType::length_x (  )  const [inline]

Returns the length of the 1D double array.

Returns:
The length of the double array.

long metrivis::MultiType::length_y (  )  const [inline]

Returns the length of the 2D double array.

Returns:
The length of the double array.


The documentation for this class was generated from the following files:
Generated on Fri Feb 29 16:47:20 2008 for MetriVis by  doxygen 1.5.3