class stxxl::external_shared_ptr< P >
This class takes a shared pointer, increments its reference count and wraps it in a way that the resulting object can be copied, dumped to disk, and destroyed without affecting the refcount.
When the object is retrieved from disk and recreated on internal memory, it will still hold a reference to the same memory block and can be used right away by calling the "get" method or unwrapped with the "unwrap" method to decrement the refcount.
In the context of this template, a shared pointer is an object of a class P that fulfills the following requirements:
- Can be copy-constructed
- Has an assignment operator (so that the get method can be used)
- Contains a pointer to a reference count stored outside the class
- Increments the reference count on copy-construction
- Decrements the reference count on destruction
Both the Boost and c++0x implementations of shared_ptr fulfill these requirements. At the moment of writing the author is not aware of any implementations of shared pointers that can't be used with this wrapper.
Definition at line 46 of file external_shared_ptr.h.