MeVisLabToolboxReference
ml::MultiField< DATATYPE > Class Template Reference

Field to represent a dynamic vector of DATATYPE values. More...

#include <mlMultiFields.h>

Inheritance diagram for ml::MultiField< DATATYPE >:
ml::Field

List of all members.

Public Member Functions

 MultiField (const std::string &name="")
 Empty Constructor: Create a field with name name.
void setStringValue (const std::string &value)
 Set value to value.
void setMultiField (const std::vector< DATATYPE > &value)
 Set values of the field to value which is a std::vector.
void setMultiField (const DATATYPE values[], size_t numValues)
 Set values of the field to values which is an array of values.
void getMultiField (DATATYPE values[], size_t numValues)
 Get values from the field into values which is an array of values.
std::string getStringValue () const
 Return the value as string value.
const std::vector< DATATYPE > & getMultiField () const
 Returns the vector of the field.
std::vector< DATATYPE > & getNonConstMultiField ()
 Returns the vector of the field as modifiable reference.
size_t getSize () const
 Returns number of entries in vector.

Detailed Description

template<class DATATYPE>
class ml::MultiField< DATATYPE >

Field to represent a dynamic vector of DATATYPE values.

Definition at line 61 of file mlMultiFields.h.


Constructor & Destructor Documentation

template<class DATATYPE>
ml::MultiField< DATATYPE >::MultiField ( const std::string &  name = "") [inline]

Empty Constructor: Create a field with name name.

Internally, a std::vector is used with initial size of zero.

Definition at line 69 of file mlMultiFields.h.


Member Function Documentation

template<class DATATYPE>
void ml::MultiField< DATATYPE >::getMultiField ( DATATYPE  values[],
size_t  numValues 
) [inline]

Get values from the field into values which is an array of values.

numValues must indicate the number of values to be written into values. values must have enough capacity to contain at least numValues. Note: If the MultiField has less than numValues entries then only the number of MultiField entries is written into values and the rest of the values is left unchanged.

Definition at line 147 of file mlMultiFields.h.

template<class DATATYPE>
const std::vector<DATATYPE>& ml::MultiField< DATATYPE >::getMultiField ( ) const [inline]

Returns the vector of the field.

Definition at line 188 of file mlMultiFields.h.

template<class DATATYPE>
std::vector<DATATYPE>& ml::MultiField< DATATYPE >::getNonConstMultiField ( ) [inline]

Returns the vector of the field as modifiable reference.

Definition at line 198 of file mlMultiFields.h.

template<class DATATYPE>
size_t ml::MultiField< DATATYPE >::getSize ( ) const [inline]

Returns number of entries in vector.

Definition at line 208 of file mlMultiFields.h.

template<class DATATYPE>
std::string ml::MultiField< DATATYPE >::getStringValue ( ) const [inline, virtual]

Return the value as string value.

Implements ml::Field.

Reimplemented in ml::StringLineMultiField.

Definition at line 172 of file mlMultiFields.h.

template<class DATATYPE>
void ml::MultiField< DATATYPE >::setMultiField ( const std::vector< DATATYPE > &  value) [inline]

Set values of the field to value which is a std::vector.

Definition at line 96 of file mlMultiFields.h.

template<class DATATYPE>
void ml::MultiField< DATATYPE >::setMultiField ( const DATATYPE  values[],
size_t  numValues 
) [inline]

Set values of the field to values which is an array of values.

numValues must indicate exactly the number of values to be set and values must contain all these values.

Definition at line 113 of file mlMultiFields.h.

template<class DATATYPE>
void ml::MultiField< DATATYPE >::setStringValue ( const std::string &  value) [inline, virtual]

Set value to value.

The value string is parsed and it is assumed that each value is separated by 'space'. If a 'wrong' character is detected the parsing stops and only the values before this character are used.

Implements ml::Field.

Reimplemented in ml::StringLineMultiField.

Definition at line 80 of file mlMultiFields.h.


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