
#include <rutz/arrays.h>
Collaboration diagram for rutz::shared_array< T >:

The array pointed to is deleted when the last shared_array pointing to it is destroyed or reset.
Definition at line 266 of file arrays.h.
Public Types | |
| typedef T | element_type |
| The pointed-to type. | |
Public Member Functions | |
| shared_array (T *p=0) | |
| Construct with the given array pointer. | |
| shared_array (const shared_array &r) throw () | |
| Copy constructor. | |
| ~shared_array () | |
| Destructor. | |
| shared_array & | operator= (const shared_array &r) |
| Assignment oeprator. | |
| void | reset (T *p=0) |
| Reset to point to a new array. | |
| T * | get () const throw () |
| Get a pointer to the pointed-to array. | |
| T & | operator[] (std::size_t i) const throw () |
| Index into the pointed-to array. | |
| long | use_count () const throw () |
| Get the reference count of the shared array. | |
| bool | unique () const throw () |
| Query whether the shared array is uniquely owned (i.e. refcount == 1). | |
| void | swap (shared_array< T > &other) throw () |
| Swap pointees with another shared_array. | |
|
|||||
|
The pointed-to type.
|
|
||||||||||
|
Construct with the given array pointer. Ownership is now unconditionally transferred to the shared_array. If the shared_array constructor causes an exception, the pointed-to array will be destroyed. Definition at line 276 of file arrays.h. References rutz::mutex_atomic_int::atomic_set(), and p. Referenced by rutz::shared_array< T >::operator=(), and rutz::shared_array< T >::reset(). |
|
||||||||||
|
Copy constructor.
Definition at line 283 of file arrays.h. References rutz::mutex_atomic_int::atomic_incr(). |
|
|||||||||
|
Destructor.
Definition at line 287 of file arrays.h. References rutz::mutex_atomic_int::atomic_decr_test_zero(). |
|
|||||||||
|
Get a pointer to the pointed-to array.
Definition at line 312 of file arrays.h. Referenced by rutz::operator!=(), and rutz::operator==(). |
|
||||||||||
|
Assignment oeprator.
Definition at line 297 of file arrays.h. References rutz::shared_array< T >::pn, and rutz::shared_array< T >::shared_array(). |
|
||||||||||
|
Index into the pointed-to array.
Definition at line 315 of file arrays.h. References i. |
|
||||||||||
|
Reset to point to a new array.
Definition at line 305 of file arrays.h. References p, and rutz::shared_array< T >::shared_array(). |
|
||||||||||
|
Swap pointees with another shared_array.
Definition at line 324 of file arrays.h. References rutz::swap2(). |
|
|||||||||
|
Query whether the shared array is uniquely owned (i.e. refcount == 1).
Definition at line 321 of file arrays.h. References rutz::shared_array< T >::use_count(). |
|
|||||||||
|
Get the reference count of the shared array.
Definition at line 318 of file arrays.h. References rutz::mutex_atomic_int::atomic_get(). Referenced by rutz::shared_array< T >::unique(). |
1.4.4