qpid/sys/posix/PrivatePosix.h Source File

Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

qpid/sys/posix/PrivatePosix.h
Go to the documentation of this file.

    00001 #ifndef _sys_posix_PrivatePosix_h
    00002 #define _sys_posix_PrivatePosix_h
    00003
    00004 /*
    00005  *
    00006  * Licensed to the Apache Software Foundation (ASF) under one
    00007  * or more contributor license agreements.  See the NOTICE file
    00008  * distributed with this work for additional information
    00009  * regarding copyright ownership.  The ASF licenses this file
    00010  * to you under the Apache License, Version 2.0 (the
    00011  * "License"); you may not use this file except in compliance
    00012  * with the License.  You may obtain a copy of the License at
    00013  *
    00014  *   http://www.apache.org/licenses/LICENSE-2.0
    00015  *
    00016  * Unless required by applicable law or agreed to in writing,
    00017  * software distributed under the License is distributed on an
    00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    00019  * KIND, either express or implied.  See the License for the
    00020  * specific language governing permissions and limitations
    00021  * under the License.
    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 // Private Time related implementation details
    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 // Private SocketAddress details
    00041 class SocketAddress;
    00042 const struct addrinfo& getAddrInfo(const SocketAddress&);
    00043
    00044 // Private fd related implementation details
    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 // Posix fd as an IOHandle
    00057 class PosixIOHandle : public IOHandle {
    00058 public:
    00059     PosixIOHandle(int fd) :
    00060         IOHandle(new IOHandlePrivate(fd))
    00061     {}
    00062 };
    00063
    00064 // Dummy IOHandle for places it's required in the API
    00065 // but we promise not to actually try to do any operations on the IOHandle
    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