Gecode::SharedArray< T > Class Template Reference
Inherits Gecode::SharedHandle.
Detailed Description
template<class T>
class Gecode::SharedArray< T >
Shared array with arbitrary number of elements.
Sharing is implemented by reference counting: the same elements are shared among several objects.
Definition at line 53 of file shared-array.icc.
Public Member Functions | |
SharedArray (void) | |
Construct as not yet intialized. | |
SharedArray (int n) | |
Initialize as array with n elements. | |
void | init (int n) |
Initialize as array with n elements. | |
SharedArray (const SharedArray &a) | |
Initialize from shared array a (share elements). | |
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. | |
Reflection::Arg * | spec (Reflection::VarMap &vm) const |
Return specification for reflection. | |
SharedArray (Reflection::VarMap &vm, Reflection::Arg *arg) | |
Recreate from specification. | |
Classes | |
class | SAO |
Implementation of object for shared arrays. More... |
Constructor & Destructor Documentation
template<class T>
Gecode::SharedArray< T >::SharedArray | ( | void | ) | [inline] |
Construct as not yet intialized.
The only member functions that can be used on a constructed but not yet initialized shared array is init and the assignment operator.
Definition at line 184 of file shared-array.icc.
template<class T>
Gecode::SharedArray< T >::SharedArray | ( | int | n | ) | [inline] |
template<class T>
Gecode::SharedArray< T >::SharedArray | ( | const SharedArray< T > & | a | ) | [inline] |
template<class T>
Gecode::SharedArray< T >::SharedArray | ( | Reflection::VarMap & | vm, | |
Reflection::Arg * | arg | |||
) | [inline] |
Member Function Documentation
template<class T>
void Gecode::SharedArray< T >::init | ( | int | n | ) | [inline] |
Initialize as array with n elements.
This member function can only be used once and only if the shared array has been constructed with the default constructor.
Definition at line 198 of file shared-array.icc.
template<class T>
T & Gecode::SharedArray< T >::operator[] | ( | int | i | ) | [inline] |
template<class T>
const T & Gecode::SharedArray< T >::operator[] | ( | int | i | ) | const [inline] |
template<class T>
int Gecode::SharedArray< T >::size | ( | void | ) | const [inline] |
template<class T>
Reflection::Arg * Gecode::SharedArray< T >::spec | ( | Reflection::VarMap & | vm | ) | const [inline] |
The documentation for this class was generated from the following file:
- gecode/kernel/shared-array.icc (Revision: 5290)