GNU Radio's GSM Package
VectorBase< T > Class Template Reference

#include <Vector.h>

Inheritance diagram for VectorBase< T >:

Public Member Functions

size_t size () const
 
size_t bytes () const
 
void resize (size_t newElements)
 
void clear ()
 
void clone (const VectorBase< T > &other)
 
void vConcat (const VectorBase< T > &other1, const VectorBase< T > &other2)
 
 ~VectorBase ()
 
bool isOwner ()
 
std::string inspect () const
 
void copyToSegment (VectorBase< T > &other, size_t start, size_t span) const
 
void copyToSegment (VectorBase< T > &other, size_t start=0) const
 
void copyTo (VectorBase< T > &other) const
 
void segmentCopyTo (VectorBase< T > &other, size_t start, size_t span) const
 
void fill (const T &val)
 
void fill (const T &val, unsigned start, unsigned length)
 
void operator= (const VectorBase< T > &other)
 
T & operator[] (size_t index)
 
const T & operator[] (size_t index) const
 
const T * begin () const
 
T * begin ()
 
const T * end () const
 
T * end ()
 
const T * getData () const
 

Protected Types

typedef T * VectorDataType
 

Protected Member Functions

void vInit (size_t elements)
 
void shiftMem (VectorBase< T > &other)
 
void makeAlias (const VectorBase< T > &other)
 
 VectorBase ()
 
 VectorBase (VectorDataType wData, T *wStart, T *wEnd)
 

Protected Attributes

VectorDataType mData
 allocated data block. More...
 
T * mStart
 start of useful data More...
 
T * mEnd
 end of useful data + 1 More...
 

Detailed Description

template<class T>
class VectorBase< T >

A simplified Vector template with aliases. Unlike std::vector, this class does not support dynamic resizing. Unlike std::vector, this class does support "aliases" and subvectors.

Member Typedef Documentation

template<class T>
typedef T* VectorBase< T >::VectorDataType
protected

Constructor & Destructor Documentation

template<class T>
VectorBase< T >::VectorBase ( )
inlineprotected
template<class T>
VectorBase< T >::VectorBase ( VectorDataType  wData,
T *  wStart,
T *  wEnd 
)
inlineprotected

Build a Vector with explicit values.

template<class T>
VectorBase< T >::~VectorBase ( )
inline

Destroy a Vector, deleting held memory.

Member Function Documentation

template<class T>
const T* VectorBase< T >::begin ( ) const
inline
template<class T>
T* VectorBase< T >::begin ( )
inline
template<class T>
size_t VectorBase< T >::bytes ( ) const
inline

Return size in bytes.

Referenced by VectorBase< char >::clone(), and VectorBase< char >::vConcat().

template<class T>
void VectorBase< T >::clear ( )
inline
template<class T>
void VectorBase< T >::clone ( const VectorBase< T > &  other)
inline
template<class T>
void VectorBase< T >::copyTo ( VectorBase< T > &  other) const
inline
template<class T>
void VectorBase< T >::copyToSegment ( VectorBase< T > &  other,
size_t  start,
size_t  span 
) const
inline

Copy part of this Vector to a segment of another Vector.

Parameters
otherThe other vector.
startThe start point in the other vector.
spanThe number of elements to copy.

Referenced by VectorBase< char >::copyTo().

template<class T>
void VectorBase< T >::copyToSegment ( VectorBase< T > &  other,
size_t  start = 0 
) const
inline

Copy all of this Vector to a segment of another Vector.

Referenced by VectorBase< char >::copyToSegment().

template<class T>
const T* VectorBase< T >::end ( ) const
inline
template<class T>
T* VectorBase< T >::end ( )
inline
template<class T>
void VectorBase< T >::fill ( const T &  val)
inline
template<class T>
void VectorBase< T >::fill ( const T &  val,
unsigned  start,
unsigned  length 
)
inline
template<class T>
const T* VectorBase< T >::getData ( ) const
inline
template<class T>
std::string VectorBase< T >::inspect ( ) const
inline
template<class T>
bool VectorBase< T >::isOwner ( )
inline
template<class T>
void VectorBase< T >::makeAlias ( const VectorBase< T > &  other)
inlineprotected
template<class T>
void VectorBase< T >::operator= ( const VectorBase< T > &  other)
inline

Assign from another Vector.

template<class T>
T& VectorBase< T >::operator[] ( size_t  index)
inline
template<class T>
const T& VectorBase< T >::operator[] ( size_t  index) const
inline
template<class T>
void VectorBase< T >::resize ( size_t  newElements)
inline

Change the size of the Vector in items (not bytes), discarding content.

Referenced by VectorBase< char >::clear(), VectorBase< char >::clone(), VectorBase< char >::vConcat(), and Vector< float >::Vector().

template<class T>
void VectorBase< T >::segmentCopyTo ( VectorBase< T > &  other,
size_t  start,
size_t  span 
) const
inline

Copy a segment of this vector into another.

Parameters
otherThe other vector (to copt into starting at 0.)
startThe start point in this vector.
spanThe number of elements to copy. WARNING: This function does NOT resize the result - you must set the result size before entering.
template<class T>
void VectorBase< T >::shiftMem ( VectorBase< T > &  other)
inlineprotected

Assign from another Vector, shifting ownership.

Referenced by Vector< float >::operator=().

template<class T>
size_t VectorBase< T >::size ( ) const
inline
template<class T>
void VectorBase< T >::vConcat ( const VectorBase< T > &  other1,
const VectorBase< T > &  other2 
)
inline

Referenced by Vector< float >::Vector().

template<class T>
void VectorBase< T >::vInit ( size_t  elements)
inlineprotected

Member Data Documentation


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