MADNESS 0.10.1
madness::Future< void > Class Reference

Specialization of Future<void> for internal convenience. This does nothing useful! More...

#include <future.h>

Collaboration diagram for madness::Future< void >:

Public Types

typedef RemoteReference< FutureImpl< void > > remote_refT

Public Member Functions

 Future ()
 Future (const archive::BufferInputArchive &input_arch)
 Construct from an input archive.
 Future (const RemoteReference< FutureImpl< void > > &remote_ref)
 ~Future ()
 Destructor.
void & get (bool dowork=true) &
 Gets the value, waiting if necessary.
bool is_default_initialized () const
 Check if the future is default initialized.
bool is_local () const
 Checks the future remoteness trait.
bool is_remote () const
 Checks the future remoteness trait.
 operator const void & () const &
 Same as get() const&.
 operator void () &&
 An rvalue analog of get().
 operator void & () &
 Same as get()&.
Future< void > & operator= (const Future< void > &other)
 Assignment operator.
void register_callback (CallbackInterface *callback)
 Registers an object to be called when future is assigned.

Static Public Member Functions

static const Future< void > default_initializer ()
 See "Gotchas" on Futures about why this exists and how to use it.
static bool probe ()
 Check if this future has been assigned.
static remote_refT remote_ref (World &world)
static void set ()
 Set the future.
static void set (const Future< void > &f)
 Set the future from another void future.

Static Public Attributes

static const Future< void > value

Private Attributes

char buffer [sizeof(void)]
 Buffer to hold a single T object.
atomic_shared_ptr< FutureImpl< void > > f
 Pointer to the implementation object.

Friends

std::ostream & operator<< (std::ostream &out, const Future< void > &f)
 Human readable printing of a Future to a stream.

Detailed Description

Specialization of Future<void> for internal convenience. This does nothing useful!

Member Typedef Documentation

◆ remote_refT

typedef RemoteReference< FutureImpl<void> > madness::Future< void >::remote_refT
Todo
Brief description needed.

Constructor & Destructor Documentation

◆ Future() [1/3]

madness::Future< void >::Future ( )
inline

Referenced by operator=(), and set().

◆ Future() [2/3]

madness::Future< void >::Future ( const RemoteReference< FutureImpl< void > > & remote_ref)
inline
Todo
Brief description needed.
Todo
Description needed.
Parameters
[in]remote_refDescription needed.

References remote_ref().

◆ Future() [3/3]

madness::Future< void >::Future ( const archive::BufferInputArchive & input_arch)
inline

Construct from an input archive.

Parameters
[in]input_archThe input archive.

◆ ~Future()

madness::Future< void >::~Future ( )
inline

Destructor.

Member Function Documentation

◆ default_initializer()

const Future< void > madness::Future< void >::default_initializer ( )
inlinestatic

See "Gotchas" on Futures about why this exists and how to use it.

Todo
Informative description needed.

◆ get()

void & madness::Future< void >::get ( bool dowork = true) &
inline

Gets the value, waiting if necessary.

Parameters
doworkIf true (default) and the future is not ready this thread will execute other tasks while waiting
Warning
PaRSEC backend does not support dowork=true from a callstack containing a running MADNESS task already, hence must use dowork=false when need to call from within a task
Returns
reference to the contained value
Precondition
this->is_local()

◆ is_default_initialized()

bool madness::Future< void >::is_default_initialized ( ) const
inline

Check if the future is default initialized.

Returns
True if this future was constructed with default_initializer(); false otherwise.

◆ is_local()

bool madness::Future< void >::is_local ( ) const
inline

Checks the future remoteness trait.

Returns
true if the future refers to an already available or to-be-locally-produced result

◆ is_remote()

bool madness::Future< void >::is_remote ( ) const
inline

Checks the future remoteness trait.

Returns
true if the future refers to another future on a another rank, i.e. it will be set when the referred-to future is set

◆ operator const void &()

madness::Future< void >::operator const void & ( ) const &
inline

Same as get() const&.

Returns
A const lvalue reference to the value.

◆ operator void()

madness::Future< void >::operator void ( ) &&
inline

An rvalue analog of get().

Returns
An rvalue reference to the value.

◆ operator void &()

madness::Future< void >::operator void& ( ) &
inline

Same as get()&.

Returns
An lvalue reference to the value.

◆ operator=()

Future< void > & madness::Future< void >::operator= ( const Future< void > & other)
inline

Assignment operator.

Parameters
[in]otherThe future to copy.
Returns
This.

References Future().

◆ probe()

bool madness::Future< void >::probe ( )
inlinestatic

Check if this future has been assigned.

Returns
True (in this specialization).

◆ register_callback()

void madness::Future< void >::register_callback ( CallbackInterface * callback)
inline

Registers an object to be called when future is assigned.

Callbacks are invoked in the order registered. If the future is already assigned, the callback is immediately invoked.

Parameters
[in]callbackThe callback to be invoked.

◆ remote_ref()

remote_refT madness::Future< void >::remote_ref ( World & world)
inlinestatic
Todo
Brief description needed.
Todo
Descriptions needed.
Parameters
[in,out]worldDescription needed.
Returns
Description needed.

Referenced by Future().

◆ set() [1/2]

void madness::Future< void >::set ( )
inlinestatic

Set the future.

In this specialization, do nothing.

◆ set() [2/2]

void madness::Future< void >::set ( const Future< void > & f)
inlinestatic

Set the future from another void future.

In this specialization, do nothing.

Parameters
[in]fThe other future.

References Future(), and f.

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const Future< void > & f )
friend

Human readable printing of a Future to a stream.

Stream output operator for a future.

Template Parameters
TThe type of future.
Parameters
[in,out]outThe output stream.
[in]fThe future.
Returns
The output stream.
Todo
Brief description needed.
Todo
Descriptions needed.
Template Parameters
TDescription needed.
Parameters
[in,out]Theoutput stream.
[in]fThe future to be output.
Returns
The output stream.

Member Data Documentation

◆ buffer

char madness::Future< void >::buffer[sizeof(void)]
private

Buffer to hold a single T object.

◆ f

atomic_shared_ptr< FutureImpl<void> > madness::Future< void >::f
private

Pointer to the implementation object.

Referenced by set().

◆ value


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