// --------------------------------------------------------------------------------------------- // to use a different executor: // // 1. create a copy of this file in your own application // // 2. create your own version of appbase/default_executor.hpp // (it needs to define a type `appbase_executor`) // and include this file instead of // // 3. include your own `application.hpp` in your project // // --------------------------------------------------------------------------------------------- #pragma once #include class my_executor { public: template auto post( int priority, Func&& func ) { return boost::asio::post(io_serv, pri_queue.wrap(priority, std::forward(func))); } auto& get_priority_queue() { return pri_queue; } bool execute_highest() { return pri_queue.execute_highest(); } void clear() { pri_queue.clear(); } boost::asio::io_service& get_io_service() { return io_serv; } private: // members are ordered taking into account that the last one is destructed first boost::asio::io_service io_serv; appbase::execution_priority_queue pri_queue; }; using appbase_executor = my_executor; #include