A simple vector implementation. More...
#include <simplevector.h>
Public Types | |
enum | { eNUMBER_OF_ELEMENTS = 7 } |
anonymous enum (instead of define like macros) More... | |
Public Member Functions | |
cSimpleVector () throw (cSimpleVectorException*) | |
Default constructor: init members to zero. | |
cSimpleVector (int nb_values, char const *str) throw (cSimpleVectorException*) | |
Constructor: init members from nb_values comma separated values in the give string str. | |
cSimpleVector (int nb_values, int start_index, char const *str) throw (cSimpleVectorException*) | |
Constructor: init members from nb_values comma separated values in the give string str. | |
cSimpleVector (int nb_values, int start_index, float *values) throw (cSimpleVectorException*) | |
Constructor: init members beginning with start_index from nb_values in arrray values. | |
void | FromString (int nb_values, int start_index, char const *str) throw (cSimpleVectorException*) |
init nb_values starting from index start_index from comma separated values in str | |
double & | operator[] (unsigned int index) |
index operator, return a reference to the index-th element of this | |
bool | Valid (unsigned int index) const |
Return true if vector element index is valid (has been accessed at least once) | |
double & | x (void) |
Interpret object as x/y/z vector: return x = the first element, if that is valid. | |
double & | y (void) |
Interpret object as x/y/z vector: return x = the first element, if that is valid. | |
double & | z (void) |
Interpret object as x/y/z vector: return x = the first element, if that is valid. | |
Protected Attributes | |
int | valid |
bit mask which values in value are valid | |
double | value [eNUMBER_OF_ELEMENTS] |
A simple vector implementation.
Objects of this class are used to return vector like answers from the SDH firmware to the cSDHBase class. End users need not use this class, as cSDH, the real end user interface class provides a more convenient way using STL vectors.
Definition at line 108 of file simplevector.h.
anonymous enum |
anonymous enum (instead of define like macros)
Definition at line 112 of file simplevector.h.
cSimpleVector::cSimpleVector | ( | ) | throw (cSimpleVectorException*) |
Default constructor: init members to zero.
cSimpleVector::cSimpleVector | ( | int | nb_values, |
char const * | str | ||
) | throw (cSimpleVectorException*) |
Constructor: init members from nb_values comma separated values in the give string str.
cSimpleVector::cSimpleVector | ( | int | nb_values, |
int | start_index, | ||
char const * | str | ||
) | throw (cSimpleVectorException*) |
Constructor: init members from nb_values comma separated values in the give string str.
cSimpleVector::cSimpleVector | ( | int | nb_values, |
int | start_index, | ||
float * | values | ||
) | throw (cSimpleVectorException*) |
Constructor: init members beginning with start_index from nb_values in arrray values.
void cSimpleVector::FromString | ( | int | nb_values, |
int | start_index, | ||
char const * | str | ||
) | throw (cSimpleVectorException*) |
init nb_values starting from index start_index from comma separated values in str
double& cSimpleVector::operator[] | ( | unsigned int | index | ) |
index operator, return a reference to the index-th element of this
bool cSimpleVector::Valid | ( | unsigned int | index | ) | const |
Return true if vector element index is valid (has been accessed at least once)
double& cSimpleVector::x | ( | void | ) |
Interpret object as x/y/z vector: return x = the first element, if that is valid.
double& cSimpleVector::y | ( | void | ) |
Interpret object as x/y/z vector: return x = the first element, if that is valid.
double& cSimpleVector::z | ( | void | ) |
Interpret object as x/y/z vector: return x = the first element, if that is valid.
int cSimpleVector::valid [protected] |
bit mask which values in value are valid
Definition at line 164 of file simplevector.h.
double cSimpleVector::value[eNUMBER_OF_ELEMENTS] [protected] |
Definition at line 161 of file simplevector.h.