OnixS C++ CME Streamlined Market Data Handler  1.1.0.5
API documentation
NetFeedConnection.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 ip_;
42 
43  NifList nifs_;
44 
45 public:
46  /// Initializes blank instance.
48  : port_(0)
49  , ip_()
50  , nifs_()
51  {
52  }
53 
54  /// Cleans everything up.
56  {
57  }
58 
59  /// Identifies connection port.
60  UInt32 port() const
61  {
62  return port_;
63  }
64 
65  /// Updates connection port.
66  void port(UInt32 port)
67  {
68  port_ = port;
69  }
70 
71  /// Identifies connection host IP.
72  const std::string& ip() const
73  {
74  return ip_;
75  }
76 
77  /// Updates connection host IP.
78  void ip(const std::string& ip)
79  {
80  ip_ = ip;
81  }
82 
83  /// List of network interfaces on which
84  /// connection is to be binded (if binding
85  /// to network interfaces is applicable).
87  {
88  return nifs_;
89  }
90 
91  /// List of network interfaces on which
92  /// connection is to be binded (if binding
93  /// to network interfaces is applicable).
94  const NifList& nifs() const
95  {
96  return nifs_;
97  }
98 };
99 
100 /// Serializes feed connection attributes to a given string.
101 ONIXS_CMESTREAMLINEDMDH_EXPORTED
102 void
103 toStr(
104  std::string&,
105  const NetFeedConnection&);
106 
107 /// Serializes feed connection attributes to a given string.
108 inline
109 std::string
111  const NetFeedConnection& connection)
112 {
113  std::string str;
114 
115  toStr(str, connection);
116 
117  return str;
118 }
119 
std::string toStr(const NetFeedConnection &connection)
Serializes feed connection attributes to a given string.
std::vector< std::string > NifList
List of network interfaces.
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
Definition: Bootstrap.h:172
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS
Definition: Bootstrap.h:110
UInt32 port() const
Identifies connection port.
NetFeedConnection()
Initializes blank instance.
const std::string & ip() const
Identifies connection host IP.
Network feed connection attributes.
void ip(const std::string &ip)
Updates connection host IP.
void port(UInt32 port)
Updates connection port.
UInt32 UInt32
uInt32.
Definition: Fields.h:183
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
Definition: Bootstrap.h:168