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

CTBvectorCDsc Class Template Reference

Read-only vector descriptor (see CTBvectorDsc for description). More...

#include <CTBvectorDsc.hxx>

Inheritance diagram for CTBvectorCDsc:

Inheritance graph
[legend]
Collaboration diagram for CTBvectorCDsc:

Collaboration graph
[legend]
List of all members.

Public Methods

 CTBvectorCDsc ()
 CTBvectorCDsc (const T *p_data, CTBint i_size, CTBint i_stride=1)
 CTBvectorCDsc (const T *p_data, CTBrange ran)
 CTBvectorCDsc (const T *p_data, CTBint i_stride, CTBrange ran)
const TData () const
CTBint Size () const
CTBint Stride () const
void Dump (int i_indent=0, ostream &os=cout, const char *p_text=0) const
const Toperator[] (CTBint i_ind) const
const Toperator() (CTBint i_ind) const
bool operator! () const
 operator void * () const

Protected Attributes

Tmp_data
CTBint mi_size
CTBint mi_stride

Related Functions

(Note that these are not member functions.)

ostream & operator<< (ostream &os, CTBvectorCDsc< T > obj)

Detailed Description

template<class T>
class CTBvectorCDsc< T >

Read-only vector descriptor (see CTBvectorDsc for description).

Implementation Notes:

Definition at line 19 of file CTBvectorDsc.hxx.


Constructor & Destructor Documentation

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

Construct descriptor for empty (size=0) vector.

Definition at line 41 of file CTBvectorDsc.icc.

template<class T>
CTBvectorCDsc< T >::CTBvectorCDsc const 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 is ignored and a null is stored 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 57 of file CTBvectorDsc.icc.

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

Construct descriptor from data pointer p_data and range ran.

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 73 of file CTBvectorDsc.icc.

template<class T>
CTBvectorCDsc< T >::CTBvectorCDsc const 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 95 of file CTBvectorDsc.icc.


Member Function Documentation

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

Returns pointer to first element of vector.

Reimplemented in CTBvectorDsc.

Definition at line 112 of file CTBvectorDsc.icc.

Referenced by CTBvectorDsc::operator=().

template<class T>
CTBint CTBvectorCDsc< T >::Size const [inline]
 

Returns size of vector.

Definition at line 121 of file CTBvectorDsc.icc.

Referenced by CTBprintfVD::Dimension1(), CTBvectorDsc::operator=(), and CTBvector::operator=().

template<class T>
CTBint CTBvectorCDsc< T >::Stride const [inline]
 

Returns stride of vector.

Definition at line 130 of file CTBvectorDsc.icc.

Referenced by CTBvectorDsc::operator=().

template<class T>
void CTBvectorCDsc< T >::Dump int i_indent = 0,
ostream & os = cout,
const char * p_text = 0
const [inline]
 

Dump.

Definition at line 139 of file CTBvectorDsc.icc.

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

Constant access element (index checked if CTB__IndexCheck defined).

Reimplemented in CTBvectorDsc.

Definition at line 157 of file CTBvectorDsc.icc.

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

Constant access element (index checked if CTB__IndexCheck defined).

Reimplemented in CTBvectorDsc.

Definition at line 169 of file CTBvectorDsc.icc.

template<class T>
bool CTBvectorCDsc< T >::operator! const [inline]
 

Returns true if vector empty (equivalent to Size() == 0).

Definition at line 181 of file CTBvectorDsc.icc.

template<class T>
CTBvectorCDsc< T >::operator void * const [inline]
 

Returns 0 if vector empty, otherwise a non zero pointer.

Definition at line 190 of file CTBvectorDsc.icc.


Friends And Related Function Documentation

template<class T>
ostream & operator<< ostream & os,
CTBvectorCDsc< T > obj
[related]
 

ostream insertion.

Definition at line 202 of file CTBvectorDsc.icc.


Member Data Documentation

template<class T>
T* CTBvectorCDsc::mp_data [protected]
 

pointer to data.

Definition at line 44 of file CTBvectorDsc.hxx.

template<class T>
CTBint CTBvectorCDsc::mi_size [protected]
 

vector size.

Definition at line 45 of file CTBvectorDsc.hxx.

template<class T>
CTBint CTBvectorCDsc::mi_stride [protected]
 

vector stride.

Definition at line 46 of file CTBvectorDsc.hxx.


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