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

#include <Vector.h>

Inheritance diagram for VectorBase< T >:
Vector< float > Vector< T > SoftVector

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.
 
T * mStart
 start of useful data
 
T * mEnd
 end of useful data + 1
 

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

◆ VectorDataType

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

Constructor & Destructor Documentation

◆ VectorBase() [1/2]

template<class T >
VectorBase< T >::VectorBase ( )
inlineprotected

◆ VectorBase() [2/2]

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

Build a Vector with explicit values.

References VectorBase< T >::getData(), and VECTORDEBUG.

◆ ~VectorBase()

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

Destroy a Vector, deleting held memory.

References VectorBase< T >::clear(), and VECTORDEBUG.

Member Function Documentation

◆ begin() [1/2]

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

◆ begin() [2/2]

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

◆ bytes()

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

Return size in bytes.

References VectorBase< T >::size().

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

◆ clear()

template<class T >
void VectorBase< T >::clear ( )
inline

◆ clone()

◆ copyTo()

template<class T >
void VectorBase< T >::copyTo ( VectorBase< T > &  other) const
inline

◆ copyToSegment() [1/2]

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.

References VectorBase< T >::mEnd, and VectorBase< T >::mStart.

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

◆ copyToSegment() [2/2]

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.

References VectorBase< T >::copyToSegment(), and VectorBase< T >::size().

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

◆ end() [1/2]

template<class T >
T * VectorBase< T >::end ( )
inline

References VectorBase< T >::mEnd.

◆ end() [2/2]

template<class T >
const T * VectorBase< T >::end ( ) const
inline

References VectorBase< T >::mEnd.

Referenced by VectorBase< T >::fill().

◆ fill() [1/2]

template<class T >
void VectorBase< T >::fill ( const T &  val)
inline

◆ fill() [2/2]

template<class T >
void VectorBase< T >::fill ( const T &  val,
unsigned  start,
unsigned  length 
)
inline

◆ getData()

template<class T >
const T * VectorBase< T >::getData ( ) const
inline

◆ inspect()

template<class T >
std::string VectorBase< T >::inspect ( ) const
inline

◆ isOwner()

template<class T >
bool VectorBase< T >::isOwner ( )
inline

◆ makeAlias()

template<class T >
void VectorBase< T >::makeAlias ( const VectorBase< T > &  other)
inlineprotected

◆ operator=()

template<class T >
void VectorBase< T >::operator= ( const VectorBase< T > &  other)
inline

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ resize()

template<class T >
void VectorBase< T >::resize ( size_t  newElements)
inline

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

References VectorBase< T >::mData, VECTORDEBUG, and VectorBase< T >::vInit().

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

◆ segmentCopyTo()

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.

References VectorBase< T >::mEnd, and VectorBase< T >::mStart.

◆ shiftMem()

template<class T >
void VectorBase< T >::shiftMem ( VectorBase< T > &  other)
inlineprotected

◆ size()

◆ vConcat()

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

◆ vInit()

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

Member Data Documentation

◆ mData

◆ mEnd

◆ mStart


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