Loading...
Searching...
No Matches
casacore::TabVecRep< T > Class Template Referenceabstract
tables package (libcasa_tables) » Tables_module » Tables_module_internal_classes

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.
rownr_t | 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 (rownr_t index) const =0
| Get a value.
virtual void | getVal (rownr_t index, T &) const =0
| Get a value.
virtual void | putVal (rownr_t 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 (rownr_t) const
| Check if vectors are comformant.
void * | newVec () const
| Create a new temporary vector (for result of math operations).

## Protected Member Functions

virtual rownr_t | nelem () const
| Get nr of elements.

## Protected Attributes

uInt | count_p
TabVecTag | tag_p
Int64 | nrel_p

## Detailed Description

template<class T>
class casacore::TabVecRep< T >

Templated base class for table vectors.

### Intended use:

Internal

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25

### Prerequisite

- TableVector

### Etymology

TabVecRep is the representation of a table vector.

### Synopsis

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.

### Motivation

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.

### To Do

- put the TabVecTag enum inside the class definition
- support array columns

Definition at line 105 of file TVec.h.

## Constructor & Destructor Documentation

## TabVecRep()

template<class T>

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).

Referenced by assign(), conform(), link(), ok(), and ~TabVecRep().

## ~TabVecRep()

template<class T>

virtual casacore::TabVecRep< T >::~TabVecRep | ( |  | ) |

virtual

Destruct the object.

References TabVecRep().

## Member Function Documentation

## assign()

template<class T>

virtual void casacore::TabVecRep< T >::assign | ( | const TabVecRep< T > & |  | ) |

virtual

Set to another table vector.

References TabVecRep().

## conform() [1/2]

template<class T>

Bool casacore::TabVecRep< T >::conform | ( | const TabVecRep< T > & | vec | ) | const

inline

Test if vector shape conforms another table vector.

Definition at line 187 of file TVec.h.

References casacore::False, casacore::nelements(), nelements(), TabVecRep(), and casacore::True.

## conform() [2/2]

template<class T>

Bool casacore::TabVecRep< T >::conform | ( | const Vector< T > & | vec | ) | const

inline

Test if vector shape conforms another vector.

Definition at line 190 of file TVec.h.

References casacore::False, casacore::ArrayBase::nelements(), casacore::nelements(), and casacore::True.

## getTag()

template<class T>

TabVecTag casacore::TabVecRep< T >::getTag | ( |  | ) | const

inline

Get the tag (the type of vector).

Definition at line 206 of file TVec.h.

References tag_p.

## getVal()

template<class T>

virtual void casacore::TabVecRep< T >::getVal | ( | rownr_t | index,
|  | T & | ) const

pure virtual

Get a value.

Implemented in casacore::TabVecScaCol< T >, and casacore::TabVecTemp< T >.

## link()

template<class T>

TabVecRep< T > * casacore::TabVecRep< T >::link | ( |  | ) |

inline

Increments the reference count.

Definition at line 195 of file TVec.h.

References count_p, and TabVecRep().

Referenced by casacore::TableVector< T >::TableVector().

## ndim()

template<class T>

uInt casacore::TabVecRep< T >::ndim | ( |  | ) | const

inline

Get nr of dimensions.

Definition at line 178 of file TVec.h.

## nelem()

template<class T>

virtual rownr_t casacore::TabVecRep< T >::nelem | ( |  | ) | const

protected virtual

Get nr of elements.

Reimplemented in casacore::TabVecScaCol< T >.

Referenced by nelements().

## nelements()

template<class T>

rownr_t casacore::TabVecRep< T >::nelements | ( |  | ) | const

inline

Get nr of elements (ie.

vector length).

Definition at line 182 of file TVec.h.

References nelem(), and nrel_p.

Referenced by conform().

## newVec()

template<class T>

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.

## ok()

template<class T>

Bool casacore::TabVecRep< T >::ok | ( |  | ) | const

Check internal consistency.

References TabVecRep().

## putVal()

template<class T>

virtual void casacore::TabVecRep< T >::putVal | ( | rownr_t | index,
|  | const T & | )

pure virtual

Put a value.

Implemented in casacore::TabVecScaCol< T >, and casacore::TabVecTemp< T >.

## set()

template<class 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 >.

## unlink()

template<class T>

uInt casacore::TabVecRep< T >::unlink | ( |  | ) |

inline

Decrements the reference count and returns the resulting count.

Definition at line 201 of file TVec.h.

References count_p.

## validateConformance()

template<class T>

void casacore::TabVecRep< T >::validateConformance | ( | rownr_t |  | ) | const

Check if vectors are comformant.

## value()

template<class T>

virtual T casacore::TabVecRep< T >::value | ( | rownr_t | index | ) | const

pure virtual

Get a value.

Implemented in casacore::TabVecScaCol< T >, and casacore::TabVecTemp< T >.

## Member Data Documentation

## count_p

template<class T>

uInt casacore::TabVecRep< T >::count_p

protected

Definition at line 157 of file TVec.h.

Referenced by link(), and unlink().

## nrel_p

template<class T>

Int64 casacore::TabVecRep< T >::nrel_p

protected

Definition at line 159 of file TVec.h.

Referenced by nelements().

## tag_p

template<class T>

TabVecTag casacore::TabVecRep< T >::tag_p

protected

Definition at line 158 of file TVec.h.

Referenced by getTag().

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

- tables/Tables/TVec.h