00001
00002
00003
00004
00005
00006
00007
00008 #ifndef BOOSTER_AIO_TYPES_H
00009 #define BOOSTER_AIO_TYPES_H
00010
00011 #include <booster/config.h>
00012 #include <stddef.h>
00013
00014 namespace booster {
00015 template<typename F>
00016 class callback;
00017
00018 namespace system {
00019 class error_code;
00020 }
00021
00022
00027 namespace aio {
00028 class endpoint;
00029 class io_service;
00030
00031 #ifdef BOOSTER_DOXYGEN_DOCS
00032
00033
00034
00035 typedef unspecified native_type;
00039 static const native_type invalid_socket = unspecified;
00040
00041 #elif defined BOOSTER_WIN32
00042 typedef unsigned native_type;
00043 static const unsigned invalid_socket = (unsigned)(-1);
00044 #else
00045 typedef int native_type;
00046 static const int invalid_socket = -1;
00047 #endif
00048
00053 typedef callback<void(system::error_code const &)> event_handler;
00054
00058 typedef callback<void()> handler;
00063 typedef callback<void(system::error_code const &,size_t)> io_handler;
00064
00068 typedef enum {
00069 pf_unix,
00070 pf_inet,
00071 pf_inet6
00072 } family_type;
00073
00077 typedef enum {
00078 sock_stream,
00079 sock_datagram
00080 } socket_type;
00081
00086 struct io_events {
00087 static const int in = 1 << 0;
00088 static const int out = 1 << 1;
00089 static const int err = 1 << 2;
00090 };
00091 }
00092 }
00093
00094
00095 #endif