|
Fray Engine
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | Prefix |
| Fixed-size routing prefix at the start of every frame; routers read only this. All integers are big-endian on the wire. Layout: 0 version | 1 destinationKind | 2-5 destinationId | 6 senderKind | 7-10 senderId 11-14 operationId | 15-18 length | 19-22 headerLength | 23-38 uid | 39 category. More... | |
| struct | InData |
| A parsed incoming message. The payload is a view into the frame, which this keeps alive via shared ownership. More... | |
| struct | FrameOptions |
| Everything FrameBuilder needs to build one outgoing Engine message. More... | |
| class | FrameBuilder |
| Builds outgoing frames sent by the Engine (sender is always the Engine). Stateless; safe to use from any thread. More... | |
Functions | |
| bool | isCommand (const Prefix &prefix, F_ulong id) |
| Tests whether a prefix identifies a command. | |
| bool | isNotice (const Prefix &prefix, F_ulong id) |
| Tests whether a prefix identifies a protocol notification. | |
| bool | isControl (const Prefix &prefix) |
| Identifies readiness and health control frames. | |
| bool | isConsoleCommand (const Prefix &prefix) |
| Identifies commands the Console shows as entries. Control traffic and the Console's own log and entry traffic are left out, or every line would produce another entry. | |
| bool | wantsLog (std::uint32_t flags) |
| Tests whether a message's header flags leave it in the disk log. | |
| bool | wantsConsole (std::uint32_t flags) |
| Tests whether a message's header flags leave it in the Console. | |
| bool | isTracked (const Prefix &prefix, std::uint32_t flags) |
| Identifies messages the Engine router logs, shows in the Console, or both. | |
| void | encodePrefix (const Prefix &p, F_uchar *out) |
| Serializes a prefix into its PREFIX_SIZE-byte big-endian wire form. | |
| F_err | decodePrefix (const F_uchar *data, size_t size, Prefix &out) |
| Parses and validates a prefix from received bytes. | |
| std::shared_ptr< const std::vector< F_uchar > > | assignUid (const std::shared_ptr< const std::vector< F_uchar > > &frame, Prefix &prefix) |
| Assigns a random 128-bit UID to a frame whose prefix does not have one. Existing UIDs are preserved; input frame bytes remain unchanged. | |
| F_err | buildFrame (Prefix prefix, const Header &header, const F_uchar *payload, size_t payloadSize, std::vector< F_uchar > &out) |
| Builds a complete frame (prefix + protobuf header + payload) into a byte vector. The prefix's length and headerLength fields are filled in from the header and payload. | |
| const char * | processName (ProcessKind kind) |
| Human-readable name of a process kind, also used as the header sender/destination name. | |
| std::string | processInstanceName (ProcessKind kind, std::uint32_t id) |
| Names a process instance for readiness diagnostics. | |
| uint64_t | nextMessageId () |
| Returns the next message ID. Message IDs are unique per sender, so every engine message takes its ID from here. Thread-safe (atomic counter); starts at 1. | |
| bool | validMulticastRecipients (const Header &header) |
| Validates the explicit destinations of a multicast header. | |
| F_err | parseFrame (std::shared_ptr< const std::vector< F_uchar > > frame, InData &out) |
| Parses the header of a complete frame. The payload is not read or copied. | |
Variables | |
| constexpr F_uchar | PREFIX_VERSION = 0 |
| Wire format version written to, and required in, byte 0 of every prefix. | |
| constexpr std::uint32_t | PROTOCOL_VERSION = 0 |
| Version written to the protobuf message header. | |
| constexpr std::uint32_t | LOADING_WINDOW_ID = 0 |
| Renderer instance ID assigned to the loading window. | |
| constexpr std::uint32_t | MAIN_WINDOW_ID = 1 |
| Renderer instance ID assigned to the first application window. | |
| constexpr size_t | PREFIX_SIZE = 40 |
| Size in bytes of the fixed binary routing prefix. | |
| constexpr F_ulong | MAX_FRAME_LENGTH = 16 * 1024 * 1024 |
| Largest allowed value of the prefix length field (header + payload). Checked before any buffer is allocated. | |
| constexpr std::uint32_t | SILENT_FLAGS = MESSAGE_FLAG_NO_LOG | MESSAGE_FLAG_NO_CONSOLE |
|
inline |
Assigns a random 128-bit UID to a frame whose prefix does not have one. Existing UIDs are preserved; input frame bytes remain unchanged.
| frame | Complete validated frame. |
| prefix | Decoded prefix, updated with the assigned UID. |
Definition at line 282 of file message.hpp.
|
inline |
Builds a complete frame (prefix + protobuf header + payload) into a byte vector. The prefix's length and headerLength fields are filled in from the header and payload.
| prefix | Routing prefix, taken by value; its length fields are overwritten. |
| header | Protobuf header to serialize. |
| payload | Opaque payload bytes; may be null only when payloadSize is 0. |
| payloadSize | Number of payload bytes. |
| out | Receives the frame only on success. |
Definition at line 306 of file message.hpp.
Parses and validates a prefix from received bytes.
| data | Start of the received bytes. |
| size | Number of bytes available at data. |
| out | Receives the prefix only when NONE is returned; untouched otherwise. |
Definition at line 243 of file message.hpp.
Serializes a prefix into its PREFIX_SIZE-byte big-endian wire form.
| p | Prefix to write. |
| out | Destination buffer; must hold at least PREFIX_SIZE bytes. |
Definition at line 219 of file message.hpp.
Tests whether a prefix identifies a command.
| prefix | Decoded routing prefix. |
| id | Command identifier to match. |
Definition at line 81 of file message.hpp.
|
inline |
Identifies commands the Console shows as entries. Control traffic and the Console's own log and entry traffic are left out, or every line would produce another entry.
| prefix | Decoded routing prefix. |
Definition at line 119 of file message.hpp.
|
inline |
Identifies readiness and health control frames.
| prefix | Decoded routing prefix. |
Definition at line 106 of file message.hpp.
Tests whether a prefix identifies a protocol notification.
| prefix | Decoded routing prefix. |
| id | Notification identifier to match. |
Definition at line 94 of file message.hpp.
|
inline |
Identifies messages the Engine router logs, shows in the Console, or both.
| prefix | Decoded routing prefix. |
| flags | Header flags (MessageFlag bits). |
Definition at line 157 of file message.hpp.
|
inline |
Returns the next message ID. Message IDs are unique per sender, so every engine message takes its ID from here. Thread-safe (atomic counter); starts at 1.
Definition at line 385 of file message.hpp.
|
inline |
Parses the header of a complete frame. The payload is not read or copied.
| frame | Complete frame (prefix + header + payload); the result shares ownership of it. |
| out | Receives the parsed message only on success. |
Definition at line 511 of file message.hpp.
|
inline |
Names a process instance for readiness diagnostics.
| kind | Process kind. |
| id | Process instance ID. |
Definition at line 364 of file message.hpp.
|
inline |
Human-readable name of a process kind, also used as the header sender/destination name.
| kind | Process kind to name. |
Definition at line 342 of file message.hpp.
|
inline |
Validates the explicit destinations of a multicast header.
| header | Decoded header containing the recipient list. |
Definition at line 431 of file message.hpp.
|
inline |
Tests whether a message's header flags leave it in the Console.
| flags | Header flags (MessageFlag bits). |
Definition at line 145 of file message.hpp.
|
inline |
Tests whether a message's header flags leave it in the disk log.
| flags | Header flags (MessageFlag bits). |
Definition at line 134 of file message.hpp.
|
constexpr |
Renderer instance ID assigned to the loading window.
Definition at line 38 of file message.hpp.
|
constexpr |
Renderer instance ID assigned to the first application window.
Definition at line 40 of file message.hpp.
|
constexpr |
Largest allowed value of the prefix length field (header + payload). Checked before any buffer is allocated.
Definition at line 44 of file message.hpp.
|
constexpr |
Size in bytes of the fixed binary routing prefix.
Definition at line 42 of file message.hpp.
|
constexpr |
Wire format version written to, and required in, byte 0 of every prefix.
Definition at line 34 of file message.hpp.
|
constexpr |
Version written to the protobuf message header.
Definition at line 36 of file message.hpp.
|
constexpr |
Flags for frames that are neither logged nor shown in the Console: readiness and health traffic, and the shutdown command.
Definition at line 392 of file message.hpp.