MADNESS 0.10.1
|
Base class for remote counter implementation objects. More...
#include <worldref.h>
Public Member Functions | |
RemoteCounterBase () | |
virtual | ~RemoteCounterBase () |
void | add_ref () |
Increment the reference count. | |
template<typename T > | |
const std::shared_ptr< T > & | get_shared () const |
Shared pointer accessor. | |
virtual void * | key () const =0 |
Counter key accessor. | |
bool | release () |
Decrement the reference count. | |
long | use_count () const |
Remote and local counter accessor. | |
Private Member Functions | |
RemoteCounterBase (const RemoteCounterBase &) | |
RemoteCounterBase & | operator= (const RemoteCounterBase &) |
Private Attributes | |
madness::AtomicInt | count_ |
reference count | |
Base class for remote counter implementation objects.
This class only holds an atomic counter. The use counter tracks local copies of the counter an references that have been copied as part of the communication process. This class also provides a mechanism for hiding the pointer type.
|
private |
|
inline |
References count_.
|
inlinevirtual |
|
inline |
Increment the reference count.
The reference count should be incremented when a local copy of the counter is created or the when the counter is serialized as part of communication.
nothing |
References c, count_, key(), and madness::print().
|
inline |
Shared pointer accessor.
T | The stored pointer type |
References get_shared().
Referenced by get_shared().
|
pure virtual |
Counter key accessor.
The key is the pointer for which the remote counter is counting references.
Implemented in madness::detail::RemoteCounterImpl< T >.
|
private |
|
inline |
Decrement the reference count.
nothing |
References c, count_, madness::AtomicInt::dec_and_test(), key(), and madness::print().
|
inline |
Remote and local counter accessor.
The use counter tracks local copies of the counter an references that have been copied as part othe communication process
References count_.
|
private |
reference count
Referenced by RemoteCounterBase(), add_ref(), release(), and use_count().