Rosetta
|
#include <task.h>
Classes | |
struct | Job |
Public Types | |
enum class | State { none , draft , queued , running , finished , canceled , unknown } |
using | JobSP = std::shared_ptr< Job > |
Public Slots | |
void | rename_input_file (QString const &previous_value, QString const &new_value) |
Signals | |
void | submitted () |
void | changed () |
void | name_changed () |
void | state_changed () |
void | file_list_changed () |
void | file_changed (FileID const &) |
void | syncing () |
Emitted when node or sub-node syncing state changed. More... | |
void | final () |
Emitted once when Task is fully downloaded and no further network operations will be issued. More... | |
Public Member Functions | |
Task () | |
~Task () | |
TaskSP | clone () const |
create clone of Task containing only input files More... | |
State | state () const |
QString | queue () const |
bool | is_syncing () const |
std::pair< int, int > | syncing_progress () const |
QAbstractTableModel * | files_model () |
Project * | project () const |
JobSP | add_job () |
add a new job at the end of jobs queue and return poiinter to it More... | |
std::vector< JobSP > const & | jobs () const |
return jobs vector More... | |
void | delete_job (JobSP const &job) |
delete given job More... | |
bool | rename_job (JobSP const &, QString const &name) |
try to rename job, return true on success More... | |
void | swap_jobs (int i, int j) |
swap jobs of given indexes More... | |
void | add_file (FileSP const &file) |
add file to Task files collection More... | |
Files const & | files () const |
Files::const_iterator | files_find (FileID const &f) |
temporary until C++14 More... | |
bool | delete_file (File::Kind kind, QString const &name) |
delete file from task, return true if file was in task files More... | |
void | submit (QString const &queue) |
Initiate submit procedure. More... | |
QString | task_id () const |
return QString representation of task_id (int) if task was already submitted other wise return empty string More... | |
QString | name () const |
void | name (QString const &) |
QString | version () const |
void | version (QString const &) |
QString | description () const |
void | description (QString const &) |
void | subscribe () |
subscribe to network update stream More... | |
Static Public Member Functions | |
static QString | to_string (Task::State state) |
static Task::State | from_string (QString const &s) |
Private Member Functions | |
QJsonValue | task_data () |
connect nodes and Task structre, assign callback's More... | |
void | task_data (QJsonValue const &) |
void | syncing_progress (int value, int max) |
void | syncing_progress_advance (int value) |
Private Attributes | |
State | state_ = State::none |
QString | queue_ |
QString | version_ |
QString | name_ |
QString | description_ |
QVariant | task_id_ |
std::vector< JobSP > | jobs_ |
Files | files_ |
FileTableModel | files_model_ |
TaskSyncer_TaskStrategy | syncer_ |
QPointer< Project > | project_ |
root node of network syncing tree More... | |
std::pair< int, int > | syncing_progress_ = {0, 0} |
Friends | |
class | TaskSyncer_NodeStrategy |
class | TaskSyncer_TaskStrategy |
class | TaskCancelDialog |
QDataStream & | operator<< (QDataStream &, Task const &) |
QDataStream & | operator>> (QDataStream &, Task &) |
void | Project::add_task (TaskSP const &task) |
Some project functions require access to project_. More... | |
bool | Project::erase (TaskSP const &task) |
void | Project::assign_ownership (TaskSP const &t) |
using ui::task::Task::JobSP = std::shared_ptr<Job> |
|
strong |
|
explicit |
References files_model_, rename_input_file(), and version_.
ui::task::Task::~Task | ( | ) |
void ui::task::Task::add_file | ( | FileSP const & | file | ) |
add file to Task files collection
References evaluate_beta_mutants::file, files_, files_model_, and ui::task::FileTableModel::update_from_task().
Task::JobSP ui::task::Task::add_job | ( | ) |
add a new job at the end of jobs queue and return poiinter to it
References bin_torsions::job, jobs_, name(), and rename_job().
|
signal |
TaskSP ui::task::Task::clone | ( | ) | const |
create clone of Task containing only input
files
References description_, create_a3b_hbs::f, files_, gaussian-sampling::input, create_a3b_hbs::j, jobs_, name_, vancomycin::task, and version_.
bool ui::task::Task::delete_file | ( | File::Kind | kind, |
QString const & | name | ||
) |
delete file from task, return true if file was in task files
References files_, files_find(), files_model_, name(), and ui::task::FileTableModel::update_from_task().
Referenced by ui::task::TaskSyncer_NodeStrategy::files_topology_updated().
void ui::task::Task::delete_job | ( | JobSP const & | job | ) |
delete given job
References bin_torsions::job, jobs_, and erraser_util::remove().
|
inline |
References description_.
Referenced by task_data().
void ui::task::Task::description | ( | QString const & | d | ) |
References changed(), and description_.
|
signal |
Referenced by ui::task::TaskView::TaskView().
|
signal |
Referenced by ui::task::TaskView::TaskView().
Files::const_iterator ui::task::Task::files_find | ( | FileID const & | f | ) |
temporary until C++14
References create_a3b_hbs::f, and files_.
Referenced by delete_file(), and rename_input_file().
|
inline |
References files_model_.
|
signal |
Emitted once when Task is fully downloaded and no further network operations will be issued.
|
static |
References ui::task::_String_to_Task_State_, docking::s, and unknown.
Referenced by task_data().
bool ui::task::Task::is_syncing | ( | ) | const |
References syncing_progress_.
|
inline |
return jobs vector
References jobs_.
Referenced by job_manager.AppWindow::on_hotkey(), and task_data().
|
inline |
References name_.
Referenced by pyrosetta.distributed.docs.ComponentDoc::__repr__(), add_job(), delete_file(), options_class.Option::getCName(), options_class.Option::getDoxygenRow(), options_class.Option::getMarkdownRow(), options_class.Option::getOptionKeysCC(), options_class.Option::getWikiTableRow(), enumerate_junctions.DHR::print(), rename_job(), task_data(), ui::task::TaskSyncer_TaskStrategy::task_data_upload(), enumerate_junctions.DHR::to_component(), and enumerate_junctions.DHR::write_to_file().
void ui::task::Task::name | ( | QString const & | n | ) |
References changed(), kmeans_adaptive_kernel_density_bb_dependent_rotlib::n, name_, and name_changed().
Referenced by pyrosetta.distributed.docs.ComponentDoc::__repr__(), options_class.Option::getCName(), options_class.Option::getDoxygenRow(), options_class.Option::getMarkdownRow(), options_class.Option::getOptionKeysCC(), options_class.Option::getWikiTableRow(), enumerate_junctions.DHR::print(), enumerate_junctions.DHR::to_component(), and enumerate_junctions.DHR::write_to_file().
|
signal |
Referenced by ui::task::Project::assign_ownership(), name(), and task_data().
|
inline |
References queue_.
Referenced by submit(), and task_data().
|
slot |
References evaluate_beta_mutants::file, files_, files_find(), files_model_, gaussian-sampling::input, and ui::task::FileTableModel::update_from_task().
Referenced by Task().
bool ui::task::Task::rename_job | ( | JobSP const & | job, |
QString const & | name | ||
) |
try to rename job, return true on success
References create_a3b_hbs::j, bin_torsions::job, jobs_, and name().
Referenced by add_job().
|
inline |
References state_.
Referenced by task_data(), and to_string().
|
signal |
void ui::task::Task::submit | ( | QString const & | queue | ) |
Initiate submit procedure.
References queue(), ui::task::TaskSyncer_TaskStrategy::submit(), and syncer_.
|
signal |
Referenced by ui::task::TaskSyncer_NodeStrategy::post_submit().
void ui::task::Task::subscribe | ( | ) |
subscribe to network update stream
References ui::task::TaskSyncer_TaskStrategy::subscribe(), and syncer_.
void ui::task::Task::swap_jobs | ( | int | i, |
int | j | ||
) |
swap jobs of given indexes
References create_a3b_hbs::i, create_a3b_hbs::j, jobs_, and swap().
|
signal |
Emitted when node or sub-node syncing state changed.
Referenced by syncing_progress(), and ui::task::TaskView::TaskView().
std::pair< int, int > ui::task::Task::syncing_progress | ( | ) | const |
References syncing_progress_.
Referenced by syncing_progress(), and syncing_progress_advance().
|
private |
References max(), syncing(), syncing_progress(), syncing_progress_, and value.
|
private |
References syncing_progress(), syncing_progress_, and value.
|
private |
connect nodes and Task structre, assign callback's
References description_, create_a3b_hbs::j, bin_torsions::job, jobs(), jobs_, name_, queue_, create_a3b_hbs::r, state_, to_string(), and version_.
|
private |
QString ui::task::Task::task_id | ( | ) | const |
return QString representation of task_id (int) if task was already submitted other wise return empty string
return task UUID if task was already submitted other wise return NULL UUID
References task_id_.
Referenced by ui::task::TaskSyncer_NodeStrategy::draft_to_queued(), ui::task::TaskSyncer_NodeStrategy::post_submit(), ui::task::TaskSyncer_NodeStrategy::submit(), ui::task::TaskSyncer_TaskStrategy::submit(), ui::task::TaskSyncer_NodeStrategy::subscribe(), and task_data().
|
static |
References ui::task::_String_to_Task_State_, and state().
Referenced by task_data(), ui::task::ProjectTasksModel::update_from_tasks(), and ui::task::TaskView::update_ui_from_task().
|
inline |
References version_.
Referenced by pyrosetta.EnergyMethod::__call__(), and task_data().
void ui::task::Task::version | ( | QString const & | v | ) |
References changed(), kmeans_adaptive_kernel_density_bb_dependent_rotlib::v, and version_.
Referenced by pyrosetta.EnergyMethod::__call__().
|
friend |
|
friend |
|
friend |
Some project functions require access to project_.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
Referenced by clone(), description(), and task_data().
|
private |
|
private |
|
private |
Referenced by add_job(), clone(), delete_job(), jobs(), rename_job(), swap_jobs(), and task_data().
|
private |
|
private |
root node of network syncing tree
Referenced by ui::task::TaskSyncer_NodeStrategy::draft_to_queued(), and project().
|
private |
|
private |
|
private |
Referenced by submit(), and subscribe().
|
private |
Referenced by is_syncing(), syncing_progress(), and syncing_progress_advance().
|
private |
Referenced by task_data(), and task_id().
|
private |
Referenced by clone(), Task(), task_data(), and version().