Public Types | Public Member Functions | Protected Attributes | List of all members
cSimpleVector Class Reference

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 ()
 Default constructor: init members to zero. More...
 
 cSimpleVector (int nb_values, char const *str)
 Constructor: init members from nb_values comma separated values in the give string str. More...
 
 cSimpleVector (int nb_values, int start_index, char const *str)
 Constructor: init members from nb_values comma separated values in the give string str. More...
 
 cSimpleVector (int nb_values, int start_index, float *values)
 Constructor: init members beginning with start_index from nb_values in arrray values. More...
 
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 More...
 
double & operator[] (unsigned int index)
 index operator, return a reference to the index-th element of this More...
 
bool Valid (unsigned int index) const
 Return true if vector element index is valid (has been accessed at least once) More...
 
double & x (void)
 Interpret object as x/y/z vector: return x = the first element, if that is valid. More...
 
double & y (void)
 Interpret object as x/y/z vector: return x = the first element, if that is valid. More...
 
double & z (void)
 Interpret object as x/y/z vector: return x = the first element, if that is valid. More...
 

Protected Attributes

int valid
 bit mask which values in value are valid More...
 
double value [eNUMBER_OF_ELEMENTS]
 

Detailed Description

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 91 of file simplevector.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

anonymous enum (instead of define like macros)

Enumerator
eNUMBER_OF_ELEMENTS 

number of elements in vector

Definition at line 95 of file simplevector.h.

Constructor & Destructor Documentation

◆ cSimpleVector() [1/4]

USING_NAMESPACE_SDH cSimpleVector::cSimpleVector ( )

Default constructor: init members to zero.

Definition at line 66 of file simplevector.cpp.

◆ cSimpleVector() [2/4]

cSimpleVector::cSimpleVector ( int  nb_values,
char const *  str 
)

Constructor: init members from nb_values comma separated values in the give string str.

Definition at line 75 of file simplevector.cpp.

◆ cSimpleVector() [3/4]

cSimpleVector::cSimpleVector ( int  nb_values,
int  start_index,
char const *  str 
)

Constructor: init members from nb_values comma separated values in the give string str.

Definition at line 95 of file simplevector.cpp.

◆ cSimpleVector() [4/4]

cSimpleVector::cSimpleVector ( int  nb_values,
int  start_index,
float *  values 
)

Constructor: init members beginning with start_index from nb_values in arrray values.

Definition at line 81 of file simplevector.cpp.

Member Function Documentation

◆ FromString()

void cSimpleVector::FromString ( int  nb_values,
int  start_index,
char const *  str 
)

init nb_values starting from index start_index from comma separated values in str

Definition at line 102 of file simplevector.cpp.

◆ operator[]()

double & cSimpleVector::operator[] ( unsigned int  index)

index operator, return a reference to the index-th element of this

Definition at line 129 of file simplevector.cpp.

◆ Valid()

bool cSimpleVector::Valid ( unsigned int  index) const

Return true if vector element index is valid (has been accessed at least once)

Definition at line 168 of file simplevector.cpp.

◆ x()

double & cSimpleVector::x ( void  )

Interpret object as x/y/z vector: return x = the first element, if that is valid.

Definition at line 139 of file simplevector.cpp.

◆ y()

double & cSimpleVector::y ( void  )

Interpret object as x/y/z vector: return x = the first element, if that is valid.

Definition at line 149 of file simplevector.cpp.

◆ z()

double & cSimpleVector::z ( void  )

Interpret object as x/y/z vector: return x = the first element, if that is valid.

Definition at line 159 of file simplevector.cpp.

Member Data Documentation

◆ valid

int cSimpleVector::valid
protected

bit mask which values in value are valid

Definition at line 142 of file simplevector.h.

◆ value

double cSimpleVector::value[eNUMBER_OF_ELEMENTS]
protected

Definition at line 139 of file simplevector.h.


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


sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Mon Feb 28 2022 23:41:52