The ChainCon Software (Release 0.03)
Public Member Functions | Private Attributes | List of all members
extarray< ElemT > Class Template Reference

A simple extendible array that extends automatically when needed. More...

#include <extarray.h>

Public Member Functions

 extarray ()
 Default constructor. More...
 
 ~extarray ()
 Destructor. More...
 
 extarray (const extarray< ElemT > &other)
 Copy constructor. More...
 
extarray< ElemT > & operator= (const extarray< ElemT > &other)
 Assignment operator. More...
 
ElemT & operator[] (int_t n)
 Accesses a given element, and extends the array if necessary. More...
 
const ElemT & operator[] (int_t n) const
 Accesses a given element without modifying the array. More...
 
void swap (extarray< ElemT > &other)
 Swaps contents with another extensible array. More...
 

Private Attributes

int_t len
 The length of the allocated array. More...
 
ElemT * arr
 The array of elements. More...
 

Detailed Description

template<class ElemT>
class extarray< ElemT >

A simple extendible array that extends automatically when needed.

Definition at line 42 of file extarray.h.

Constructor & Destructor Documentation

◆ extarray() [1/2]

template<class ElemT >
extarray< ElemT >::extarray ( )
inline

Default constructor.

Definition at line 78 of file extarray.h.

◆ ~extarray()

template<class ElemT >
extarray< ElemT >::~extarray ( )
inline

Destructor.

Definition at line 85 of file extarray.h.

◆ extarray() [2/2]

template<class ElemT>
extarray< ElemT >::extarray ( const extarray< ElemT > &  other)
inline

Copy constructor.

Definition at line 93 of file extarray.h.

Member Function Documentation

◆ operator=()

template<class ElemT>
extarray< ElemT > & extarray< ElemT >::operator= ( const extarray< ElemT > &  other)
inline

Assignment operator.

Definition at line 103 of file extarray.h.

◆ operator[]() [1/2]

template<class ElemT >
ElemT & extarray< ElemT >::operator[] ( int_t  n)
inline

Accesses a given element, and extends the array if necessary.

Definition at line 122 of file extarray.h.

◆ operator[]() [2/2]

template<class ElemT >
const ElemT & extarray< ElemT >::operator[] ( int_t  n) const
inline

Accesses a given element without modifying the array.

Definition at line 147 of file extarray.h.

◆ swap()

template<class ElemT>
void extarray< ElemT >::swap ( extarray< ElemT > &  other)
inline

Swaps contents with another extensible array.

Definition at line 157 of file extarray.h.

Member Data Documentation

◆ arr

template<class ElemT>
ElemT* extarray< ElemT >::arr
private

The array of elements.

Definition at line 71 of file extarray.h.

Referenced by extarray< CoefT >::extarray(), and extarray< CoefT >::~extarray().

◆ len

template<class ElemT>
int_t extarray< ElemT >::len
private

The length of the allocated array.

Definition at line 68 of file extarray.h.

Referenced by extarray< CoefT >::extarray().


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