Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

CTBvectorDsc Class Template Reference

Vector descriptor. More...

#include <CTBvectorDsc.hxx>

Inheritance diagram for CTBvectorDsc:

Inheritance graph
[legend]
Collaboration diagram for CTBvectorDsc:

Collaboration graph
[legend]
List of all members.

Public Methods

 CTBvectorDsc ()
 CTBvectorDsc (T *p_data, CTBint i_size, CTBint i_stride=1)
 CTBvectorDsc (T *p_data, CTBrange ran)
 CTBvectorDsc (T *p_data, CTBint i_stride, CTBrange ran)
TData () const
Toperator[] (CTBint i_ind) const
Toperator() (CTBint i_ind) const
const CTBvectorDsc< T > & operator= (const T &rhs) const
const CTBvectorDsc< T > & operator= (const CTBvectorDsc< T > &rhs) const
const CTBvectorDsc< T > & operator= (const CTBvectorCDsc< T > &rhs) const

Detailed Description

template<class T>
class CTBvectorDsc< T >

Vector descriptor.

The classes CTBvectorDsc and CTBvectorCDsc can describe any indexable array of elements of type T. They are mainly used to represent subsets of vectors and matrices.

Vector descriptors are in many ways similar to C++ references, but rather refering to a whole object they just refer to a part of an object. The key semantics of vector descriptors is like for C++ references:

This otherwise unusual combination allows to initialize vector descriptors and to path them as return arguments on one hand but to use them as stand-ins for a vector in all other circumstances.

Definition at line 55 of file CTBvectorDsc.hxx.


Constructor & Destructor Documentation

template<class T>
CTBvectorDsc< T >::CTBvectorDsc [inline]
 

Construct descriptor for empty (size=0) vector.

Creates a vector descriptor representing the sequence p_data[ran.Begin()], ... p_data[ran.End()]. Note that ranges can describe ascending or decending index ranges, but never an empty index range.

Definition at line 244 of file CTBvectorDsc.icc.

template<class T>
CTBvectorDsc< T >::CTBvectorDsc T * p_data,
CTBint i_size,
CTBint i_stride = 1
[inline]
 

Construct descriptor from data pointer p_data and size i_size.

The value of p_data and a null is stored is ignored if i_size = 0. This simplifies the generation of descriptors in cases where the vector is empty and prevents under all circumstances that pathological data pointers are passed around.

Definition at line 258 of file CTBvectorDsc.icc.

template<class T>
CTBvectorDsc< T >::CTBvectorDsc T * p_data,
CTBrange ran
[inline]
 

Construct descriptor from data pointer p_data and range ran.

Definition at line 266 of file CTBvectorDsc.icc.

template<class T>
CTBvectorDsc< T >::CTBvectorDsc T * p_data,
CTBint i_stride,
CTBrange ran
[inline]
 

Construct descriptor from pointer p_data , stride and range ran.

Assumes a vector starting at p_data with a stride i_stride and creates a vector descriptor representing the range [ran.Begin(), ... [ran.End()]. Note that ranges can describe ascending or decending index ranges, but never an empty index range.

Definition at line 280 of file CTBvectorDsc.icc.


Member Function Documentation

template<class T>
T * CTBvectorDsc< T >::Data const [inline]
 

Returns pointer to first element of vector.

Reimplemented from CTBvectorCDsc.

Definition at line 288 of file CTBvectorDsc.icc.

template<class T>
T & CTBvectorDsc< T >::operator[] CTBint i_ind const [inline]
 

Access element (index checked if CTB__IndexCheck defined).

Reimplemented from CTBvectorCDsc.

Definition at line 297 of file CTBvectorDsc.icc.

template<class T>
T & CTBvectorDsc< T >::operator() CTBint i_ind const [inline]
 

Access element (index checked if CTB__IndexCheck defined).

Reimplemented from CTBvectorCDsc.

Definition at line 309 of file CTBvectorDsc.icc.

template<class T>
const CTBvectorDsc< T > & CTBvectorDsc< T >::operator= const T & rhs const
 

Set all elements to the scalar value rhs.

Definition at line 321 of file CTBvectorDsc.icc.

Referenced by operator=().

template<class T>
const CTBvectorDsc< T > & CTBvectorDsc< T >::operator= const CTBvectorDsc< T > & rhs const
 

Copy elements rhs (conformity checked if CTB__ConformityCheck).

Definition at line 343 of file CTBvectorDsc.icc.

template<class T>
const CTBvectorDsc< T > & CTBvectorDsc< T >::operator= const CTBvectorCDsc< T > & rhs const
 

Copy elements rhs (conformity checked if CTB__ConformityCheck).

Definition at line 353 of file CTBvectorDsc.icc.


The documentation for this class was generated from the following files:
Generated at Fri Oct 24 18:14:14 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001