Inheritance diagram for MangoPtrPrivateNamespace::PtrUsageSharing:
For performance, the validator is not initialized to the validity state of the pointer it is tracking, until required, which typically is just before being copied the first time. This base class manages this complexity, and must be derived to be instantiated. The derived class will typically override the protected methods of PtrUsageSharing but call them implicitly. Implementation-wise, all this class does is make sure that before copying or assignment occur, that the validity object has been initialized with the validity state of the pointer.
Definition at line 47 of file PtrUsageSharing.hh.
|Set validity to false.|
|Reset to default state, ie. like from default constructor.|
|const MangoPtr::ValidityOwner &||usage () const|
|Get the validator. |
|PtrUsageSharing (const PtrUsageSharing &rhs)|
|void||operator= (const PtrUsageSharing &rhs)|
|void||swap (PtrUsageSharing &rhs)|
|Swap two objects of this type.|
|void||setFrom (void *optr)|
|Set the usage validity state based on optr. |
|bool||wasUsageInitialized () const|
|Has the usage validator been initialized.|
|the usage validator|
Get the validator.
Must not be called before the validator has had its validity state set at least once. This is done by calling a method from the derived class that calls setFrom().
Set the usage validity state based on optr.
The latter is used only when the validator has never been initialized. Otherwise, it is assumed that the usage validity is changed only with invalidateUsage(). This operator must be called at least once(by subclass) before copy/assign of PtrUsageSharing can be done.
Referenced by MangoPtr::ObjSharing< OShared >::operator()().