Go to the documentation of this file.00001 #ifndef _sys_posix_PrivatePosix_h
00002 #define _sys_posix_PrivatePosix_h
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 #include "qpid/sys/Time.h"
00026 #include "qpid/sys/IOHandle.h"
00027 
00028 struct timespec;
00029 struct timeval;
00030 struct addrinfo;
00031 
00032 namespace qpid {
00033 namespace sys {
00034 
00035 
00036 struct timespec& toTimespec(struct timespec& ts, const Duration& t);
00037 struct timeval& toTimeval(struct timeval& tv, const Duration& t);
00038 Duration toTime(const struct timespec& ts);
00039 
00040 
00041 class SocketAddress;
00042 const struct addrinfo& getAddrInfo(const SocketAddress&);
00043 
00044 
00045 class IOHandlePrivate {
00046 public:
00047     IOHandlePrivate(int f = -1) :
00048             fd(f)
00049     {}
00050 
00051     int fd;
00052 };
00053 
00054 int toFd(const IOHandlePrivate* h);
00055 
00056 
00057 class PosixIOHandle : public IOHandle {
00058 public:
00059     PosixIOHandle(int fd) :
00060         IOHandle(new IOHandlePrivate(fd))
00061     {}
00062 };
00063 
00064 
00065 
00066 class NullIOHandle : public IOHandle {
00067 public:
00068     NullIOHandle() :
00069         IOHandle(new IOHandlePrivate)
00070     {}
00071 };
00072 
00073 extern NullIOHandle DummyIOHandle;
00074 
00075 }}
00076 
00077 #endif