summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/asio/io_service.hpp')
-rw-r--r--3rdParty/Boost/src/boost/asio/io_service.hpp103
1 files changed, 66 insertions, 37 deletions
diff --git a/3rdParty/Boost/src/boost/asio/io_service.hpp b/3rdParty/Boost/src/boost/asio/io_service.hpp
index 3863e96..9350a84 100644
--- a/3rdParty/Boost/src/boost/asio/io_service.hpp
+++ b/3rdParty/Boost/src/boost/asio/io_service.hpp
@@ -15,25 +15,29 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
#include <cstddef>
#include <stdexcept>
#include <typeinfo>
-#include <boost/config.hpp>
-#include <boost/throw_exception.hpp>
-#include <boost/system/error_code.hpp>
-#include <boost/asio/detail/pop_options.hpp>
-
#include <boost/asio/detail/noncopyable.hpp>
-#include <boost/asio/detail/reactor_fwd.hpp>
#include <boost/asio/detail/service_registry_fwd.hpp>
-#include <boost/asio/detail/signal_init.hpp>
-#include <boost/asio/detail/task_io_service_fwd.hpp>
-#include <boost/asio/detail/win_iocp_io_service_fwd.hpp>
-#include <boost/asio/detail/winsock_init.hpp>
#include <boost/asio/detail/wrapped_handler.hpp>
+#include <boost/system/error_code.hpp>
+
+#if defined(BOOST_ASIO_HAS_IOCP)
+# include <boost/asio/detail/win_iocp_io_service_fwd.hpp>
+#else
+# include <boost/asio/detail/task_io_service_fwd.hpp>
+#endif
+
+#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# include <boost/asio/detail/winsock_init.hpp>
+#elif defined(__sun) || defined(__QNX__) || defined(__hpux) || defined(_AIX) \
+ || defined(__osf__)
+# include <boost/asio/detail/signal_init.hpp>
+#endif
+
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
@@ -46,7 +50,7 @@ template <typename Service> bool has_service(io_service& ios);
#if defined(BOOST_ASIO_HAS_IOCP)
namespace detail { typedef win_iocp_io_service io_service_impl; }
#else
-namespace detail { typedef task_io_service<reactor> io_service_impl; }
+namespace detail { typedef task_io_service io_service_impl; }
#endif
/// Provides core I/O functionality.
@@ -197,7 +201,7 @@ public:
class strand;
/// Constructor.
- io_service();
+ BOOST_ASIO_DECL io_service();
/// Constructor.
/**
@@ -206,7 +210,7 @@ public:
* @param concurrency_hint A suggestion to the implementation on how many
* threads it should allow to run simultaneously.
*/
- explicit io_service(std::size_t concurrency_hint);
+ BOOST_ASIO_DECL explicit io_service(std::size_t concurrency_hint);
/// Destructor.
/**
@@ -240,7 +244,7 @@ public:
* destructor defined above destroys all handlers, causing all @c shared_ptr
* references to all connection objects to be destroyed.
*/
- ~io_service();
+ BOOST_ASIO_DECL ~io_service();
/// Run the io_service object's event processing loop.
/**
@@ -266,7 +270,7 @@ public:
* The poll() function may also be used to dispatch ready handlers, but
* without blocking.
*/
- std::size_t run();
+ BOOST_ASIO_DECL std::size_t run();
/// Run the io_service object's event processing loop.
/**
@@ -292,7 +296,7 @@ public:
* The poll() function may also be used to dispatch ready handlers, but
* without blocking.
*/
- std::size_t run(boost::system::error_code& ec);
+ BOOST_ASIO_DECL std::size_t run(boost::system::error_code& ec);
/// Run the io_service object's event processing loop to execute at most one
/// handler.
@@ -304,7 +308,7 @@ public:
*
* @throws boost::system::system_error Thrown on failure.
*/
- std::size_t run_one();
+ BOOST_ASIO_DECL std::size_t run_one();
/// Run the io_service object's event processing loop to execute at most one
/// handler.
@@ -316,7 +320,7 @@ public:
*
* @return The number of handlers that were executed.
*/
- std::size_t run_one(boost::system::error_code& ec);
+ BOOST_ASIO_DECL std::size_t run_one(boost::system::error_code& ec);
/// Run the io_service object's event processing loop to execute ready
/// handlers.
@@ -328,7 +332,7 @@ public:
*
* @throws boost::system::system_error Thrown on failure.
*/
- std::size_t poll();
+ BOOST_ASIO_DECL std::size_t poll();
/// Run the io_service object's event processing loop to execute ready
/// handlers.
@@ -340,7 +344,7 @@ public:
*
* @return The number of handlers that were executed.
*/
- std::size_t poll(boost::system::error_code& ec);
+ BOOST_ASIO_DECL std::size_t poll(boost::system::error_code& ec);
/// Run the io_service object's event processing loop to execute one ready
/// handler.
@@ -352,7 +356,7 @@ public:
*
* @throws boost::system::system_error Thrown on failure.
*/
- std::size_t poll_one();
+ BOOST_ASIO_DECL std::size_t poll_one();
/// Run the io_service object's event processing loop to execute one ready
/// handler.
@@ -364,7 +368,7 @@ public:
*
* @return The number of handlers that were executed.
*/
- std::size_t poll_one(boost::system::error_code& ec);
+ BOOST_ASIO_DECL std::size_t poll_one(boost::system::error_code& ec);
/// Stop the io_service object's event processing loop.
/**
@@ -373,7 +377,7 @@ public:
* return as soon as possible. Subsequent calls to run(), run_one(), poll()
* or poll_one() will return immediately until reset() is called.
*/
- void stop();
+ BOOST_ASIO_DECL void stop();
/// Reset the io_service in preparation for a subsequent run() invocation.
/**
@@ -386,7 +390,7 @@ public:
* This function must not be called while there are any unfinished calls to
* the run(), run_one(), poll() or poll_one() functions.
*/
- void reset();
+ BOOST_ASIO_DECL void reset();
/// Request the io_service to invoke the given handler.
/**
@@ -606,10 +610,10 @@ protected:
/**
* @param owner The io_service object that owns the service.
*/
- service(boost::asio::io_service& owner);
+ BOOST_ASIO_DECL service(boost::asio::io_service& owner);
/// Destructor.
- virtual ~service();
+ BOOST_ASIO_DECL virtual ~service();
private:
/// Destroy all user-defined handler objects owned by the service.
@@ -632,10 +636,7 @@ class service_already_exists
: public std::logic_error
{
public:
- service_already_exists()
- : std::logic_error("Service already exists.")
- {
- }
+ BOOST_ASIO_DECL service_already_exists();
};
/// Exception thrown when trying to add a service object to an io_service where
@@ -644,17 +645,45 @@ class invalid_service_owner
: public std::logic_error
{
public:
- invalid_service_owner()
- : std::logic_error("Invalid service owner.")
+ BOOST_ASIO_DECL invalid_service_owner();
+};
+
+namespace detail {
+
+// Special derived service id type to keep classes header-file only.
+template <typename Type>
+class service_id
+ : public boost::asio::io_service::id
+{
+};
+
+// Special service base class to keep classes header-file only.
+template <typename Type>
+class service_base
+ : public boost::asio::io_service::service
+{
+public:
+ static boost::asio::detail::service_id<Type> id;
+
+ // Constructor.
+ service_base(boost::asio::io_service& io_service)
+ : boost::asio::io_service::service(io_service)
{
}
};
+template <typename Type>
+boost::asio::detail::service_id<Type> service_base<Type>::id;
+
+} // namespace detail
} // namespace asio
} // namespace boost
-#include <boost/asio/impl/io_service.ipp>
-
#include <boost/asio/detail/pop_options.hpp>
+#include <boost/asio/impl/io_service.hpp>
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/impl/io_service.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+
#endif // BOOST_ASIO_IO_SERVICE_HPP