|
TEC
A lightweight C++ library enabling safe, efficient execution in multithreaded and concurrent systems.
|
Defines a flexible message type and helper functions for the tec namespace. More...
#include <any>#include "tec/tec_def.hpp"#include "tec/tec_status.hpp"#include "tec/tec_signal.hpp"Go to the source code of this file.
Classes | |
| struct | tec::Payload |
| A message used for RPC-style calls. More... | |
Typedefs | |
| using | tec::Message = std::any |
| Type alias for a message that can hold any object. | |
| using | tec::Request = std::any |
| Type alias for a request object that can hold any object. | |
| using | tec::Reply = std::any |
| Type alias for a reply object that can hold any object. | |
Functions | |
Message Helper Functions | |
Utility functions for working with Message objects. | |
| Message | tec::nullmsg () noexcept |
| Creates a null message. | |
| bool | tec::is_null (const Message &msg) noexcept |
| Checks if a message is null. | |
| auto | tec::name (const Message &msg) noexcept |
| Retrieves the type name of a message's content for registering the corresponding message handler. | |
Defines a flexible message type and helper functions for the tec namespace.
| using tec::Message = typedef std::any |
Type alias for a message that can hold any object.
Uses std::any to store arbitrary data types, intended for use in message passing systems, such as processing by a Worker in the tec library. The null message (empty std::any) is used to signal the Worker to exit its message loop.
| using tec::Reply = typedef std::any |
Type alias for a reply object that can hold any object.
| using tec::Request = typedef std::any |
Type alias for a request object that can hold any object.
Checks if a message is null.
Determines whether the provided Message is empty (has no value).
| msg | The Message to check. |
Retrieves the type name of a message's content for registering the corresponding message handler.
Returns the type name of the object stored in the Message.
| msg | The Message whose type name is to be retrieved. |
|
inlinenoexcept |
Creates a null message.
Returns an empty Message (std::any with no value) used to signal a Worker to exit its message loop.