#include <Refstorage.hh>
Collaboration diagram for RazorBack::Refstorage_:

Protected Methods | |
| Refstorage_ () | |
| default ctor, inits to empty. | |
| Refstorage_ (const T_ *Dp) | |
| Inits with a freshly created data object pointed to by Dp. More... | |
| Refstorage_ (const Refstorage_< T_ > &Rf) | |
| copy ctor, implements shallow copy. | |
| virtual | ~Refstorage_ () |
| destructor. | |
| Refstorage_<T_>& | operator= (const Refstorage_< T_ > &Rhs) |
| assignment. | |
| void | unlink_old () |
| unlink_old(): unlinks old storage (decr Refcount and delete if there are no more links). | |
| void | clone () |
| clone(): clones Storptr if it is referenced by at least another object. | |
| void | replace_storage (const T_ *Dp) |
| replace_storage(Dp): replaces old storage with new storage so that the data Dp will be stored. More... | |
| bool | empty () const |
| Returns true if there is no stored data. | |
| const T_& | data () const |
| data(): (Const) access to the stored data itself. More... | |
| T_& | data () |
| const T_* | ptr () const |
| ptr(): Returns a (const) pointer to the stored data. More... | |
| T_* | ptr () |
Private Attributes | |
| Storage_* | Storptr |
There are no public methods: this class is intended as a (protected) base class for other classes that have lots of data. The data objects should be contained in a separate class that will be substituted as T_.
Definition at line 32 of file Refstorage.hh.
|
||||
|
default ctor, inits to empty.
Definition at line 78 of file Refstorage.hh. |
|
||||
|
Inits with a freshly created data object pointed to by Dp. Since ownership is taken by Refstorage_, de-allocation will be performed by it. For this reason, the only wise invocation of this ctor is Refstorage_<T_>(new T_(params...)) Definition at line 87 of file Refstorage.hh. |
|
||||
|
copy ctor, implements shallow copy.
Definition at line 94 of file Refstorage.hh. |
|
||||
|
destructor.
Definition at line 101 of file Refstorage.hh. |
|
||||
|
assignment.
Definition at line 107 of file Refstorage.hh. |
|
||||
|
unlink_old(): unlinks old storage (decr Refcount and delete if there are no more links).
Definition at line 121 of file Refstorage.hh. Referenced by clone(), operator=(), replace_storage(), and ~Refstorage_(). |
|
||||
|
clone(): clones Storptr if it is referenced by at least another object.
Definition at line 128 of file Refstorage.hh. |
|
||||
|
replace_storage(Dp): replaces old storage with new storage so that the data Dp will be stored. The same rule applies for Dp as for the ctor with the same arg: Dp must point to a freshly created, dynamically allocated object of type T_. Definition at line 145 of file Refstorage.hh. |
|
||||
|
Returns true if there is no stored data.
Definition at line 153 of file Refstorage.hh. |
|
||||
|
data(): (Const) access to the stored data itself. Throws Emptyexc if the calling object was empty. Definition at line 159 of file Refstorage.hh. |
|
||||
|
Definition at line 165 of file Refstorage.hh. |
|
||||
|
ptr(): Returns a (const) pointer to the stored data. Returns NULL if the calling object was empty. Definition at line 176 of file Refstorage.hh. |
|
||||
|
Definition at line 177 of file Refstorage.hh. |
|
|||
|
Definition at line 72 of file Refstorage.hh. |
1.2.6 written by Dimitri van Heesch,
© 1997-2001