Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
transport.h File Reference

C++20 concepts for transport client interfaces. More...

#include <concepts>
#include <cstdint>
#include <span>
#include <string>
#include <type_traits>
Include dependency graph for transport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  kcenon
 
namespace  kcenon::common
 Core interfaces.
 
namespace  kcenon::common::interfaces
 
namespace  kcenon::common::concepts
 C++20 concepts for compile-time type validation.
 

Concepts

concept  kcenon::common::concepts::HttpSender
 A type that can send HTTP requests.
 
concept  kcenon::common::concepts::HttpAvailabilityChecker
 A type that can check HTTP client availability.
 
concept  kcenon::common::concepts::HttpClientLike
 A complete HTTP client type satisfying IHttpClient interface.
 
concept  kcenon::common::concepts::HttpClientProviderLike
 A type that can provide HTTP client instances.
 
concept  kcenon::common::concepts::UdpConnectable
 A type that supports UDP connection operations.
 
concept  kcenon::common::concepts::UdpSender
 A type that can send UDP datagrams.
 
concept  kcenon::common::concepts::UdpConnectionStatus
 A type that can report UDP connection status.
 
concept  kcenon::common::concepts::UdpClientLike
 A complete UDP client type satisfying IUdpClient interface.
 
concept  kcenon::common::concepts::UdpClientProviderLike
 A type that can provide UDP client instances.
 
concept  kcenon::common::concepts::TransportClient
 A type that represents any transport client (HTTP or UDP).
 

Detailed Description

C++20 concepts for transport client interfaces.

This header provides concepts for validating HTTP and UDP client types used in network communication. These concepts replace abstract class-based constraints with compile-time validation and clearer error messages.

Requirements:

  • C++20 compiler with concepts support
  • GCC 10+, Clang 10+, MSVC 2022+

Thread Safety:

  • Concepts are evaluated at compile-time only.
  • No runtime thread-safety considerations apply.
See also
http_client_interface.h for IHttpClient definition
udp_client_interface.h for IUdpClient definition
https://en.cppreference.com/w/cpp/language/constraints

Definition in file transport.h.