#include <SharedData.h> [code]
Collaboration diagram for Utils::Memory::SharedDataPointer:

R1 Store a pointer to implicitly shared data. The pointer should automatically detach itself form the shared data and make a copy if the shared data is used in non-const context.
U1 You need a pointer to automatically manage reference counting for your SharedData derived class.
Declare a member of class SharedDataPointer in your base class and initize it with a pointer to a private object passed from the derived class. You don't need to implement copy ctor or assignment operator for your class.
Definition at line 100 of file SharedData.h.
Public Member Functions | |
| void | detach () |
| SharedData & | operator * () |
| const SharedData & | operator * () const |
| SharedData * | operator-> () |
| const SharedData * | operator-> () const |
| operator SharedData * () | |
| operator const SharedData * () const | |
| SharedData * | data () |
| const SharedData * | data () const |
| const SharedData * | constData () const |
| bool | operator== (const SharedDataPointer &other) const |
| bool | operator!= (const SharedDataPointer &other) const |
| SharedDataPointer () | |
| ~SharedDataPointer () | |
| SharedDataPointer (SharedData *data) | |
| SharedDataPointer (const SharedDataPointer &o) | |
| SharedDataPointer & | operator= (const SharedDataPointer &o) |
| SharedDataPointer & | operator= (SharedData *o) |
| bool | operator! () const |
Private Member Functions | |
| void | detach_helper () |
Private Attributes | |
| SharedData * | d |
|
|
Definition at line 117 of file SharedData.h. |
|
|
Definition at line 118 of file SharedData.h. |
|
|
Definition at line 151 of file SharedData.h. |
|
|
Definition at line 121 of file SharedData.h. |
|
|
Definition at line 112 of file SharedData.h. |
|
|
Definition at line 111 of file SharedData.h. |
|
|
Definition at line 110 of file SharedData.h. |
|
|
Definition at line 103 of file SharedData.h. |
|
|
Definition at line 154 of file SharedData.h. |
|
|
Definition at line 105 of file SharedData.h. |
|
|
Definition at line 104 of file SharedData.h. |
|
|
Definition at line 109 of file SharedData.h. |
|
|
Definition at line 108 of file SharedData.h. |
|
|
Definition at line 143 of file SharedData.h. |
|
|
Definition at line 115 of file SharedData.h. |
|
|
Definition at line 107 of file SharedData.h. |
|
|
Definition at line 106 of file SharedData.h. |
|
|
Definition at line 132 of file SharedData.h. |
|
|
Definition at line 122 of file SharedData.h. |
|
|
Definition at line 114 of file SharedData.h. |
|
|
Definition at line 148 of file SharedData.h. |