MADNESS 0.10.1
madness::detail::RemoteCounterImpl< T > Class Template Reference

Remote counter implementation object. More...

#include <worldref.h>

Inheritance diagram for madness::detail::RemoteCounterImpl< T >:
Collaboration diagram for madness::detail::RemoteCounterImpl< T >:

Public Member Functions

 RemoteCounterImpl (const std::shared_ptr< T > &p)
virtual ~RemoteCounterImpl ()
const std::shared_ptr< T > & get_shared () const
 Shared pointer accessor.
virtual void * key () const
 Counter key accessor.
Public Member Functions inherited from madness::detail::RemoteCounterBase
 RemoteCounterBase ()
virtual ~RemoteCounterBase ()
void add_ref ()
 Increment the reference count.
template<typename T>
const std::shared_ptr< T > & get_shared () const
 Shared pointer accessor.
bool release ()
 Decrement the reference count.
long use_count () const
 Remote and local counter accessor.

Private Attributes

std::shared_ptr< T > pointer_
 pointer that is remotely referenced

Detailed Description

template<typename T>
class madness::detail::RemoteCounterImpl< T >

Remote counter implementation object.

This class stores a shared pointer in memory to ensure that the referenced object is valid as long as there are outstanding remote references.

Template Parameters
TThe type of the referenced shared_ptr object.
Note
This class is considered an implementation detail and may change at any time. You should not use this class directly.

Constructor & Destructor Documentation

◆ RemoteCounterImpl()

template<typename T>
madness::detail::RemoteCounterImpl< T >::RemoteCounterImpl ( const std::shared_ptr< T > & p)
inlineexplicit

◆ ~RemoteCounterImpl()

template<typename T>
virtual madness::detail::RemoteCounterImpl< T >::~RemoteCounterImpl ( )
inlinevirtual

Member Function Documentation

◆ get_shared()

template<typename T>
const std::shared_ptr< T > & madness::detail::RemoteCounterImpl< T >::get_shared ( ) const
inline

Shared pointer accessor.

Returns
A const reference to the stored shared pointer

References pointer_.

◆ key()

template<typename T>
virtual void * madness::detail::RemoteCounterImpl< T >::key ( ) const
inlinevirtual

Counter key accessor.

The key is the pointer for which the remote counter is counting references.

Returns
The pointer that is being counted.

Implements madness::detail::RemoteCounterBase.

References pointer_.

Member Data Documentation

◆ pointer_

template<typename T>
std::shared_ptr<T> madness::detail::RemoteCounterImpl< T >::pointer_
private

pointer that is remotely referenced

Referenced by RemoteCounterImpl(), get_shared(), and key().


The documentation for this class was generated from the following file: