Rosetta
Public Types | Public Member Functions | Private Slots | Private Attributes | List of all members
ui::task::FunctorNetworkCall Class Reference

#include <functor.h>

Inheritance diagram for ui::task::FunctorNetworkCall:
Inheritance graph
[legend]

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)
 

Detailed Description

Functor to execute NetworkCall operation untill success Network call will be initiated though user provided CallCallback

Member Typedef Documentation

◆ CallCallback

Constructor & Destructor Documentation

◆ FunctorNetworkCall()

ui::task::FunctorNetworkCall::FunctorNetworkCall ( QString const &  name,
CallCallback const &  f = nullptr,
QObject parent = Q_NULLPTR 
)

Member Function Documentation

◆ callback()

void ui::task::FunctorNetworkCall::callback ( CallCallback const &  callback)
inline

References callback(), and callback_.

Referenced by callback().

◆ result()

QByteArray ui::task::FunctorNetworkCall::result ( ) const
inline

◆ result_as_json()

QJsonDocument ui::task::FunctorNetworkCall::result_as_json ( ) const
inline

◆ run

void ui::task::FunctorNetworkCall::run ( )
overrideprivateslot

◆ status_code()

int ui::task::FunctorNetworkCall::status_code ( ) const
inline

Member Data Documentation

◆ callback_

CallCallback ui::task::FunctorNetworkCall::callback_
private

Referenced by callback(), and run().

◆ request_

NetworkCall ui::task::FunctorNetworkCall::request_
private

The documentation for this class was generated from the following files: