3#include <boost/container/flat_map.hpp>
20 template <
class =
void>
50 template <
class =
void>
58 boost::container::flat_map<work*, std::weak_ptr<work>>
map_;
107 template <
class T,
class... Args>
129 template <
class Finisher>
153 template <
class =
void>
188template <
class T,
class... Args>
202 sp->work::ios_ =
this;
203 map_.emplace(sp.get(), sp);
212template <
class Finisher>
220 auto map = std::move(
map_);
225 for (
auto const& p : map)
226 if (
auto sp = p.second.lock())
io_list & ios()
Return the io_list associated with the work.
Manages a set of objects performing asynchronous I/O.
boost::container::flat_map< work *, std::weak_ptr< work > > map_
std::condition_variable cv_
~io_list()
Destroy the list.
void join()
Block until the io_list stops.
bool closed() const
Return true if the list is closed.
std::function< void(void)> f_
std::shared_ptr< T > emplace(Args &&... args)
Create associated work if not closed.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.