Givaro
Public Types | Public Member Functions | Protected Attributes
Array0< T > Class Template Reference

NODOC. More...

#include <givarray0.h>

+ Inheritance diagram for Array0< T >:
+ Collaboration diagram for Array0< T >:

Public Types

typedef int Indice_t
 
typedef T Type_t
 
typedef Array0< T > Self_t
 
typedef Type_tIterator_t
 
typedef const Type_tconstIterator_t
 
typedef Type_t value_type
 STL compliance. More...
 
typedef Type_titerator
 STL compliance. More...
 
typedef const Type_tconst_iterator
 STL compliance. More...
 

Public Member Functions

 Array0 (const Self_t &p, givNoCopy)
 Recopy cstor : logical copy. More...
 
 Array0 (const Self_t &p, givWithCopy)
 Recopy cstor : physical copy. More...
 
 ~Array0 ()
 Destructor. More...
 
void destroy ()
 Destroy of the array. More...
 
void allocate (size_t s)
 Allocation of an array of s Elements. More...
 
void reallocate (size_t s)
 Reallocation of an array of s Elements. More...
 
void resize (size_t s)
 resize More...
 
void reserve (size_t s)
 reserve More...
 
Self_tcopy (const Self_t &src)
 Physical copy operator. More...
 
Self_tlogcopy (const Self_t &src)
 Logical recopy operator: make an alias to src. Return dest. More...
 
Self_toperator= (const Self_t &p)
 assignement operator is physical copy More...
 
size_t size () const
 Return the occuped size of the array. More...
 
size_t phsize () const
 Return the physical size of the array (capacity) More...
 
void push_back (const T &a)
 add one element at the end More...
 
void write (Indice_t i, const Type_t &val)
 write More...
 
void read (Indice_t i, Type_t &val) const
 read More...
 
int getCounter () const
 
 Array0 (size_t s=0)
 Default cstor : ctsor of s size array. More...
 
 Array0 (size_t s, const T &t)
 Default cstor : ctsor of s size array. More...
 
Type_tbaseptr ()
 Return the base ptr to the array. More...
 
const Type_tbaseptr () const
 Return the base ptr to the array. More...
 
const T & operator[] (Indice_t i) const
 Access to the ith Element: More...
 
T & operator[] (Indice_t i)
 Access to the ith Element: More...
 
const T & front () const
 back/front More...
 
T & front ()
 back/front More...
 
const T & back () const
 back/front More...
 
T & back ()
 back/front More...
 
Iterator_t begin ()
 Iterators. More...
 
Iterator_t end ()
 Iterators. More...
 
constIterator_t begin () const
 Iterators. More...
 
constIterator_t end () const
 Iterators. More...
 

Protected Attributes

int * _cnt
 reference counter on _d More...
 
size_t _size
 actual size of the array. More...
 
size_t _psz
 physical size of the array More...
 
T * _d
 ptr to the memory More...
 

Detailed Description

template<class T>
class Givaro::Array0< T >

NODOC.

Member Typedef Documentation

typedef int Indice_t
typedef T Type_t
typedef Array0<T> Self_t
typedef Type_t* Iterator_t
typedef const Type_t* constIterator_t
typedef Type_t value_type

STL compliance.

typedef Type_t* iterator

STL compliance.

typedef const Type_t* const_iterator

STL compliance.

Constructor & Destructor Documentation

Array0 ( size_t  s = 0)
inline

Default cstor : ctsor of s size array.

Array0 ( size_t  s,
const T &  t 
)
inline

Default cstor : ctsor of s size array.

Array0 ( const Self_t p,
givNoCopy   
)
inline

Recopy cstor : logical copy.

Array0 ( const Self_t p,
givWithCopy   
)
inline

Recopy cstor : physical copy.

~Array0 ( )
inline

Destructor.

Member Function Documentation

void destroy ( )
inline

Destroy of the array.

void allocate ( size_t  s)
inline

Allocation of an array of s Elements.

if refcount>1 then it is always a creation of new array

void reallocate ( size_t  s)
inline

Reallocation of an array of s Elements.

if refcount>1 then it is always a creation of new array + recopy

void resize ( size_t  s)
inline

resize

void reserve ( size_t  s)
inline

reserve

Array0< T > & copy ( const Self_t src)
inline

Physical copy operator.

reallocate dest of the same size as src (if necessary) and apply GivaroCopyItem<Array<T>,T> on each Element. This class can be specialized. Return dest (i.e, *this).

Array0< T > & logcopy ( const Self_t src)
inline

Logical recopy operator: make an alias to src. Return dest.

Array0< T > & operator= ( const Self_t p)

assignement operator is physical copy

size_t size ( ) const
inline

Return the occuped size of the array.

size_t phsize ( ) const
inline

Return the physical size of the array (capacity)

T * baseptr ( )
inline

Return the base ptr to the array.

const T * baseptr ( ) const
inline

Return the base ptr to the array.

const T & operator[] ( Indice_t  i) const
inline

Access to the ith Element:

T & operator[] ( Indice_t  i)
inline

Access to the ith Element:

const T & front ( ) const
inline

back/front

T & front ( )
inline

back/front

const T & back ( ) const
inline

back/front

T & back ( )
inline

back/front

void push_back ( const T &  a)
inline

add one element at the end

void write ( Indice_t  i,
const Type_t val 
)
inline

write

void read ( Indice_t  i,
Type_t val 
) const
inline

read

Array0< T >::Iterator_t begin ( )
inline

Iterators.

Array0< T >::Iterator_t end ( )
inline

Iterators.

Array0< T >::constIterator_t begin ( ) const
inline

Iterators.

Array0< T >::constIterator_t end ( ) const
inline

Iterators.

int getCounter ( ) const
inline

get Counter

Field Documentation

int* _cnt
protected

reference counter on _d

size_t _size
protected

actual size of the array.

If ==0 then _psz=_d=_cnt=0

size_t _psz
protected

physical size of the array

T* _d
protected

ptr to the memory


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