libutil++  1.9.3
 All Classes Functions Variables
SocketPair.h
1 /*
2 ** libutil++
3 ** $Id: SocketPair.h 1653 2016-02-28 19:54:59Z sella $
4 ** Copyright (c) 2011-2016 Digital Genesis, LLC. All Rights Reserved.
5 ** Released under the LGPL Version 2.1 License.
6 ** http://www.digitalgenesis.com
7 */
8 
9 #ifndef __libutilxx__sella__net__SocketPair_H__
10 #define __libutilxx__sella__net__SocketPair_H__
11 
12 #include "../../common.h"
13 #include "UnixSocket.h"
14 
15 #include <sys/types.h>
16 #include <sys/socket.h>
17 
18 namespace sella {
19  namespace net {
20  class SocketPair;
21  }
22 }
23 
25  public:
26  typedef std::shared_ptr<SocketPair> shared;
27  typedef SocketPair *ptr;
28 
29  public:
30  SocketPair() throw (SocketException);
31  SocketPair(const SocketPair &sock) = delete;
32  virtual ~SocketPair();
33  void operator=(const SocketPair &sock) = delete;
34 
35  UnixSocket::shared getFirst(void);
36  UnixSocket::shared getSecond(void);
37 
38  static const SocketPair::shared shared_ptr() throw (SocketException);
39 
40  protected:
41  UnixSocket::shared first;
42  UnixSocket::shared second;
43 };
44 
45 #endif
46 
47 /*
48 ** vim: noet ts=3 sw=3
49 */