Generated on Wed Jan 4 17:49:25 2006 for Gecode by doxygen 1.4.6

Gecode::Support::SharedArray< T > Class Template Reference
[Support algorithms and datastructures]

#include <shared-array.hh>

List of all members.


Detailed Description

template<class T>
class Gecode::Support::SharedArray< T >

Shared array with arbitrary number of elements.

Sharing is implemented by reference counting: the same elements are shared among several objects.

Requires

Definition at line 41 of file shared-array.hh.

Public Member Functions

 SharedArray (void)
 Initialize as empty array.
 SharedArray (int n)
 Initialize as array with n elements.
 SharedArray (const SharedArray< T > &a)
 Initialize from shared array a (share elements).
const SharedArrayoperator= (const SharedArray &)
 Initialize from shared array a (share elements).
void update (bool share, SharedArray &a)
 Update this array from array a (share elements if share is true).
 ~SharedArray (void)
 Delete array (elements might be still in use).
T & operator[] (int i)
 Access element at position i.
const T & operator[] (int i) const
 Access element at position i.
int size (void) const
 Return number of elements.
void size (int n)
 Change size to n.
void shrink (int n)
 Shrink array to n elements.
void ensure (int n)
 Ensure that array has at least n elements.


Constructor & Destructor Documentation

template<class T>
Gecode::Support::SharedArray< T >::SharedArray void   )  [inline]
 

Initialize as empty array.

Definition at line 135 of file shared-array.hh.

template<class T>
Gecode::Support::SharedArray< T >::SharedArray int  n  )  [inline]
 

Initialize as array with n elements.

Definition at line 139 of file shared-array.hh.

template<class T>
Gecode::Support::SharedArray< T >::SharedArray const SharedArray< T > &  a  )  [inline]
 

Initialize from shared array a (share elements).

Definition at line 144 of file shared-array.hh.

template<class T>
Gecode::Support::SharedArray< T >::~SharedArray void   )  [inline]
 

Delete array (elements might be still in use).

Definition at line 152 of file shared-array.hh.


Member Function Documentation

template<class T>
const SharedArray& Gecode::Support::SharedArray< T >::operator= const SharedArray< T > &   ) 
 

Initialize from shared array a (share elements).

template<class T>
void Gecode::Support::SharedArray< T >::update bool  share,
SharedArray< T > &  a
 

Update this array from array a (share elements if share is true).

template<class T>
T & Gecode::Support::SharedArray< T >::operator[] int  i  )  [inline]
 

Access element at position i.

Definition at line 186 of file shared-array.hh.

template<class T>
const T & Gecode::Support::SharedArray< T >::operator[] int  i  )  const [inline]
 

Access element at position i.

Definition at line 192 of file shared-array.hh.

template<class T>
int Gecode::Support::SharedArray< T >::size void   )  const [inline]
 

Return number of elements.

Definition at line 198 of file shared-array.hh.

template<class T>
void Gecode::Support::SharedArray< T >::size int  n  )  [inline]
 

Change size to n.

Definition at line 204 of file shared-array.hh.

template<class T>
void Gecode::Support::SharedArray< T >::shrink int  n  )  [inline]
 

Shrink array to n elements.

Definition at line 216 of file shared-array.hh.

template<class T>
void Gecode::Support::SharedArray< T >::ensure int  n  )  [inline]
 

Ensure that array has at least n elements.

Definition at line 227 of file shared-array.hh.


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