OnixS C++ CME MDP Conflated UDP Handler  1.1.2
API documentation
FeedConnection.h
Go to the documentation of this file.
1 // Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2 //
3 // This software owned by Onix Solutions Limited [OnixS] and is
4 // protected by copyright law and international copyright treaties.
5 //
6 // Access to and use of the software is governed by the terms of the applicable
7 // OnixS Software Services Agreement (the Agreement) and Customer end user license
8 // agreements granting a non-assignable, non-transferable and non-exclusive license
9 // to use the software for it's own data processing purposes under the terms defined
10 // in the Agreement.
11 //
12 // Except as otherwise granted within the terms of the Agreement, copying or
13 // reproduction of any part of this source code or associated reference material
14 // to any other location for further reproduction or redistribution, and any
15 // amendments to this copyright notice, are expressly prohibited.
16 //
17 // Any reproduction or redistribution for sale or hiring of the Software not in
18 // accordance with the terms of the Agreement is a violation of copyright law.
19 //
20 
21 #pragma once
22 
23 #include <string>
24 #include <vector>
25 
27 
29 
30 /// List of network interfaces.
31 typedef
32 std::vector<std::string>
34 
35 /// Network feed connection attributes.
38 {
39  UInt32 port_;
40 
41  std::string address_;
42 
43  NifList nifs_;
44 
45 public:
46  /// Initializes blank instance.
48  : port_(0)
49  , address_()
50  , nifs_()
51  {
52  }
53 
54  /// Initializes connection information
55  /// using its primary attributes.
57  const std::string& address,
58  UInt32 port)
59  : port_(port)
60  , address_(address)
61  , nifs_()
62  {
63  }
64 
65  /// Cleans everything up.
67  {
68  }
69 
70  /// Identifies connection port.
71  UInt32 port() const
72  {
73  return port_;
74  }
75 
76  /// Updates connection port.
77  void port(UInt32 port)
78  {
79  port_ = port;
80  }
81 
82  /// Identifies connection address.
83  const std::string& address() const
84  {
85  return address_;
86  }
87 
88  /// Updates connection address.
89  void
91  const std::string& address)
92  {
93  address_ = address;
94  }
95 
96  /// List of network interfaces on which
97  /// connection is to be binded (if binding
98  /// to network interfaces is applicable).
100  {
101  return nifs_;
102  }
103 
104  /// List of network interfaces on which
105  /// connection is to be binded (if binding
106  /// to network interfaces is applicable).
107  const NifList& nifs() const
108  {
109  return nifs_;
110  }
111 };
112 
113 /// Serializes feed connection attributes to a given string.
114 ONIXS_CONFLATEDUDP_EXPORTED
115 void
116 toStr(
117  std::string&,
118  const NetFeedConnection&);
119 
120 /// Serializes feed connection attributes to a given string.
121 inline
122 std::string
124  const NetFeedConnection& connection)
125 {
126  std::string str;
127 
128  toStr(str, connection);
129 
130  return str;
131 }
132 
133 /// Establishes the order between two connections.
136 {
137  /// Establishes the order between two connections.
138  bool
139  operator ()(
140  const NetFeedConnection&,
141  const NetFeedConnection&) const;
142 };
143 
NetFeedConnection(const std::string &address, UInt32 port)
UInt32 UInt32
uInt32.
Definition: Fields.h:261
UInt32 port() const
Identifies connection port.
void port(UInt32 port)
Updates connection port.
std::string toStr(const NetFeedConnection &connection)
Serializes feed connection attributes to a given string.
const std::string & address() const
Identifies connection address.
Establishes the order between two connections.
#define ONIXS_CONFLATEDUDP_EXPORTED_STRUCT
Definition: Bootstrap.h:59
NetFeedConnection()
Initializes blank instance.
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition: Bootstrap.h:157
void address(const std::string &address)
Updates connection address.
std::vector< std::string > NifList
List of network interfaces.
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
Definition: Bootstrap.h:95
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition: Bootstrap.h:153
Network feed connection attributes.