84 int mask = (1<<start_index);
85 for (
int i=0; i < nb_values; i++ )
87 value[ i+start_index ] = values[i];
106 for (
int i = 0; i < nb_values; i++ )
110 int vi = start_index+i;
111 nb_fields = sscanf( str,
" %lf%n", &(
value[ vi ]), &n );
113 if ( nb_fields != 1 )
122 while ( *str ==
',' )
134 return value[ index ];
173 return (
valid & (1<<index)) != 0;
double & operator[](unsigned int index)
index operator, return a reference to the index-th element of this
Derived exception class for low-level simple vector related exceptions.
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. ...
int valid
bit mask which values in value are valid
bool Valid(unsigned int index) const
Return true if vector element index is valid (has been accessed at least once)
void FromString(int nb_values, int start_index, char const *str)
init nb_values starting from index start_index from comma separated values in str ...
This file contains interface and implementation of class #SDH::cDBG, a class for colorfull debug mess...
Interface of class #SDH::cSimpleVector.
#define USING_NAMESPACE_SDH
double value[eNUMBER_OF_ELEMENTS]
double & x(void)
Interpret object as x/y/z vector: return x = the first element, if that is valid. ...
Class for short, fixed maximum length text messages.
cSimpleVector()
Default constructor: init members to zero.
number of elements in vector