Corelink CPP Client
Corelink C++ client library
 
Loading...
Searching...
No Matches
corelink_client_connection_info.hpp
Go to the documentation of this file.
1#pragma once
2
6
7namespace corelink
8{
9 namespace client
10 {
11 struct CORELINK_EXPORT corelink_client_connection_info
12 {
20 static constexpr uint16_t TCP_CONTROL_PORT = 20010;
24 static constexpr uint16_t WEBSOCKET_CONTROL_PORT = 20012;
36 std::string username = DEFAULT_USERNAME;
40 std::string password = DEFAULT_PASSWORD;
44 std::string endpoint = CORELINK_REMOTE_HOSTNAME;
48 uint16_t port_number = WEBSOCKET_CONTROL_PORT;
49 //"/Users/sarthaktickoo/Work/hsrn/corelink/repos/corelink/config/ca-crt.pem"
53 std::string client_certificate_path = "./ca-crt.pem";
58
63#ifdef CORELINK_USE_WEBSOCKET
64 core::network::constants::protocols::websocket
65#else
66 core::network::constants::protocols::tcp
67#endif
68 )
69 {}
70
75 CORELINK_CPP_ATTR_MAYBE_UNUSED explicit corelink_client_connection_info(
77 : protocol(proto)
78 {
79 switch (protocol())
80 {
81#ifdef CORELINK_USE_WEBSOCKET
82 case core::network::constants::protocols::websocket():
83 set_port_number(WEBSOCKET_CONTROL_PORT);
84 break;
85#endif
86#ifdef CORELINK_USE_TCP
87 case core::network::constants::protocols::tcp():
88 set_port_number(TCP_CONTROL_PORT);
89 break;
90#endif
91 }
92 }
93
99 : username(rhs.username),
100 password(rhs.password),
101 endpoint(rhs.endpoint),
102 port_number(rhs.port_number),
103 client_certificate_path(rhs.client_certificate_path),
104 protocol(rhs.protocol)
105 {}
106
112 : username(std::move(rhs.username)),
113 password(std::move(rhs.password)),
114 endpoint(std::move(rhs.endpoint)),
115 port_number(rhs.port_number),
116 client_certificate_path(std::move(rhs.client_certificate_path)),
117 protocol(rhs.protocol)
118 {}
119
126 {
127 this->username = _;
128 return *this;
129 }
130
137 {
138 this->password = _;
139 return *this;
140 }
141
148 {
149 this->endpoint = _;
150 return *this;
151 }
152
159 {
160 this->port_number = _;
161 return *this;
162 }
163
170 {
171 this->client_certificate_path = _;
172 return *this;
173 }
174 };
175
179 }
180}