Templated base class for table vectors. More...
#include <TVec.h>
Public Member Functions | |
TabVecRep () | |
Create empty table vector. | |
virtual | ~TabVecRep () |
Destruct the object. | |
uInt | ndim () const |
Get nr of dimensions. | |
uInt | nelements () const |
Get nr of elements (ie. | |
Bool | conform (const TabVecRep< T > &) const |
Test if vector shape conforms another table vector. | |
Bool | conform (const Vector< T > &) const |
Test if vector shape conforms another vector. | |
Bool | ok () const |
Check internal consistency. | |
TabVecRep< T > * | link () |
Increments the reference count. | |
uInt | unlink () |
Decrements the reference count and returns the resulting count. | |
TabVecTag | getTag () const |
Get the tag (the type of vector). | |
virtual T | value (uInt index) const =0 |
Get a value. | |
virtual void | getVal (uInt index, T &) const =0 |
Get a value. | |
virtual void | putVal (uInt index, const T &)=0 |
Put a value. | |
virtual void | set (const T &)=0 |
Set entire vector to a value. | |
virtual void | assign (const TabVecRep< T > &) |
Set to another table vector. | |
void | validateConformance (uInt) const |
Check if vectors are comformant. | |
void * | newVec () const |
Create a new temporary vector (for result of math operations). | |
Protected Member Functions | |
virtual uInt | nelem () const |
Get nr of elements. | |
Protected Attributes | |
uInt | count_p |
TabVecTag | tag_p |
Int | nrel_p |
Templated base class for table vectors.
Internal
TabVecRep is the representation of a table vector.
TabVecRep is the counted referenced letter class for the envelope class TableVector. It is an abstract base class for the actual table vector classes TabVecScaCol and TabVecTemp.
All operations defined for TableVector are immediately passed to the corresponding virtual TabVecRep function. The header files TVecMath.h and TVecLogic.h declare all the mathematical and logical functions for TabVecRep.
A virtual function call only works when used with an object pointer or reference. To allow the use of virtual functions in value objects, an extra level of indirection is used. This is called the letter/envelope idiom and is described in "Advanced C++" by J. Coplien. Class TableVector is the envelope to the letters TabVecRep and its derivations.
Definition at line 107 of file TVec.h.
casacore::TabVecRep< T >::TabVecRep | ( | ) |
Create empty table vector.
TabVecRep cannot be contructed by the user, because it is an abstract base class (it contains pure virtual functions).
virtual casacore::TabVecRep< T >::~TabVecRep | ( | ) | [virtual] |
Destruct the object.
virtual void casacore::TabVecRep< T >::assign | ( | const TabVecRep< T > & | ) | [virtual] |
Set to another table vector.
Bool casacore::TabVecRep< T >::conform | ( | const Vector< T > & | vec | ) | const [inline] |
Test if vector shape conforms another vector.
Definition at line 192 of file TVec.h.
References casacore::False, casacore::ArrayBase::nelements(), casacore::TabVecRep< T >::nelements(), and casacore::True.
Bool casacore::TabVecRep< T >::conform | ( | const TabVecRep< T > & | vec | ) | const [inline] |
Test if vector shape conforms another table vector.
Definition at line 189 of file TVec.h.
References casacore::False, casacore::TabVecRep< T >::nelements(), and casacore::True.
TabVecTag casacore::TabVecRep< T >::getTag | ( | ) | const [inline] |
Get the tag (the type of vector).
Definition at line 208 of file TVec.h.
References casacore::TabVecRep< T >::tag_p.
virtual void casacore::TabVecRep< T >::getVal | ( | uInt | index, | |
T & | ||||
) | const [pure virtual] |
Get a value.
Implemented in casacore::TabVecScaCol< T >, and casacore::TabVecTemp< T >.
TabVecRep< T > * casacore::TabVecRep< T >::link | ( | ) | [inline] |
Increments the reference count.
Definition at line 197 of file TVec.h.
References casacore::TabVecRep< T >::count_p.
Referenced by casacore::TableVector< T >::TableVector().
uInt casacore::TabVecRep< T >::ndim | ( | ) | const [inline] |
virtual uInt casacore::TabVecRep< T >::nelem | ( | ) | const [protected, virtual] |
Get nr of elements.
Reimplemented in casacore::TabVecScaCol< T >.
Referenced by casacore::TabVecRep< T >::nelements().
uInt casacore::TabVecRep< T >::nelements | ( | ) | const [inline] |
Get nr of elements (ie.
vector length).
Definition at line 184 of file TVec.h.
References casacore::TabVecRep< T >::nelem(), and casacore::TabVecRep< T >::nrel_p.
Referenced by casacore::TabVecRep< T >::conform().
void* casacore::TabVecRep< T >::newVec | ( | ) | const |
Create a new temporary vector (for result of math operations).
TabVecTemp<T>& cannot be used, because the template instantiation mechanism instantiates TabVecTemp, which depends on TabVecRep and therefore gives errors.
Bool casacore::TabVecRep< T >::ok | ( | ) | const |
Check internal consistency.
virtual void casacore::TabVecRep< T >::putVal | ( | uInt | index, | |
const T & | ||||
) | [pure virtual] |
Put a value.
Implemented in casacore::TabVecScaCol< T >, and casacore::TabVecTemp< T >.
virtual void casacore::TabVecRep< T >::set | ( | const T & | ) | [pure virtual] |
Set entire vector to a value.
Implemented in casacore::TabVecScaCol< T >, and casacore::TabVecTemp< T >.
uInt casacore::TabVecRep< T >::unlink | ( | ) | [inline] |
Decrements the reference count and returns the resulting count.
Definition at line 203 of file TVec.h.
References casacore::TabVecRep< T >::count_p.
void casacore::TabVecRep< T >::validateConformance | ( | uInt | ) | const |
Check if vectors are comformant.
virtual T casacore::TabVecRep< T >::value | ( | uInt | index | ) | const [pure virtual] |
Get a value.
Implemented in casacore::TabVecScaCol< T >, and casacore::TabVecTemp< T >.
uInt casacore::TabVecRep< T >::count_p [protected] |
Definition at line 159 of file TVec.h.
Referenced by casacore::TabVecRep< T >::link(), and casacore::TabVecRep< T >::unlink().
Int casacore::TabVecRep< T >::nrel_p [protected] |
Definition at line 161 of file TVec.h.
Referenced by casacore::TabVecRep< T >::nelements().
TabVecTag casacore::TabVecRep< T >::tag_p [protected] |
Definition at line 160 of file TVec.h.
Referenced by casacore::TabVecRep< T >::getTag().