IRSOL
C++ code implementing socket server for interacting with Baumer camera.
types.hpp
Go to the documentation of this file.
1
11#pragma once
12
13#include <chrono>
14#include <cstddef>
15#include <cstdint>
16#include <sockpp/tcp_acceptor.h>
17#include <sockpp/tcp_connector.h>
18#include <string>
19#include <variant>
20
21namespace irsol {
22
35namespace types {
36
48using port_t = uint16_t;
49
55using client_id_t = std::string;
56
63using acceptor_t = sockpp::tcp_acceptor;
64
71using connector_t = sockpp::tcp_connector;
72
79using inet_address_t = sockpp::inet_address;
80
87using socket_t = sockpp::tcp_socket;
88
95using connection_result_t = sockpp::result<>;
96
// end Server-related Types
98
112using clock_t = std::chrono::steady_clock;
113
120using timepoint_t = clock_t::time_point;
121
128using duration_t = clock_t::duration;
129
// end Time-related Types
131
150using protocol_value_t = std::variant<int, double, std::string>;
151
// end Protocol-related Types
153
165using byte_t = std::byte;
166
// end Serialization-related Types
168
169} // namespace types
170} // namespace irsol
clock_t::duration duration_t
Alias for a duration of time as defined by clock_t.
Definition types.hpp:128
std::chrono::steady_clock clock_t
Alias for the steady clock type used throughout the library.
Definition types.hpp:112
std::string client_id_t
Represents a unique client identifier. Typically used to identify connected clients by string IDs.
Definition types.hpp:55
sockpp::result<> connection_result_t
Result type representing success or failure of a socket operation.
Definition types.hpp:95
uint16_t port_t
Represents a network port number. Typically used to specify TCP or UDP ports.
Definition types.hpp:48
sockpp::inet_address inet_address_t
Alias for an IPv4/IPv6 internet address.
Definition types.hpp:79
sockpp::tcp_connector connector_t
Alias for the TCP client connector type.
Definition types.hpp:71
sockpp::tcp_socket socket_t
Alias for a TCP socket.
Definition types.hpp:87
std::variant< int, double, std::string > protocol_value_t
Variant type representing protocol values that can be one of several types.
Definition types.hpp:150
sockpp::tcp_acceptor acceptor_t
Alias for the TCP server socket acceptor type.
Definition types.hpp:63
std::byte byte_t
Alias for a single byte used in serialization or binary data handling.
Definition types.hpp:165
clock_t::time_point timepoint_t
Alias for a point in time as defined by clock_t.
Definition types.hpp:120