rippled
Classes | Public Member Functions | Private Attributes | List of all members
ripple::PeerFinder::Sim::FunctionQueue Class Reference

Maintains a queue of functors that can be called later. More...

Collaboration diagram for ripple::PeerFinder::Sim::FunctionQueue:
Collaboration graph
[legend]

Classes

class  BasicWork
 
class  Work
 

Public Member Functions

 FunctionQueue ()=default
 
bool empty ()
 Returns true if there is no remaining work. More...
 
template<typename Function >
void post (Function f)
 Queue a function. More...
 
void run ()
 Run all pending functions. More...
 

Private Attributes

std::list< std::unique_ptr< BasicWork > > m_work
 

Detailed Description

Maintains a queue of functors that can be called later.

Definition at line 28 of file FunctionQueue.h.

Constructor & Destructor Documentation

◆ FunctionQueue()

ripple::PeerFinder::Sim::FunctionQueue::FunctionQueue ( )
explicitdefault

Member Function Documentation

◆ empty()

bool ripple::PeerFinder::Sim::FunctionQueue::empty ( )

Returns true if there is no remaining work.

Definition at line 66 of file FunctionQueue.h.

◆ post()

template<typename Function >
void ripple::PeerFinder::Sim::FunctionQueue::post ( Function  f)

Queue a function.

Function must be callable with this signature: void (void)

Definition at line 77 of file FunctionQueue.h.

◆ run()

void ripple::PeerFinder::Sim::FunctionQueue::run ( )

Run all pending functions.

The functions will be invoked in the order they were queued.

Definition at line 86 of file FunctionQueue.h.

Member Data Documentation

◆ m_work

std::list<std::unique_ptr<BasicWork> > ripple::PeerFinder::Sim::FunctionQueue::m_work
private

Definition at line 61 of file FunctionQueue.h.