MADNESS  version 0.9
Public Member Functions | Friends | List of all members
madness::detail::RemoteCounter Class Reference

Remote reference counter. More...

#include <worldref.h>

Public Member Functions

 RemoteCounter ()
 
 RemoteCounter (const RemoteCounter &other)
 
template<typename T >
 RemoteCounter (World &w, const std::shared_ptr< T > &p)
 
 ~RemoteCounter ()
 
RemoteCounteroperator= (const RemoteCounter &other)
 
long use_count () const
 Counter accessor. More...
 
bool unique () const
 
bool empty () const
 
bool is_local () const
 
bool has_owner () const
 
ProcessID owner () const
 
template<typename T >
const std::shared_ptr< T > & get_shared () const
 
WorldPtr< implT >::worldidT get_worldid () const
 
Worldget_world () const
 
void swap (RemoteCounter &other)
 

Friends

template<typename , typename >
struct archive::ArchiveLoadImpl
 
template<typename , typename >
struct archive::ArchiveStoreImpl
 

Detailed Description

Remote reference counter.

Automatically counts local and remote references to an object. The reference count is incremented when the object is copied locally or serialized as part of communication.

Constructor & Destructor Documentation

madness::detail::RemoteCounter::RemoteCounter ( )
inline
madness::detail::RemoteCounter::RemoteCounter ( const RemoteCounter other)
inline
template<typename T >
madness::detail::RemoteCounter::RemoteCounter ( World w,
const std::shared_ptr< T > &  p 
)
inlineexplicit
madness::detail::RemoteCounter::~RemoteCounter ( )
inline

Member Function Documentation

bool madness::detail::RemoteCounter::empty ( ) const
inline
template<typename T >
const std::shared_ptr<T>& madness::detail::RemoteCounter::get_shared ( ) const
inline
World& madness::detail::RemoteCounter::get_world ( ) const
inline
WorldPtr<implT>::worldidT madness::detail::RemoteCounter::get_worldid ( ) const
inline
bool madness::detail::RemoteCounter::has_owner ( ) const
inline
bool madness::detail::RemoteCounter::is_local ( ) const
inline
RemoteCounter& madness::detail::RemoteCounter::operator= ( const RemoteCounter other)
inline
ProcessID madness::detail::RemoteCounter::owner ( ) const
inline
void madness::detail::RemoteCounter::swap ( RemoteCounter other)
inline
bool madness::detail::RemoteCounter::unique ( ) const
inline
long madness::detail::RemoteCounter::use_count ( ) const
inline

Counter accessor.

Returns
The number of local and remote references
Exceptions
none

References madness::detail::WorldPtr< T >::is_local().

Referenced by madness::detail::operator<<(), unique(), and madness::RemoteReference< FutureImpl< REMFUTURE(MEMFUN_RETURNT(memfunT)) > >::use_count().

Friends And Related Function Documentation

template<typename , typename >
friend struct archive::ArchiveLoadImpl
friend
template<typename , typename >
friend struct archive::ArchiveStoreImpl
friend

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