Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
appbase::execution_priority_queue Class Reference

#include <execution_priority_queue.hpp>

Inheritance diagram for appbase::execution_priority_queue:
Collaboration diagram for appbase::execution_priority_queue:

Classes

class  executor
 

Public Member Functions

template<typename Function >
void add (int priority, Function function)
 
void execute_all ()
 
bool execute_highest ()
 
size_t size ()
 
template<typename Function >
boost::asio::executor_binder< Function, executorwrap (int priority, Function &&func)
 

Detailed Description

Definition at line 19 of file execution_priority_queue.hpp.

Member Function Documentation

◆ add()

template<typename Function >
void appbase::execution_priority_queue::add ( int priority,
Function function )
inline

Definition at line 24 of file execution_priority_queue.hpp.

25 {
26 std::unique_ptr<queued_handler_base> handler(new queued_handler<Function>(priority, --order_, std::move(function)));
27
28 handlers_.push(std::move(handler));
29 }
Here is the caller graph for this function:

◆ execute_all()

void appbase::execution_priority_queue::execute_all ( )
inline

Definition at line 31 of file execution_priority_queue.hpp.

32 {
33 while (!handlers_.empty()) {
34 handlers_.top()->execute();
35 handlers_.pop();
36 }
37 }

◆ execute_highest()

bool appbase::execution_priority_queue::execute_highest ( )
inline

Definition at line 39 of file execution_priority_queue.hpp.

40 {
41 if( !handlers_.empty() ) {
42 handlers_.top()->execute();
43 handlers_.pop();
44 }
45
46 return !handlers_.empty();
47 }
Here is the caller graph for this function:

◆ size()

size_t appbase::execution_priority_queue::size ( )
inline

Definition at line 49 of file execution_priority_queue.hpp.

49{ return handlers_.size(); }

◆ wrap()

template<typename Function >
boost::asio::executor_binder< Function, executor > appbase::execution_priority_queue::wrap ( int priority,
Function && func )
inline

Definition at line 102 of file execution_priority_queue.hpp.

103 {
104 return boost::asio::bind_executor( executor(*this, priority), std::forward<Function>(func) );
105 }
Here is the caller graph for this function:

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