86using InMessage = std::variant<Assignment, Inquiry, Command>;
122 return "BINARY_BUFFER";
126 return "COLOR_IMAGE";
149 std::variant<Success, BinaryDataBuffer, ImageBinaryData, ColorImageBinaryData, Error>;
176template<
typename T, std::enable_if_t<irsol::traits::is_type_in_variant_v<T, InMessage>,
int> = 0>
180 if constexpr(std::is_same_v<T, Assignment>)
182 else if constexpr(std::is_same_v<T, Inquiry>)
184 else if constexpr(std::is_same_v<T, Command>)
205template<
typename T, std::enable_if_t<irsol::traits::is_type_in_variant_v<T, InMessage>,
int> = 0>
209 return std::is_same_v<T, Assignment>;
220template<
typename T, std::enable_if_t<irsol::traits::is_type_in_variant_v<T, InMessage>,
int> = 0>
224 return std::is_same_v<T, Inquiry>;
235template<
typename T, std::enable_if_t<irsol::traits::is_type_in_variant_v<T, InMessage>,
int> = 0>
239 return std::is_same_v<T, Command>;
252template<
typename T, std::enable_if_t<irsol::traits::is_type_in_variant_v<T, OutMessage>,
int> = 0>
256 if constexpr(std::is_same_v<T, Success>)
258 else if constexpr(std::is_same_v<T, Error>)
260 else if constexpr(std::is_same_v<T, BinaryDataBuffer>)
262 else if constexpr(std::is_same_v<T, ImageBinaryData>)
264 else if constexpr(std::is_same_v<T, ColorImageBinaryData>)
285template<
typename T, std::enable_if_t<irsol::traits::is_type_in_variant_v<T, OutMessage>,
int> = 0>
289 return std::is_same_v<T, Success>;
300template<
typename T, std::enable_if_t<irsol::traits::is_type_in_variant_v<T, OutMessage>,
int> = 0>
304 return std::is_same_v<T, BinaryDataBuffer>;
315template<
typename T, std::enable_if_t<irsol::traits::is_type_in_variant_v<T, OutMessage>,
int> = 0>
319 return std::is_same_v<T, ImageBinaryData>;
330template<
typename T, std::enable_if_t<irsol::traits::is_type_in_variant_v<T, OutMessage>,
int> = 0>
334 return std::is_same_v<T, ColorImageBinaryData>;
345template<
typename T, std::enable_if_t<irsol::traits::is_type_in_variant_v<T, OutMessage>,
int> = 0>
349 return std::is_same_v<T, Error>;
Protocol binary data types and attributes definitions.
constexpr bool isError(IRSOL_MAYBE_UNUSED T &msg)
Checks if a given outgoing message type is Error.
std::variant< Assignment, Inquiry, Command > InMessage
Variant type representing any incoming message.
constexpr OutMessageKind getOutMessageKind(IRSOL_MAYBE_UNUSED const T &msg)
Returns the OutMessageKind enum value corresponding to a given outgoing message type.
constexpr bool isCommand(IRSOL_MAYBE_UNUSED T &msg)
Checks if a given incoming message type is a Command.
constexpr const char * OutMessageKindToString(OutMessageKind kind)
Converts an OutMessageKind enum to a human-readable string.
constexpr bool isSuccess(IRSOL_MAYBE_UNUSED T &msg)
Checks if a given outgoing message type is Success.
constexpr bool isColorImageBinaryData(IRSOL_MAYBE_UNUSED T &msg)
Checks if a given outgoing message type is ColorImageBinaryData.
OutMessageKind
Represents the type of an outgoing message.
constexpr bool isInquiry(IRSOL_MAYBE_UNUSED T &msg)
Checks if a given incoming message type is an Inquiry.
constexpr bool isBinaryDataBuffer(IRSOL_MAYBE_UNUSED T &msg)
Checks if a given outgoing message type is BinaryDataBuffer.
constexpr bool isAssignment(IRSOL_MAYBE_UNUSED T &msg)
Checks if a given incoming message type is an Assignment.
constexpr bool isImageBinaryData(IRSOL_MAYBE_UNUSED T &msg)
Checks if a given outgoing message type is ImageBinaryData (black & white).
constexpr const char * InMessageKindToString(InMessageKind kind)
Converts an InMessageKind enum to a human-readable string.
std::variant< Success, BinaryDataBuffer, ImageBinaryData, ColorImageBinaryData, Error > OutMessage
Variant type representing any outgoing message.
InMessageKind
Represents the type of an incoming message.
std::string toString(const InMessage &msg)
Converts an incoming message variant to a human-readable string.
constexpr InMessageKind getInMessageKind(IRSOL_MAYBE_UNUSED const T &msg)
Returns the InMessageKind enum value corresponding to a given incoming message type.
Common portability and diagnostic macros for the irsol library.
#define IRSOL_UNREACHABLE()
Indicates unreachable code to the compiler.
#define IRSOL_MISSING_TEMPLATE_SPECIALIZATION(T, funcNameLiteral)
Emits a compile-time error when no template specialization is available.
#define IRSOL_MAYBE_UNUSED
Suppresses compiler warnings about unused variables or parameters.
Template metaprogramming traits for type introspection in the irsol library.
Core type definitions for networking, time handling, and protocol values used throughout the irsol li...