Represent a future that may be notified by a specialized notifier. More...
#include <future.h>
Public Member Functions | |
Future (const Future &)=delete | |
Future & | operator= (Future const &)=delete |
Future (Future &&o)=delete | |
Future & | operator= (Future &&o)=delete |
virtual | ~Future () |
Virtual destructor. More... | |
virtual void | notify (ucs_status_t status)=0 |
Inform the notifier that the future has completed. More... | |
virtual void | set (ucs_status_t status)=0 |
Set the future completion status. More... | |
virtual void * | getHandle ()=0 |
Get the underlying handle but does not release ownership. More... | |
virtual void * | release ()=0 |
Get the underlying handle and release ownership. More... | |
Protected Member Functions | |
Future (std::shared_ptr< Notifier > notifier) | |
Construct a future that may be notified from a notifier object. More... | |
Protected Attributes | |
std::shared_ptr< Notifier > | _notifier {nullptr} |
The notifier object. | |
Represent a future that may be notified by a specialized notifier.
Represent a future object that may postpone notification of its status to a more appropriate stage by a specialize notifier, such as ucxx::Notifier
.
|
inlineexplicitprotected |
Construct a future that may be notified from a notifier object.
Construct a future that may be notified from a notifier object, usually running on a separate thread to decrease overhead from the application thread.
This class may also be used to set the result or exception from any thread.
[in] | notifier | notifier object, possibly running on a separate thread. |
|
inlinevirtual |
Virtual destructor.
Virtual destructor with empty implementation.
Reimplemented in ucxx::python::Future.
|
pure virtual |
Get the underlying handle but does not release ownership.
Get the underlying handle without releasing ownership. This can be useful for example for logging, where we want to see the address of the pointer but do not want to transfer ownership.
std::runtime_error | if the object is invalid or has been already released. |
Implemented in ucxx::python::Future.
|
pure virtual |
Inform the notifier that the future has completed.
Inform the notifier that the future has completed so it can notify associated resources of that occurrence.
std::runtime_error | if the object is invalid or has been already released. |
[in] | status | request completion status. |
Implemented in ucxx::python::Future.
|
pure virtual |
Get the underlying handle and release ownership.
Get the underlying handle releasing ownership. This should be used when the future needs to be permanently transferred to consumer code. After calling this method the object becomes invalid for any other uses.
std::runtime_error | if the object is invalid or has been already released. |
Implemented in ucxx::python::Future.
|
pure virtual |
Set the future completion status.
Set the future status as completed, either with a successful completion or error.
std::runtime_error | if the object is invalid or has been already released. |
[in] | status | request completion status. |
Implemented in ucxx::python::Future.