|
Rosetta
|
#include <functor.h>

Public Types | |
| using | CallCallback = std::function< void(NetworkCall &) > |
Public Types inherited from ui::task::Functor | |
| enum class | State { _none_ , _running_ , _finished_ } |
Public Member Functions | |
| FunctorNetworkCall (QString const &name, CallCallback const &f=nullptr, QObject *parent=Q_NULLPTR) | |
| void | callback (CallCallback const &callback) |
| QByteArray | result () const |
| int | status_code () const |
| QJsonDocument | result_as_json () const |
Public Member Functions inherited from ui::task::Functor | |
| 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 |
Private Slots | |
| void | run () override |
Private Attributes | |
| CallCallback | callback_ |
| NetworkCall | request_ |
Additional Inherited Members | |
Public Slots inherited from ui::task::Functor | |
| void | finish () |
| change state to finished More... | |
Signals inherited from ui::task::Functor | |
| 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... | |
Protected Member Functions inherited from ui::task::Functor | |
| void | state (State state) |
Functor to execute NetworkCall operation untill success Network call will be initiated though user provided CallCallback
| using ui::task::FunctorNetworkCall::CallCallback = std::function< void (NetworkCall &) > |
| ui::task::FunctorNetworkCall::FunctorNetworkCall | ( | QString const & | name, |
| CallCallback const & | f = nullptr, |
||
| QObject * | parent = Q_NULLPTR |
||
| ) |
|
inline |
References callback(), and callback_.
Referenced by callback().
|
inline |
References request_, and ui::task::NetworkCall::result().
|
inline |
References request_, and ui::task::NetworkCall::result_as_json().
|
overrideprivateslot |
References callback_, ui::task::Functor::finish(), ui::task::NetworkCall::finished(), and request_.
|
inline |
References request_, and ui::task::NetworkCall::status_code().
|
private |
Referenced by callback(), and run().
|
private |
Referenced by result(), result_as_json(), run(), and status_code().