casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
casacore::TabVecRep< T > Class Template Referenceabstract

Templated base class for table vectors. More...

#include <TVec.h>

Inheritance diagram for casacore::TabVecRep< T >:
casacore::TabVecScaCol< T > casacore::TabVecTemp< T >

Public Member Functions

 TabVecRep ()
 Create empty table vector. More...
 
virtual ~TabVecRep ()
 Destruct the object. More...
 
uInt ndim () const
 Get nr of dimensions. More...
 
rownr_t nelements () const
 Get nr of elements (ie. More...
 
Bool conform (const TabVecRep< T > &) const
 Test if vector shape conforms another table vector. More...
 
Bool conform (const Vector< T > &) const
 Test if vector shape conforms another vector. More...
 
Bool ok () const
 Check internal consistency. More...
 
TabVecRep< T > * link ()
 Increments the reference count. More...
 
uInt unlink ()
 Decrements the reference count and returns the resulting count. More...
 
TabVecTag getTag () const
 Get the tag (the type of vector). More...
 
virtual T value (rownr_t index) const =0
 Get a value. More...
 
virtual void getVal (rownr_t index, T &) const =0
 Get a value. More...
 
virtual void putVal (rownr_t index, const T &)=0
 Put a value. More...
 
virtual void set (const T &)=0
 Set entire vector to a value. More...
 
virtual void assign (const TabVecRep< T > &)
 Set to another table vector. More...
 
void validateConformance (rownr_t) const
 Check if vectors are comformant. More...
 
void * newVec () const
 Create a new temporary vector (for result of math operations). More...
 

Protected Member Functions

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

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

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

Definition at line 107 of file TVec.h.

Constructor & Destructor Documentation

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

template<class T>
virtual casacore::TabVecRep< T >::~TabVecRep ( )
virtual

Destruct the object.

Member Function Documentation

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

Set to another table vector.

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 189 of file TVec.h.

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

template<class T >
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::nelements(), and casacore::True.

template<class T >
TabVecTag casacore::TabVecRep< T >::getTag ( ) const
inline

Get the tag (the type of vector).

Definition at line 208 of file TVec.h.

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

Get a value.

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

template<class T >
TabVecRep< T > * casacore::TabVecRep< T >::link ( )
inline

Increments the reference count.

Definition at line 197 of file TVec.h.

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

template<class T >
uInt casacore::TabVecRep< T >::ndim ( ) const
inline

Get nr of dimensions.

Definition at line 180 of file TVec.h.

template<class T>
virtual rownr_t casacore::TabVecRep< T >::nelem ( ) const
protectedvirtual

Get nr of elements.

Reimplemented in casacore::TabVecScaCol< T >.

template<class T >
rownr_t casacore::TabVecRep< T >::nelements ( ) const
inline

Get nr of elements (ie.

vector length).

Definition at line 184 of file TVec.h.

Referenced by casacore::TabVecRep< T >::conform().

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.

template<class T>
Bool casacore::TabVecRep< T >::ok ( ) const

Check internal consistency.

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

Put a value.

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

template<class T>
virtual void casacore::TabVecRep< T >::set ( const T &  )
pure virtual

Set entire vector to a value.

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

template<class T >
uInt casacore::TabVecRep< T >::unlink ( )
inline

Decrements the reference count and returns the resulting count.

Definition at line 203 of file TVec.h.

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

Check if vectors are comformant.

template<class T>
virtual T casacore::TabVecRep< T >::value ( rownr_t  index) const
pure virtual

Get a value.

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

Member Data Documentation

template<class T>
uInt casacore::TabVecRep< T >::count_p
protected

Definition at line 159 of file TVec.h.

template<class T>
Int64 casacore::TabVecRep< T >::nrel_p
protected

Definition at line 161 of file TVec.h.

template<class T>
TabVecTag casacore::TabVecRep< T >::tag_p
protected

Definition at line 160 of file TVec.h.


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