MADNESS
version 0.9
|
Simple structure used to manage references/pointers to remote instances. More...
#include <worldref.h>
Public Types | |
typedef detail::ptr_traits< T > ::reference | referenceT |
typedef T * | pointerT |
Public Member Functions | |
RemoteReference () | |
Makes a non-shared (no reference count) null pointer. More... | |
RemoteReference (World &w, const std::shared_ptr< T > &p) | |
Construct a remote reference to p. More... | |
RemoteReference (const RemoteReference< T > &other) | |
Copy constructor. More... | |
template<typename U > | |
RemoteReference (const RemoteReference< U > &other) | |
Copy conversion constructor. More... | |
~RemoteReference () | |
RemoteReference< T > & | operator= (const RemoteReference< T > &other) |
Copy conversion assignment operator. More... | |
template<typename U > | |
RemoteReference< T > & | operator= (const RemoteReference< U > &other) |
Copy conversion assignment operator. More... | |
void | reset () |
Release this reference. More... | |
operator bool () const | |
Boolean conversion operator. More... | |
pointerT | get () const |
Reference pointer accessor. More... | |
const std::shared_ptr< T > & | get_shared () const |
Reference shared_ptr accssor. More... | |
referenceT | operator* () const |
Reference object accessor. More... | |
pointerT | operator-> () const |
Reference object pointer accessor. More... | |
long | use_count () const |
Reference count accessor. More... | |
bool | unique () const |
Get uniqueness. More... | |
template<typename U > | |
void | swap (RemoteReference< U > &other) |
Swap references. More... | |
bool | is_local () const |
Locally owned reference. More... | |
ProcessID | owner () const |
Reference owner accessor. More... | |
World & | get_world () const |
Owning world accessor. More... | |
template<typename Archive > | |
void | serialize (const Archive &ar) const |
Serialize the remote reference. More... | |
Friends | |
template<typename > | |
class | RemoteReference |
std::ostream & | operator<< (std::ostream &out, const RemoteReference< T > &ref) |
Add the remote reference to the given std::ostream , out . More... | |
Simple structure used to manage references/pointers to remote instances.
This class was intended only for internal use and is still rather poorly thought through, however, it seems to fill a wider need.
typedef T* madness::RemoteReference< T >::pointerT |
typedef detail::ptr_traits<T>::reference madness::RemoteReference< T >::referenceT |
|
inline |
Makes a non-shared (no reference count) null pointer.
|
inline |
Construct a remote reference to p.
w | The world that p belongs to. |
p | The shared_ptr that is to be referenced. |
p
must be locally addressable pointer
|
inline |
Copy constructor.
other | The reference to be copied |
|
inline |
Copy conversion constructor.
U | The remote reference type to be copied |
other | The reference to be copied |
U*
must be implicitly convertible to T*
|
inline |
|
inline |
Reference pointer accessor.
MadnessException | If the pointer is not local |
|
inline |
Reference shared_ptr accssor.
MadnessException | If the pointer is not local |
|
inline |
Owning world accessor.
MadnessException | If the reference is uninitialized |
Referenced by madness::RemoteReference< FutureImpl< REMFUTURE(MEMFUN_RETURNT(memfunT)) > >::reset(), and madness::FutureImpl< bool >::set().
|
inline |
Locally owned reference.
nothing |
|
inline |
Boolean conversion operator.
|
inline |
Reference object accessor.
MadnessException | If the pointer is uninitialized |
MadnessException | If the pointer is not local |
|
inline |
Reference object pointer accessor.
MadnessException | If the pointer is uninitialized |
MadnessException | If the pointer is not local |
|
inline |
Copy conversion assignment operator.
other | The reference to be copied |
|
inline |
Copy conversion assignment operator.
U | The remote reference type to be copied |
other | The reference to be copied |
U*
must be implicitly convertible to T*
|
inline |
Reference owner accessor.
nothing |
Referenced by madness::RemoteReference< FutureImpl< REMFUTURE(MEMFUN_RETURNT(memfunT)) > >::reset(), and madness::FutureImpl< bool >::set().
|
inline |
Release this reference.
This function will clear the reference and leave it in the default constructed state. If the reference is non-local, then a message is sent to the reference owner that releases the reference.
|
inline |
Serialize the remote reference.
Archive | The serialization archive type |
ar | The serialization archive object. |
|
inline |
Swap references.
Exchange the value of this RemoteReference
with other
RemoteReference
U | The type of the other remote reference. |
Referenced by madness::RemoteReference< FutureImpl< REMFUTURE(MEMFUN_RETURNT(memfunT)) > >::operator=(), and madness::RemoteReference< FutureImpl< REMFUTURE(MEMFUN_RETURNT(memfunT)) > >::reset().
|
inline |
Get uniqueness.
nothing |
|
inline |
Reference count accessor.
nothing |
|
friend |
Add the remote reference to the given std::ostream
, out
.
out | The output stream to add ref to. |
ref | The remote reference to add to the out stream |