diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/service_registry.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/detail/service_registry.hpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp b/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp index a247ea8..458f271 100644 --- a/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp @@ -2,7 +2,7 @@ // detail/service_registry.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -52,12 +52,22 @@ class service_registry : private noncopyable { public: - // Constructor. - BOOST_ASIO_DECL service_registry(boost::asio::io_service& o); + // Constructor. Adds the initial service. + template <typename Service, typename Arg> + service_registry(boost::asio::io_service& o, + Service* initial_service, Arg arg); // Destructor. BOOST_ASIO_DECL ~service_registry(); + // Notify all services of a fork event. + BOOST_ASIO_DECL void notify_fork(boost::asio::io_service::fork_event fork_ev); + + // Get the first service object cast to the specified type. Called during + // io_service construction and so performs no locking or type checking. + template <typename Service> + Service& first_service(); + // Get the service object corresponding to the specified service type. Will // create a new service object automatically if no such object already // exists. Ownership of the service object is not transferred to the caller. @@ -120,8 +130,8 @@ private: const boost::asio::io_service::service::key& key, factory_type factory); - // Add a service object. Returns false on error, in which case ownership of - // the object is retained by the caller. + // Add a service object. Throws on error, in which case ownership of the + // object is retained by the caller. BOOST_ASIO_DECL void do_add_service( const boost::asio::io_service::service::key& key, boost::asio::io_service::service* new_service); |