io_service.h
//
// Copyright (C) 2009-2012 Artyom Beilis (Tonkikh)
//
// 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)
//
#ifndef BOOSTER_AIO_IO_SERVICE_H
#define BOOSTER_AIO_IO_SERVICE_H
#include <booster/config.h>
#include <booster/aio/aio_config.h>
#include <booster/aio/types.h>
#include <booster/thread.h>
#include <booster/system_error.h>
#include <booster/aio/aio_category.h>
#include <booster/callback.h>
#include <booster/noncopyable.h>
#include <string>
#include <memory>
namespace booster {
class ptime;
namespace aio {
class event_loop_impl;
class BOOSTER_API io_service : public noncopyable, public io_events {
public:
io_service(int reactor_type);
io_service();
~io_service();
void set_io_event(native_type fd,int event,event_handler const &h);
void cancel_io_events(native_type fd);
int set_timer_event(ptime const &point,event_handler const &h);
void cancel_timer_event(int event_id);
void run();
void run(system::error_code &e);
void reset();
void stop();
void post(handler const &h);
std::string reactor_name();
private:
struct data;
hold_ptr<data> d;
std::auto_ptr<event_loop_impl> impl_;
};
} // aio
} // booster
#endif
booster::hold_ptr< data >
booster::aio::io_events
the struct that collects multiple event types for polling.
Definition: types.h:86
booster::callback
Definition: callback.h:18
booster::system::error_code
The lightweight object that carries a error code information and its category.
Definition: system_error.h:83
booster::ptime
This class represents POSIX time.
Definition: posix_time.h:26
booster::aio::native_type
unspecified native_type
Definition: types.h:29
booster::locale::conv::stop
Stop conversion and throw conversion_error.
Definition: encoding_errors.h:56
booster::aio::io_service
this is the central event loop that dispatches all requests.
Definition: io_service.h:37
booster::noncopyable
This class makes impossible to copy any class derived from this one.
Definition: noncopyable.h:15