MADNESS
version 0.9
|
Reference wrapper class. More...
#include <ref.h>
Public Types | |
typedef T | type |
The reference type. More... | |
Public Member Functions | |
ReferenceWrapper () | |
Default constructor. More... | |
ReferenceWrapper (T &t) | |
Constructor. More... | |
T & | get () const |
Reference accessor. More... | |
operator T & () const | |
Type conversion operator. More... | |
T * | get_pointer () const |
Obect pointer accessor. More... | |
template<typename Archive > | |
void | serialize (const Archive &) |
Serialization. More... | |
Reference wrapper class.
Used to hold references for task functions where a copy would otherwise be used. This wrapper object is default constructable, copy constructable, assignable, and serializable, while a normal reference would not be. This object can also be used to pass arguments as a reference to a function that would otherwise be passed by value. Use the factory functions ref
and cref
to create ReferenceWrapper
objects.
T | The reference type |
typedef T madness::detail::ReferenceWrapper< T >::type |
The reference type.
|
inline |
Default constructor.
The reference references nothing
|
inlineexplicit |
Constructor.
t | The object to reference |
|
inline |
Reference accessor.
madness::MadnessException | Reference has not been set |
Referenced by madness::Future< detail::ReferenceWrapper< T > >::operator T &().
|
inline |
Obect pointer accessor.
nothing |
Referenced by madness::get_pointer().
|
inline |
Type conversion operator.
This has the same effect as get()
.
madness::MadnessException | Reference has not been set |
|
inline |
Serialization.
This function is here for compatibility with task functions. Since serializing a reference to a local object is inheirently wrong, this function simply throws an exception.
madness::MadnessException | Always |
References MADNESS_EXCEPTION.