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

FunctorSequence is essentially a subroutine-like construct that allow you to call sequence of function one-by-one. It guarantee that the next in line function will be called only after all previous calls has finished. More...

#include <functor.h>

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

Public Types

using ValueType = FunctorSP
 
- Public Types inherited from ui::task::Functor
enum class  State { _none_ , _running_ , _finished_ }
 

Signals

void next ()
 execute each time when new item starts running 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...
 

Public Member Functions

 FunctorSequence (QString const &name, std::initializer_list< ValueType > sequence)
 
void add_functor (ValueType const &v)
 
std::pair< int, int > progress () const override
 
 Functor (QString const &name, QObject *parent=Q_NULLPTR)
 
- 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 ()
 

Private Slots

void run () override
 

Private Attributes

std::vector< ValueTypesequence_
 

Additional Inherited Members

- Public Slots inherited from ui::task::Functor
void finish ()
 change state to finished More...
 
- Protected Member Functions inherited from ui::task::Functor
void state (State state)
 

Detailed Description

FunctorSequence is essentially a subroutine-like construct that allow you to call sequence of function one-by-one. It guarantee that the next in line function will be called only after all previous calls has finished.

Member Typedef Documentation

◆ ValueType

Constructor & Destructor Documentation

◆ FunctorSequence()

ui::task::FunctorSequence::FunctorSequence ( QString const &  name,
std::initializer_list< ValueType sequence 
)

Member Function Documentation

◆ add_functor()

void ui::task::FunctorSequence::add_functor ( ValueType const &  v)

◆ Functor()

ui::task::Functor::Functor
inline

◆ next

void ui::task::FunctorSequence::next ( )
signal

execute each time when new item starts running

Referenced by run().

◆ progress()

std::pair< int, int > ui::task::FunctorSequence::progress ( ) const
overridevirtual

◆ run

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

Member Data Documentation

◆ sequence_

std::vector<ValueType> ui::task::FunctorSequence::sequence_
private

Referenced by add_functor(), progress(), and run().


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