plptools
Loading...
Searching...
No Matches
bufferArray Class Reference

An array of bufferStores. More...

#include <bufferarray.h>

Collaboration diagram for bufferArray:

Public Member Functions

 bufferArray ()
 constructs a new bufferArray. More...
 
 bufferArray (const bufferArray &a)
 Constructs a new bufferArray. More...
 
 ~bufferArray ()
 Destroys the bufferArray. More...
 
bufferArrayoperator= (const bufferArray &a)
 Copys the bufferArray. More...
 
bool empty () const
 Checks if this bufferArray is empty. More...
 
bufferStoreoperator[] (const unsigned long index)
 Retrieves the bufferStore at given index. More...
 
bufferArray operator+ (const bufferStore &s)
 Appends a bufferStore to a bufferArray. More...
 
bufferArray operator+ (const bufferArray &a)
 Concatenates two bufferArrays. More...
 
bufferArrayoperator+= (const bufferStore &s)
 Appends a bufferStore to current instance. More...
 
bufferArrayoperator+= (const bufferArray &a)
 Appends a bufferArray to current instance. More...
 
bufferStore pop (void)
 Removes the first bufferStore. More...
 
void push (const bufferStore &b)
 Inserts a bufferStore at index 0. More...
 
void append (const bufferStore &b)
 Appends a bufferStore. More...
 
long length (void)
 Evaluates the current length. More...
 
void clear (void)
 Empties the bufferArray. More...
 

Private Attributes

long len
 The current number of bufferStores in this bufferArray. More...
 
long lenAllocd
 The current number of bufferStores allocated. More...
 
bufferStorebuff
 The content. More...
 

Static Private Attributes

static const long ALLOC_MIN = 5
 Minimum number of bufferStores to allocate. More...
 

Detailed Description

An array of bufferStores.

Definition at line 31 of file bufferarray.h.

Constructor & Destructor Documentation

◆ bufferArray() [1/2]

bufferArray::bufferArray ( )

constructs a new bufferArray.

A minimum of ALLOC_MIN elements is allocated.

Definition at line 26 of file bufferarray.cc.

◆ bufferArray() [2/2]

bufferArray::bufferArray ( const bufferArray a)

Constructs a new bufferArray.

Parameters
aThe initial contents for this array.

Definition at line 33 of file bufferarray.cc.

◆ ~bufferArray()

bufferArray::~bufferArray ( )

Destroys the bufferArray.

Definition at line 42 of file bufferarray.cc.

Member Function Documentation

◆ append()

void bufferArray::append ( const bufferStore b)

Appends a bufferStore.

Parameters
bThe bufferStore to be appended.

Definition at line 61 of file bufferarray.cc.

◆ clear()

void bufferArray::clear ( void  )

Empties the bufferArray.

Definition at line 97 of file bufferarray.cc.

◆ empty()

bool bufferArray::empty ( ) const
inline

Checks if this bufferArray is empty.

Returns
true if the bufferArray is empty.

Definition at line 165 of file bufferarray.h.

◆ length()

long bufferArray::length ( void  )

Evaluates the current length.

Returns
The current number of bufferStores

Definition at line 91 of file bufferarray.cc.

◆ operator+() [1/2]

bufferArray bufferArray::operator+ ( const bufferArray a)

Concatenates two bufferArrays.

Parameters
aThe bufferArray to be appended.
Returns
A new bufferArray consisting with a appended.

Definition at line 132 of file bufferarray.cc.

◆ operator+() [2/2]

bufferArray bufferArray::operator+ ( const bufferStore s)

Appends a bufferStore to a bufferArray.

Parameters
sThe bufferStore to be appended.
Returns
A new bufferArray with bufferStore appended to.

Definition at line 124 of file bufferarray.cc.

◆ operator+=() [1/2]

bufferArray & bufferArray::operator+= ( const bufferArray a)

Appends a bufferArray to current instance.

Parameters
aThe bufferArray to append.
Returns
A reference to the current instance with a appended.

Definition at line 140 of file bufferarray.cc.

◆ operator+=() [2/2]

bufferArray & bufferArray::operator+= ( const bufferStore s)

Appends a bufferStore to current instance.

Parameters
sThe bufferStore to append.
Returns
A reference to the current instance with s appended.

Definition at line 155 of file bufferarray.cc.

◆ operator=()

bufferArray & bufferArray::operator= ( const bufferArray a)

Copys the bufferArray.

Definition at line 106 of file bufferarray.cc.

◆ operator[]()

bufferStore & bufferArray::operator[] ( const unsigned long  index)

Retrieves the bufferStore at given index.

Returns
The bufferStore at index.

Definition at line 118 of file bufferarray.cc.

◆ pop()

bufferStore bufferArray::pop ( void  )

Removes the first bufferStore.

Returns
The removed bufferStore.

Definition at line 47 of file bufferarray.cc.

◆ push()

void bufferArray::push ( const bufferStore b)

Inserts a bufferStore at index 0.

Parameters
bThe bufferStore to be inserted.

Definition at line 76 of file bufferarray.cc.

Member Data Documentation

◆ ALLOC_MIN

const long bufferArray::ALLOC_MIN = 5
staticprivate

Minimum number of bufferStores to allocate.

Definition at line 145 of file bufferarray.h.

◆ buff

bufferStore* bufferArray::buff
private

The content.

Definition at line 162 of file bufferarray.h.

◆ len

long bufferArray::len
private

The current number of bufferStores in this bufferArray.

Definition at line 151 of file bufferarray.h.

◆ lenAllocd

long bufferArray::lenAllocd
private

The current number of bufferStores allocated.

Definition at line 157 of file bufferarray.h.


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