Rosetta
|
#include <functor.h>
Public Types | |
enum class | State { _none_ , _running_ , _finished_ } |
Public Slots | |
void | finish () |
change state to finished More... | |
Signals | |
void | started () |
indicate start of this Functor, emitted only once More... | |
void | tick () |
Might be emitted periodically if Functor have loops. At least one tick() event is guaranteed to happened between start and finish. More... | |
void | finished () |
indicate end of this Functor execution, emitted only once More... | |
void | final () |
last emitted singal, before Functor consider fully done, emitted only once More... | |
Public Member Functions | |
Functor (QString const &name, QObject *parent=Q_NULLPTR) | |
State | state () const |
return current state More... | |
bool | is_running () const |
return true if Functor is now executing More... | |
bool | is_finished () const |
return true if Functor is finished More... | |
QString | name () const |
void | execute () |
virtual std::pair< int, int > | progress () const |
Protected Member Functions | |
void | state (State state) |
Private Slots | |
virtual void | run () |
Private Attributes | |
QString | name_ |
State | state_ = State::_none_ |
Something that could be executed and emit done
on completion
|
strong |
|
inline |
void ui::task::Functor::execute | ( | ) |
References _running_, name(), run(), and state().
Referenced by ui::task::FunctorSequence::run().
|
signal |
last emitted singal, before Functor consider fully done, emitted only once
Referenced by ui::task::FunctorSequence::run(), ui::task::FunctorASyncSequence::run(), FunctorTest::test_basic(), FunctorTest::test_functor_async_sequence(), and FunctorTest::test_functor_sequence().
|
slot |
change state to finished
References _finished_, and state().
Referenced by ui::task::FunctorASyncSequence::item_finished(), ui::task::FunctorSequence::run(), ui::task::FunctorASyncSequence::run(), and ui::task::FunctorNetworkCall::run().
|
signal |
indicate end of this Functor execution, emitted only once
Referenced by state(), ui::task::TaskSyncer_TaskStrategy::task_data_upload(), FunctorTest::test_basic(), FunctorTest::test_functor_async_sequence(), and FunctorTest::test_functor_sequence().
bool ui::task::Functor::is_finished | ( | ) | const |
return true if Functor is finished
References _finished_, and state_.
Referenced by ui::task::FunctorSequence::progress(), and ui::task::FunctorASyncSequence::progress().
bool ui::task::Functor::is_running | ( | ) | const |
return true if Functor is now executing
References _running_, and state_.
Referenced by progress(), ui::task::FunctorSequence::progress(), and ui::task::FunctorASyncSequence::progress().
|
inline |
References name_.
Referenced by pyrosetta.distributed.docs.ComponentDoc::__repr__(), execute(), options_class.Option::getCName(), options_class.Option::getDoxygenRow(), options_class.Option::getMarkdownRow(), options_class.Option::getOptionKeysCC(), options_class.Option::getWikiTableRow(), enumerate_junctions.DHR::print(), ui::task::FunctorSequence::run(), ui::task::FunctorASyncSequence::run(), enumerate_junctions.DHR::to_component(), and enumerate_junctions.DHR::write_to_file().
|
virtual |
Reimplemented in ui::task::FunctorASyncSequence, and ui::task::FunctorSequence.
References is_running().
Referenced by job_manager.CommandRunner::poll().
|
privatevirtualslot |
References _finished_, and state().
Referenced by execute().
|
signal |
indicate start of this Functor, emitted only once
Referenced by ui::task::FunctorSequence::run(), state(), FunctorTest::test_basic(), FunctorTest::test_functor_async_sequence(), and FunctorTest::test_functor_sequence().
|
inline |
|
protected |
References _finished_, _running_, finished(), started(), state(), state_, and tick().
|
signal |
Might be emitted periodically if Functor have loops. At least one tick() event is guaranteed to happened between start and finish.
Referenced by ui::task::FunctorSequence::run(), ui::task::FunctorASyncSequence::run(), pyrosetta.tests.distributed.test_gil.HeartBeat::run(), state(), FunctorTest::test_basic(), FunctorTest::test_functor_async_sequence(), and FunctorTest::test_functor_sequence().
|
private |
Referenced by name().
|
private |
Referenced by is_finished(), is_running(), and state().