20 #ifndef RIPPLE_SERVER_IO_LIST_H_INCLUDED
21 #define RIPPLE_SERVER_IO_LIST_H_INCLUDED
23 #include <boost/container/flat_map.hpp>
40 template <
class =
void>
70 template <
class =
void>
78 boost::container::flat_map<work*, std::weak_ptr<work>>
map_;
127 template <
class T,
class... Args>
149 template <
class Finisher>
173 template <
class =
void>
208 template <
class T,
class... Args>
216 auto sp = std::make_shared<T>(std::forward<Args>(args)...);
223 sp->work::ios_ =
this;
224 map_.emplace(sp.get(), sp);
233 template <
class Finisher>
241 auto map = std::move(
map_);
244 f_ = std::forward<Finisher>(f);
246 for (
auto const& p : map)
247 if (
auto sp = p.second.lock())
~io_list()
Destroy the list.
boost::container::flat_map< work *, std::weak_ptr< work > > map_
std::shared_ptr< T > emplace(Args &&... args)
Create associated work if not closed.
io_list & ios()
Return the io_list associated with the work.
std::function< void(void)> f_
std::condition_variable cv_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void join()
Block until the io_list stops.
bool closed() const
Return true if the list is closed.
Manages a set of objects performing asynchronous I/O.