Gecode::Support::SharedArray< T > Class Template Reference
[Support algorithms and datastructures]
#include <shared-array.hh>
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
#include "support/shared-array.hh"
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 SharedArray & | operator= (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
|
Initialize as empty array.
Definition at line 135 of file shared-array.hh. |
|
Initialize as array with n elements.
Definition at line 139 of file shared-array.hh. |
|
Initialize from shared array a (share elements).
Definition at line 144 of file shared-array.hh. |
|
Delete array (elements might be still in use).
Definition at line 152 of file shared-array.hh. |
Member Function Documentation
|
Initialize from shared array a (share elements).
|
|
Update this array from array a (share elements if share is true).
|
|
Access element at position i.
Definition at line 186 of file shared-array.hh. |
|
Access element at position i.
Definition at line 192 of file shared-array.hh. |
|
Return number of elements.
Definition at line 198 of file shared-array.hh. |
|
Change size to n.
Definition at line 204 of file shared-array.hh. |
|
Shrink array to n elements.
Definition at line 216 of file shared-array.hh. |
|
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:
- support/shared-array.hh (Revision: 2676)