OnixS C++ B3 BOE Binary Order Entry  1.2.0
API Documentation
SessionConnectionSettings.h
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable OnixS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 
20 #pragma once
21 
22 #include <OnixS/B3/BOE/ABI.h>
23 
24 #include <string>
25 #include <vector>
26 
27 namespace OnixS {
28 namespace B3 {
29 namespace BOE {
30 namespace Scheduling {
31 
32 /// Counterparty host name.
33 typedef std::string Host;
34 
35 /// Counterparty port.
36 typedef unsigned short Port;
37 
38 /// Parameters required to establish
39 /// the connection with the counterparty.
41 {
42 public:
43  /// Initializes a blank instance.
44  Counterparty();
45 
46  /// Fully identified counterparty.
47  Counterparty(const Host& host, Port port);
48 
49  /// Initializes as clone of the given instance.
50  Counterparty(const Counterparty& other);
51 
52  ~Counterparty();
53 
54  /// \return remote host.
55  const Host& host() const ONIXS_B3_BOE_NOTHROW;
56 
57  /// \return port number.
58  Port port() const ONIXS_B3_BOE_NOTHROW;
59 
60  Counterparty& operator=(const Counterparty& other);
61 
62 private:
63  Host* host_;
64  Port port_;
65 };
66 
67 /// Ordered series of counterparties.
68 typedef std::vector<Counterparty> Counterparties;
69 
70 /// Connection-related settings.
72 {
73 public:
74  /// Constructor.
75  ///
76  /// \param host the remote host to which session must connect to.
77  /// \param port the port number to which session must connect to.
78  SessionConnectionSettings(const Host& host, Port port);
79 
81 
82  virtual ~SessionConnectionSettings();
83 
84  /// Adds the counterparty.
85  SessionConnectionSettings& addCounterparty(const Host& host, Port port);
86 
87  /// \return Counterparties.
88  const Counterparties& counterparties() const ONIXS_B3_BOE_NOTHROW;
89 
91 
92 protected:
94 
95 private:
96  Counterparties* counterparties_;
97 };
98 
99 
101 {
102  return *counterparties_;
103 }
104 
105 }
106 }
107 }
108 }
Parameters required to establish the connection with the counterparty.
#define ONIXS_B3_BOE_NOTHROW
Definition: Compiler.h:182
unsigned short Port
Counterparty port.
#define ONIXS_B3_BOE_EXPORTED
Definition: Compiler.h:181
std::vector< Counterparty > Counterparties
Ordered series of counterparties.
Definition: Defines.h:40
std::string Host
Counterparty host name.