Brief description starts here. More...
#include <task.hpp>
Public Types | |
typedef task_base::state | state |
Brief description starts here. | |
typedef task_base::Sync | Sync |
typedef task_base::Async | Async |
typedef task_base::Task | Task |
Public Member Functions | |
task () | |
task (saga::task_base::state t) | |
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 () |
Gets the state of the task. | |
void | rethrow () |
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 | |
bool | operator== (task const &lhs, task const &rhs) |
Brief description starts here. | |
bool | operator< (task const &lhs, task const &rhs) |
Brief description starts here. |
Brief description starts here.
/*! Operations performed in highly heterogeneous 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.
Definition at line 51 of file task.hpp.
typedef task_base::state saga::task::state |
Brief description starts here.
Reimplemented from saga::task_base.
typedef task_base::Sync saga::task::Sync |
typedef task_base::Async saga::task::Async |
typedef task_base::Task saga::task::Task |
saga::task::task | ( | saga::task_base::state | t | ) | [explicit] |
void saga::task::run | ( | void | ) |
void saga::task::cancel | ( | void | ) |
bool saga::task::wait | ( | double | timeout = -1.0 |
) |
task::state saga::task::get_state | ( | void | ) |
Gets the state of the task.
Definition at line 122 of file task.cpp.
Referenced by get_result(), and rethrow().
void saga::task::rethrow | ( | ) |
Re-throws any exception a failed task caught.
Definition at line 134 of file task.cpp.
References saga::task_base::Failed, and get_state().
saga::object saga::task::get_object | ( | ) | const |
void saga::task::get_result | ( | ) |
Gets the result of the asynchronous operation.
Definition at line 227 of file task.cpp.
References saga::task_base::Failed, and get_state().
Referenced by saga::replica::logical_file::add_location(), saga::rpc::rpc::call(), saga::job::job::cancel(), saga::name_space::directory::change_dir(), saga::job::job::checkpoint(), saga::stream::server::close(), saga::stream::stream::close(), saga::rpc::rpc::close(), saga::name_space::entry::close(), saga::stream::server::connect(), saga::stream::stream::connect(), saga::name_space::entry::copy(), saga::name_space::directory::copy(), saga::job::service::create_job(), saga::name_space::directory::exists(), saga::name_space::directory::find(), saga::replica::logical_directory::find(), saga::advert::directory::find(), saga::stream::stream::get_context(), saga::name_space::entry::get_cwd(), saga::job::job::get_description(), saga::name_space::directory::get_entry(), saga::detail::permissions< permissions >::get_group(), saga::job::service::get_job(), saga::job::job::get_job_id(), saga::name_space::entry::get_name(), saga::name_space::directory::get_num_entries(), saga::detail::permissions< permissions >::get_owner(), saga::job::service::get_self(), saga::filesystem::file::get_size(), saga::filesystem::directory::get_size(), saga::job::job::get_state(), saga::job::job::get_stderr(), saga::job::job::get_stdin(), saga::job::job::get_stdout(), saga::stream::server::get_url(), saga::stream::stream::get_url(), saga::name_space::entry::get_url(), saga::job::service::get_url(), saga::name_space::entry::is_dir(), saga::name_space::directory::is_dir(), saga::name_space::entry::is_entry(), saga::name_space::directory::is_entry(), saga::replica::logical_directory::is_file(), saga::filesystem::directory::is_file(), saga::name_space::entry::is_link(), saga::name_space::directory::is_link(), saga::name_space::entry::link(), saga::name_space::directory::link(), saga::name_space::directory::list(), saga::job::service::list(), saga::replica::logical_file::list_locations(), saga::sd::discoverer::list_services(), saga::name_space::directory::make_dir(), saga::job::job::migrate(), saga::filesystem::file::modes_e(), saga::name_space::entry::move(), saga::name_space::directory::move(), saga::name_space::directory::open(), saga::replica::logical_directory::open(), saga::filesystem::directory::open(), saga::advert::directory::open(), saga::name_space::directory::open_dir(), saga::replica::logical_directory::open_dir(), saga::filesystem::directory::open_dir(), saga::advert::directory::open_dir(), saga::name_space::entry::permissions_allow(), saga::name_space::directory::permissions_allow(), saga::detail::permissions< permissions >::permissions_check(), saga::name_space::entry::permissions_deny(), saga::name_space::directory::permissions_deny(), saga::stream::stream::read(), saga::filesystem::file::read(), saga::filesystem::file::read_e(), saga::name_space::entry::read_link(), saga::name_space::directory::read_link(), saga::filesystem::file::read_p(), saga::filesystem::file::read_v(), saga::name_space::entry::remove(), saga::name_space::directory::remove(), saga::replica::logical_file::remove_location(), saga::replica::logical_file::replicate(), saga::job::job::resume(), saga::advert::entry::retrieve_object(), saga::advert::entry::retrieve_string(), saga::job::job::run(), saga::job::service::run_job(), saga::filesystem::file::seek(), saga::stream::server::serve(), saga::job::job::signal(), saga::filesystem::file::size_e(), saga::filesystem::file::size_p(), saga::advert::entry::store_object(), saga::advert::entry::store_string(), saga::job::job::suspend(), saga::url::translate(), saga::replica::logical_file::update_location(), saga::stream::stream::wait(), saga::job::job::wait(), saga::stream::stream::write(), saga::filesystem::file::write(), saga::filesystem::file::write_e(), saga::filesystem::file::write_p(), and saga::filesystem::file::write_v().
void saga::task::get_result | ( | ) | const |
Definition at line 236 of file task.cpp.
References saga::task_base::Failed, and get_state().
void saga::task::get_result | ( | ) |
Synchronization for API functions with no return value only.
void saga::task::get_result | ( | ) | const |