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.
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 |
Reimplemented from saga::object.
saga::task::task | ( | ) |
saga::task::task | ( | saga::task_base::state | t | ) | [explicit] |
Brief description starts here.
saga::task::~task | ( | void | ) |
Destroys the object.
void saga::task::run | ( | void | ) |
Starts the asynchronous operation.
Reimplemented in saga::job::job.
void saga::task::cancel | ( | void | ) |
Cancels the asynchronous operation.
timeout | Time for freeing resources. |
bool saga::task::wait | ( | double | timeout = -1.0 |
) |
Waits for the task to finish.
timeout | Second to wait |
Reimplemented in saga::job::job.
task::state saga::task::get_state | ( | void | ) |
Gets the state of the task.
Reimplemented in saga::job::job.
Referenced by get_result(), and rethrow().
void saga::task::rethrow | ( | ) |
Re-throws any exception a failed task caught.
References saga::task_base::Failed, and get_state().
saga::object saga::task::get_object | ( | ) | const |
Gets the object from which this task was created.
void saga::task::get_result | ( | ) | [inline] |
Gets the result of the asynchronous operation.
References saga::task_base::Failed, and get_state().
Referenced by saga::cpr::directory::add_file(), saga::cpr::checkpoint::add_file(), 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::cpr::job::cpr_last(), saga::cpr::job::cpr_list(), saga::job::service::create_job(), saga::cpr::service::create_job(), saga::name_space::directory::exists(), saga::name_space::directory::find(), saga::replica::logical_directory::find(), saga::cpr::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::cpr::directory::get_file(), saga::cpr::checkpoint::get_file(), saga::cpr::directory::get_file_num(), 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::cpr::directory::get_parent(), saga::cpr::checkpoint::get_parent(), 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::cpr::directory::is_checkpoint(), 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::cpr::directory::list_files(), saga::cpr::checkpoint::list_files(), 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::cpr::directory::open(), saga::advert::directory::open(), saga::name_space::directory::open_dir(), saga::replica::logical_directory::open_dir(), saga::filesystem::directory::open_dir(), saga::cpr::directory::open_dir(), saga::advert::directory::open_dir(), saga::cpr::directory::open_file(), saga::cpr::checkpoint::open_file(), 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::cpr::directory::remove_file(), saga::cpr::checkpoint::remove_file(), 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::cpr::service::run_job(), saga::filesystem::file::seek(), saga::stream::server::serve(), saga::cpr::checkpoint::set_parent(), saga::job::job::signal(), saga::filesystem::file::size_e(), saga::filesystem::file::size_p(), saga::cpr::directory::stage_file(), saga::cpr::checkpoint::stage_file(), saga::advert::entry::store_object(), saga::advert::entry::store_string(), saga::job::job::suspend(), saga::url::translate(), saga::cpr::directory::update_file(), saga::cpr::checkpoint::update_file(), 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 [inline] |
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 |