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

GNU Radio's GSM Package

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
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

## ◆ 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.

## ◆ ~VectorBase()

template<class T>

VectorBase< T >::~VectorBase | ( |  | ) |
| inline

Destroy a Vector, deleting held memory.

## Member Function Documentation

## ◆ begin() [1/2]

template<class T>

const T* VectorBase< T >::begin | ( |  | ) | const
| inline

## ◆ begin() [2/2]

template<class T>

T* VectorBase< T >::begin | ( |  | ) |
| inline

## ◆ bytes()

template<class T>

size_t VectorBase< T >::bytes | ( |  | ) | const
| inline

Return size in bytes.

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

## ◆ clear()

template<class T>

void VectorBase< T >::clear | ( |  | ) |
| inline

Release memory and clear pointers.

## ◆ clone()

template<class T>

void VectorBase< T >::clone | ( | const VectorBase< T > & | other | ) |
| inline

Copy data from another vector.

Referenced by BitVector::cloneSegment().

## ◆ 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

  other | The other vector.
  start | The start point in the other vector.
  span | The number of elements to copy.

## ◆ 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.

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

## ◆ end() [1/2]

template<class T>

const T* VectorBase< T >::end | ( |  | ) | const
| inline

## ◆ end() [2/2]

template<class T>

T* VectorBase< T >::end | ( |  | ) |
| inline

## ◆ 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

Referenced by VectorBase< char >::makeAlias(), and VectorBase< char >::operator=().

## ◆ 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

Assign from another Vector.

## ◆ 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.

## ◆ 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

  other | The other vector (to copt into starting at 0.)
  start | The start point in this vector.
  span | The number of elements to copy. WARNING: This function does NOT resize the result - you must set the result size before entering.

## ◆ shiftMem()

template<class T>

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

Assign from another Vector, shifting ownership.

## ◆ size()

template<class T>

size_t VectorBase< T >::size | ( |  | ) | const
| inline

Return the size of the Vector in units, ie, the number of T elements.

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

## ◆ 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

template<class T>

VectorDataType VectorBase< T >::mData
| protected

allocated data block.

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

## ◆ mEnd

template<class T>

T* VectorBase< T >::mEnd
| protected

end of useful data + 1

Referenced by VectorBase< char >::copyToSegment(), VectorBase< char >::makeAlias(), and VectorBase< char >::segmentCopyTo().

## ◆ mStart

template<class T>

T* VectorBase< T >::mStart
| protected

start of useful data

Referenced by VectorBase< char >::clone(), VectorBase< char >::copyToSegment(), BitVector::dup(), VectorBase< char >::makeAlias(), VectorBase< char >::segmentCopyTo(), and VectorBase< char >::vConcat().

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

- Vector.h