Shared pointer representation object used by SharedObjectPool.
Synopsis
Declared in <bdlcc_sharedobjectpool.h>
template<
class TYPE,
class RESETTER>
class SharedObjectPool_Rep
: public bslma::SharedPtrRep
Base Classes
Name |
Description |
This class provides a partially implemented shared pointer representation ("letter") protocol. The class provides two counters for storing the number of shared and weak references, and functions to increment and decrement these counters. In addition, this class provides protocol methods that allow concrete implementations to specify what action should be taken when these counts reach zero. The function |
Member Functions
Name |
Description |
|
Construct a new rep object that, upon release, will invoke the specified |
|
Destroy this representation object and the embedded instance of |
Atomically acquire a shared reference to the shared object referred to by this representation. The behavior is undefined unless |
|
Atomically acquire a weak reference to the shared object referred to by this representation. The behavior is undefined unless |
|
|
Release the object being managed by this representation. This method is invoked when the number of strong references reaches zero. Note that if there are any weak references to the shared object then this function does nothing, including not destroying the object or returning it to the pool. |
|
Release this representation object. This method is invoked when the number of weak references and the number of strong references reach zero. This virtual override will return the object, and this representation, to the associated pool. |
|
Return NULL. Shared object pools strictly control the delete policy for their objects, and do not expose it to end users. |
Return |
|
Atomically increment the number of shared references to the shared object referred to by this representation by the optionally specified |
|
Return a "snapshot" of the current number of shared references to the shared object referred to by this representation object. |
|
Return a "snapshot" of the current number of weak references to the shared object referred to by this representation object. |
|
|
Return (untyped) address of the object managed by this representation. This virtual override effectively returns "(void*)ptr()". |
Return a pointer to the in‐place object. |
|
Atomically release a shared reference to the shared object referred to by this representation, disposing of the shared object if all the shared references to that object are released, and disposing of this representation if all (shared and weak) references to that object are released. The behavior is undefined unless |
|
Atomically release a weak reference to the shared object referred to by this representation, disposing of this representation if all (shared and weak) references to the shared object are released. The behavior is undefined unless |
|
Invoke the object resetter specified at construction on the associated object. |
|
Reset the number of shared references and the number of weak references stored by this representation to the specified |
|
Atomically acquire a shared reference to the shared object referred to by this representation, if the number of shared references is greater than 0, and do nothing otherwise. Return |
Static Member Functions
Name |
Description |
Release the shared reference to an object held by the |
|
This function has no effect. The behavior is undefined unless |
Created with MrDocs