#include <task.hpp>
/*! Operations performed in highly heterogenous distributed environments may take a long time to complete, and it is thus desirable to have the ability to perform operations in an asynchronous manner. The SAGA task model provides this ability to all other SAGA classes.
Public Types | |
typedef task_base::state | state |
Brief description starts here. | |
Public Member Functions | |
task (saga::task_base::state t=saga::task_base::New) | |
Brief description starts here. | |
~task () | |
Destroys the object. | |
void | run (void) |
Starts the asynchronous operation. | |
void | cancel (void) |
Cancels the asynchronous operation. | |
bool | wait (double timeout=-1.0) |
Waits for the task to finish. | |
state | get_state (void) const |
Gets the state of the task. | |
void | rethrow () const |
Re-throws any exception a failed task caught. | |
saga::object | get_object () const |
Gets the object from which this task was created. | |
template<typename Retval> | |
Retval & | get_result () |
Gets the result of the asynchronous operation. | |
template<typename Retval> | |
Retval const & | get_result () const |
void | get_result () |
Synchronization for API functions with no return value only. | |
void | get_result () const |
Friends | |
SAGA_EXPORT bool | operator== (task const &lhs, task const &rhs) |
Brief description starts here. |
typedef task_base::state saga::task::state |
saga::task::task | ( | saga::task_base::state | t = saga::task_base::New |
) | [explicit] |
Brief description starts here.
saga::task::~task | ( | void | ) |
Destroys the object.
void saga::task::run | ( | void | ) |
void saga::task::cancel | ( | void | ) |
bool saga::task::wait | ( | double | timeout = -1.0 |
) |
Waits for the task to finish.
timeout | Second to wait |
Reimplemented in saga::job::job.
References saga::task_base::Failed, and get_state().
task::state saga::task::get_state | ( | void | ) | const |
void saga::task::rethrow | ( | ) | const |
saga::object saga::task::get_object | ( | ) | const |
SAGA_EXPORT void saga::task::get_result | ( | ) | [inline] |
Gets the result of the asynchronous operation.
Referenced by saga::cpr::checkpoint::add_file(), saga::cpr::job::cpr_list(), saga::cpr::checkpoint::get_file(), saga::name_space::directory::get_num_entries(), saga::detail::permissions< saga::job::job >::get_owner(), saga::name_space::directory::is_dir(), saga::cpr::checkpoint::list_files(), and saga::cpr::checkpoint::open_file().
SAGA_EXPORT void saga::task::get_result | ( | ) | const [inline] |
void saga::task::get_result | ( | ) |
Synchronization for API functions with no return value only.
void saga::task::get_result | ( | ) | const |
Brief description starts here.