#include <SharedData.h> [code]
Inherited by Protocols::Generics::PacketBase::Data, and Protocols::Http::HeaderBase::Data.
Inheritance diagram for Utils::Memory::SharedData:

R1 Easily add support for implicit sharing of the private data. Allow polimorphic classes, the private classes of which are polimorphic as well to readily use implicit sharing. Use QSharedData if you want to share non-polymorphic data types.
U1 You are designing a class hierarchy and want the base class to take care of implicit sharing of the private data by means of reference counting. The derived classes should be allowed to extend the private data class by adding new fields.
Simply derive your private data class from SharedMemory and declare a SharedDataPointer member in your class. The private data class of the derived classes must override the virtual function copy() otherwise when the private data is detached an incomplete copy will be created and the software will hopefully crash before doing any damage to data.
Definition at line 71 of file SharedData.h.
Public Member Functions | |
| SharedData () | |
| SharedData (const SharedData &) | |
| virtual SharedData * | copy () const =0 |
| virtual | ~SharedData () |
Public Attributes | |
| QAtomic | ref |
Private Member Functions | |
| SharedData & | operator= (const SharedData &) |
|
|
Definition at line 76 of file SharedData.h. |
|
|
Definition at line 77 of file SharedData.h. |
|
|
Definition at line 79 of file SharedData.h. |
|
|
|
|
|
|
|
|
Definition at line 74 of file SharedData.h. |