![]() |
IRSOL
C++ code implementing socket server for interacting with Baumer camera.
|
Definitions and utilities for incoming and outgoing protocol messages. More...
#include "irsol/macros.hpp"
#include "irsol/protocol/message/binary.hpp"
#include "irsol/traits.hpp"
#include "irsol/types.hpp"
#include <string>
#include <variant>
Go to the source code of this file.
Namespaces | |
namespace | irsol |
namespace | irsol::protocol |
Core protocol message types, serialization, parsing, and communication utilities for the irsol framework. | |
Typedefs | |
using | irsol::protocol::InMessage = std::variant< Assignment, Inquiry, Command > |
Variant type representing any incoming message. | |
using | irsol::protocol::OutMessage = std::variant< Success, BinaryDataBuffer, ImageBinaryData, ColorImageBinaryData, Error > |
Variant type representing any outgoing message. | |
Enumerations | |
enum class | irsol::protocol::InMessageKind { irsol::protocol::InMessageKind::ASSIGNMENT , irsol::protocol::InMessageKind::INQUIRY , irsol::protocol::InMessageKind::COMMAND } |
Represents the type of an incoming message. More... | |
enum class | irsol::protocol::OutMessageKind { irsol::protocol::OutMessageKind::SUCCESS , irsol::protocol::OutMessageKind::BINARY_BUFFER , irsol::protocol::OutMessageKind::BW_IMAGE , irsol::protocol::OutMessageKind::COLOR_IMAGE , irsol::protocol::OutMessageKind::ERROR } |
Represents the type of an outgoing message. More... | |
Functions | |
constexpr const char * | irsol::protocol::InMessageKindToString (InMessageKind kind) |
Converts an InMessageKind enum to a human-readable string. | |
constexpr const char * | irsol::protocol::OutMessageKindToString (OutMessageKind kind) |
Converts an OutMessageKind enum to a human-readable string. | |
std::string | irsol::protocol::toString (const InMessage &msg) |
Converts an incoming message variant to a human-readable string. | |
std::string | irsol::protocol::toString (const OutMessage &msg) |
Converts an outgoing message variant to a human-readable string. | |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, InMessage >, int > = 0> | |
constexpr InMessageKind | irsol::protocol::getInMessageKind (IRSOL_MAYBE_UNUSED const T &msg) |
Returns the InMessageKind enum value corresponding to a given incoming message type. | |
InMessageKind | irsol::protocol::getInMessageKind (const InMessage &msg) |
Returns the InMessageKind enum value for a given incoming message variant. | |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, InMessage >, int > = 0> | |
constexpr bool | irsol::protocol::isAssignment (IRSOL_MAYBE_UNUSED T &msg) |
Checks if a given incoming message type is an Assignment. | |
bool | irsol::protocol::isAssignment (const InMessage &msg) |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, InMessage >, int > = 0> | |
constexpr bool | irsol::protocol::isInquiry (IRSOL_MAYBE_UNUSED T &msg) |
Checks if a given incoming message type is an Inquiry. | |
bool | irsol::protocol::isInquiry (const InMessage &msg) |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, InMessage >, int > = 0> | |
constexpr bool | irsol::protocol::isCommand (IRSOL_MAYBE_UNUSED T &msg) |
Checks if a given incoming message type is a Command. | |
bool | irsol::protocol::isCommand (const InMessage &msg) |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, OutMessage >, int > = 0> | |
constexpr OutMessageKind | irsol::protocol::getOutMessageKind (IRSOL_MAYBE_UNUSED const T &msg) |
Returns the OutMessageKind enum value corresponding to a given outgoing message type. | |
OutMessageKind | irsol::protocol::getOutMessageKind (const OutMessage &msg) |
Returns the OutMessageKind enum value for a given outgoing message variant. | |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, OutMessage >, int > = 0> | |
constexpr bool | irsol::protocol::isSuccess (IRSOL_MAYBE_UNUSED T &msg) |
Checks if a given outgoing message type is Success. | |
bool | irsol::protocol::isSuccess (const OutMessage &msg) |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, OutMessage >, int > = 0> | |
constexpr bool | irsol::protocol::isBinaryDataBuffer (IRSOL_MAYBE_UNUSED T &msg) |
Checks if a given outgoing message type is BinaryDataBuffer. | |
bool | irsol::protocol::isBinaryDataBuffer (const OutMessage &msg) |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, OutMessage >, int > = 0> | |
constexpr bool | irsol::protocol::isImageBinaryData (IRSOL_MAYBE_UNUSED T &msg) |
Checks if a given outgoing message type is ImageBinaryData (black & white). | |
bool | irsol::protocol::isImageBinaryData (const OutMessage &msg) |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, OutMessage >, int > = 0> | |
constexpr bool | irsol::protocol::isColorImageBinaryData (IRSOL_MAYBE_UNUSED T &msg) |
Checks if a given outgoing message type is ColorImageBinaryData. | |
bool | irsol::protocol::isColorImageBinaryData (const OutMessage &msg) |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, OutMessage >, int > = 0> | |
constexpr bool | irsol::protocol::isError (IRSOL_MAYBE_UNUSED T &msg) |
Checks if a given outgoing message type is Error. | |
bool | irsol::protocol::isError (const OutMessage &msg) |
Definitions and utilities for incoming and outgoing protocol messages.
This header provides the core types, enums, and helper functions related to the representation and handling of protocol messages exchanged in the irsol system.
It defines:
InMessageKind
) and outgoing (OutMessageKind
) messages.InMessage
, OutMessage
) that represent all supported message types.The incoming messages cover Assignments, Inquiries, and Commands. The outgoing messages cover Success acknowledgments, Binary data buffers, Black & White images, Color images, and Error reports.
Definition in file variants.hpp.