template<typename MessageTypeT, size_t MaxMessageSize = Messaging::MaxMessageSize>
class OnixS::CME::MDH::Test::MessageHolder< MessageTypeT, MaxMessageSize >
The storage contains a MessagePrefix followed by an SBE-encoded message. Both binary SBE message types and tag-based FIX message types are supported; the latter provide a tag-based view of the same SBE payload.
The message wrapper, buffer pointer, and direct references returned by this class refer to the holder's owned storage and remain valid until the holder is destroyed. Views of repeating-group entries have a shorter lifetime: growing any earlier repeating group can relocate and invalidate them, so reacquire entry views after structural message changes. The holder is therefore neither copyable nor movable.
The message prefix does not track mutations automatically. Call setHeader() after populating or changing the message and before consuming the encoded buffer.
- Template Parameters
-
| MessageTypeT | Binary SBE message type or tag-based FIX message type to store. |
| MaxMessageSize | Maximum encoded message size in bytes, excluding the message prefix. The value must accommodate the message's minimum encoded size and must not exceed Messaging::MaxMessageSize. |
Definition at line 152 of file MessageHolder.h.
template<typename MessageTypeT, size_t MaxMessageSize = Messaging::MaxMessageSize>
Constructs an empty message for a schema version.
The message wrapper is initialized over the owned payload storage. The prefix initially reports only its own size because no payload size has been committed; call setHeader() after populating the message.
- Parameters
-
| version | Schema version used to initialize the encoded message. |
Definition at line 173 of file MessageHolder.h.
template<typename MessageTypeT, size_t MaxMessageSize = Messaging::MaxMessageSize>
template<typename Callable>
| auto operator% |
( |
Callable && | callable | ) |
& -> decltype( std::forward< Callable >(callable)(std::declval< MessageType & >()), std::declval< MessageHolder & >()) |
|
inline |
Applies a callable customization to the stored message.
- Template Parameters
-
| Callable | Callable type invoked with the mutable underlying message. |
- Parameters
-
| callable | Callable to invoke immediately. |
- Returns
- This holder, allowing multiple customizations to be chained.
- Note
- Use the infix form holder % callable. The holder must be a named, mutable object; temporary and const holders are not supported.
-
The callable's return value is ignored. Mutable callables are supported.
- Warning
- Do not retain repeating-group entry views obtained by
callable. Growing any earlier repeating group can relocate and invalidate them; acquire a fresh view after structural message changes.
- Exceptions
-
| Any | exception thrown by the callable. |
Definition at line 233 of file MessageHolder.h.