Line data Source code
1 :
2 : /* Copyright (c) 2007-2016, Stefan Eilemann <eile@equalizergraphics.com>
3 : *
4 : * This file is part of Collage <https://github.com/Eyescale/Collage>
5 : *
6 : * This library is free software; you can redistribute it and/or modify it under
7 : * the terms of the GNU Lesser General Public License version 2.1 as published
8 : * by the Free Software Foundation.
9 : *
10 : * This library is distributed in the hope that it will be useful, but WITHOUT
11 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 : * details.
14 : *
15 : * You should have received a copy of the GNU Lesser General Public License
16 : * along with this library; if not, write to the Free Software Foundation, Inc.,
17 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 : */
19 :
20 : #ifndef CO_CONNECTIONTYPE_H
21 : #define CO_CONNECTIONTYPE_H
22 :
23 : #include <iostream>
24 : #include <lunchbox/debug.h>
25 :
26 : namespace co
27 : {
28 : /** The supported network protocols. */
29 : enum ConnectionType
30 : {
31 : CONNECTIONTYPE_NONE = 0,
32 : CONNECTIONTYPE_TCPIP, //!< TCP/IP sockets
33 : CONNECTIONTYPE_PIPE, //!< pipe() based uni-directional connection
34 : CONNECTIONTYPE_NAMEDPIPE, //!< Named pipe based bidirectional connection
35 : CONNECTIONTYPE_IB, //!< @deprecated Win XP Infiniband RDMA
36 : CONNECTIONTYPE_RDMA, //!< Infiniband RDMA CM
37 : CONNECTIONTYPE_UDT, //!< UDT connection
38 : CONNECTIONTYPE_MULTICAST = 0x100, //!< @internal MC types after this:
39 : CONNECTIONTYPE_RSP //!< UDP-based reliable stream protocol
40 : };
41 :
42 : /** @internal */
43 816 : inline std::ostream& operator<<(std::ostream& os, const ConnectionType& type)
44 : {
45 816 : switch (type)
46 : {
47 : case CONNECTIONTYPE_TCPIP:
48 805 : return os << "TCPIP";
49 : case CONNECTIONTYPE_PIPE:
50 9 : return os << "ANON_PIPE";
51 : case CONNECTIONTYPE_NAMEDPIPE:
52 2 : return os << "PIPE";
53 : case CONNECTIONTYPE_RSP:
54 0 : return os << "RSP";
55 : case CONNECTIONTYPE_NONE:
56 0 : return os << "NONE";
57 : case CONNECTIONTYPE_RDMA:
58 0 : return os << "RDMA";
59 : case CONNECTIONTYPE_UDT:
60 0 : return os << "UDT";
61 :
62 : default:
63 0 : LBASSERTINFO(false, "Not implemented");
64 0 : return os << "ERROR";
65 : }
66 : return os;
67 : }
68 : }
69 :
70 : #endif // CO_CONNECTIONTYPE_H
|