
Shared array with arbitrary number of elements. More...
#include <shared-array.hpp>
Classes | |
| class | SAO |
| Implementation of object for shared arrays. More... | |
Public Member Functions | |
| SharedArray (void) | |
| Construct as not yet intialized. More... | |
| SharedArray (int n) | |
| Initialize as array with n elements. More... | |
| void | init (int n) |
| Initialize as array with n elements. More... | |
| SharedArray (const SharedArray &a) | |
| Initialize from shared array a (share elements) More... | |
| SharedArray (const ArgArrayBase< T > &a) | |
| Initialize from argument array a. More... | |
| T & | operator[] (int i) |
| Access element at position i. More... | |
| const T & | operator[] (int i) const |
| Access element at position i. More... | |
| int | size (void) const |
| Return number of elements. More... | |
Public Member Functions inherited from Gecode::SharedHandle | |
| SharedHandle (void) | |
| Create shared handle with no object pointing to. More... | |
| SharedHandle (SharedHandle::Object *so) | |
| Create shared handle that points to shared object so. More... | |
| SharedHandle (const SharedHandle &sh) | |
| Copy constructor maintaining reference count. More... | |
| SharedHandle & | operator= (const SharedHandle &sh) |
| Assignment operator maintaining reference count. More... | |
| void | update (Space &home, bool share, SharedHandle &sh) |
| Updating during cloning. More... | |
| ~SharedHandle (void) | |
| Destructor that maintains reference count. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| template<class Char , class Traits , class T > | |
| std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const SharedArray< T > &x) |
| Print array elements enclosed in curly brackets. More... | |
Associated types | |
| typedef T | value_type |
| Type of the view stored in this array. More... | |
| typedef T & | reference |
| Type of a reference to the value type. More... | |
| typedef const T & | const_reference |
| Type of a constant reference to the value type. More... | |
| typedef T * | pointer |
| Type of a pointer to the value type. More... | |
| typedef const T * | const_pointer |
| Type of a read-only pointer to the value type. More... | |
| typedef T * | iterator |
| Type of the iterator used to iterate through this array's elements. More... | |
| typedef const T * | const_iterator |
| Type of the iterator used to iterate read-only through this array's elements. More... | |
| typedef std::reverse_iterator< T * > | reverse_iterator |
| Type of the iterator used to iterate backwards through this array's elements. More... | |
| typedef std::reverse_iterator< const T * > | const_reverse_iterator |
| Type of the iterator used to iterate backwards and read-only through this array's elements. More... | |
Array iteration | |
| iterator | begin (void) |
| Return an iterator at the beginning of the array. More... | |
| const_iterator | begin (void) const |
| Return a read-only iterator at the beginning of the array. More... | |
| iterator | end (void) |
| Return an iterator past the end of the array. More... | |
| const_iterator | end (void) const |
| Return a read-only iterator past the end of the array. More... | |
| reverse_iterator | rbegin (void) |
| Return a reverse iterator at the end of the array. More... | |
| const_reverse_iterator | rbegin (void) const |
| Return a reverse and read-only iterator at the end of the array. More... | |
| reverse_iterator | rend (void) |
| Return a reverse iterator past the beginning of the array. More... | |
| const_reverse_iterator | rend (void) const |
| Return a reverse and read-only iterator past the beginning of the array. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Gecode::SharedHandle | |
| SharedHandle::Object * | object (void) const |
| Access to the shared object. More... | |
| void | object (SharedHandle::Object *n) |
| Modify shared object. More... | |
Shared array with arbitrary number of elements.
Sharing is implemented by reference counting: the same elements are shared among several objects.
Definition at line 58 of file shared-array.hpp.
| typedef T Gecode::SharedArray< T >::value_type |
Type of the view stored in this array.
Definition at line 96 of file shared-array.hpp.
| typedef T& Gecode::SharedArray< T >::reference |
Type of a reference to the value type.
Definition at line 98 of file shared-array.hpp.
| typedef const T& Gecode::SharedArray< T >::const_reference |
Type of a constant reference to the value type.
Definition at line 100 of file shared-array.hpp.
| typedef T* Gecode::SharedArray< T >::pointer |
Type of a pointer to the value type.
Definition at line 102 of file shared-array.hpp.
| typedef const T* Gecode::SharedArray< T >::const_pointer |
Type of a read-only pointer to the value type.
Definition at line 104 of file shared-array.hpp.
| typedef T* Gecode::SharedArray< T >::iterator |
Type of the iterator used to iterate through this array's elements.
Definition at line 106 of file shared-array.hpp.
| typedef const T* Gecode::SharedArray< T >::const_iterator |
Type of the iterator used to iterate read-only through this array's elements.
Definition at line 108 of file shared-array.hpp.
| typedef std::reverse_iterator<T*> Gecode::SharedArray< T >::reverse_iterator |
Type of the iterator used to iterate backwards through this array's elements.
Definition at line 110 of file shared-array.hpp.
| typedef std::reverse_iterator<const T*> Gecode::SharedArray< T >::const_reverse_iterator |
Type of the iterator used to iterate backwards and read-only through this array's elements.
Definition at line 112 of file shared-array.hpp.
|
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 255 of file shared-array.hpp.
|
inline |
Initialize as array with n elements.
Definition at line 259 of file shared-array.hpp.
|
inline |
Initialize from shared array a (share elements)
Definition at line 264 of file shared-array.hpp.
|
inline |
Initialize from argument array a.
Definition at line 290 of file shared-array.hpp.
|
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 269 of file shared-array.hpp.
|
inline |
Access element at position i.
Definition at line 276 of file shared-array.hpp.
|
inline |
Access element at position i.
Definition at line 283 of file shared-array.hpp.
|
inline |
Return number of elements.
Definition at line 298 of file shared-array.hpp.
|
inline |
Return an iterator at the beginning of the array.
Definition at line 305 of file shared-array.hpp.
|
inline |
Return a read-only iterator at the beginning of the array.
Definition at line 312 of file shared-array.hpp.
|
inline |
Return an iterator past the end of the array.
Definition at line 319 of file shared-array.hpp.
|
inline |
Return a read-only iterator past the end of the array.
Definition at line 326 of file shared-array.hpp.
|
inline |
Return a reverse iterator at the end of the array.
Definition at line 333 of file shared-array.hpp.
|
inline |
Return a reverse and read-only iterator at the end of the array.
Definition at line 340 of file shared-array.hpp.
|
inline |
Return a reverse iterator past the beginning of the array.
Definition at line 347 of file shared-array.hpp.
|
inline |
Return a reverse and read-only iterator past the beginning of the array.
Definition at line 354 of file shared-array.hpp.
|
related |
Print array elements enclosed in curly brackets.
Definition at line 361 of file shared-array.hpp.