OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
MessageRecipe< Holder, Operations > Class Template Reference

#include <OnixS/CME/MDH/testing/MessageOperation.h>

Public Types

using HolderType = Holder

Public Member Functions

 MessageRecipe (std::tuple< Operations... > operations)
void applyTo (Holder &holder) const
Holder & operator() (Holder &holder) const
template<typename Operation>
auto append (Operation &&operation) const &-> typename details::ApplicableMessageOperationResult< Holder, Operation, MessageRecipe< Holder, Operations..., typename std::decay< Operation >::type > >::Type
template<typename Operation>
auto append (Operation &&operation) &&-> typename details::ApplicableMessageOperationResult< Holder, Operation, MessageRecipe< Holder, Operations..., typename std::decay< Operation >::type > >::Type
template<typename Callable>
auto operator% (Callable &&callable) const &-> decltype(std::declval< const MessageRecipe & >().append(details::makeMessageOperation< details::CallableOperation >(std::forward< Callable >(callable))))
template<typename Callable>
auto operator% (Callable &&callable) &&-> decltype(std::move(*this).append(details::makeMessageOperation< details::CallableOperation >(std::forward< Callable >(callable))))

Friends

template<typename, typename...>
class MessageRecipe

Detailed Description

template<typename Holder, typename... Operations>
class OnixS::CME::MDH::Test::MessageRecipe< Holder, Operations >
Template Parameters
HolderMessage holder materialized by the recipe.
OperationsOrdered message operations owned by the recipe.
Note
A recipe does not contain a message buffer. Materializing it constructs and populates a caller-supplied holder without dynamic allocation.
Operations own their decay-copied argument objects. Storage referenced indirectly by pointer-like or view-like arguments is borrowed and must remain valid until every application of the recipe has completed.

Definition at line 347 of file MessageOperation.h.

Member Typedef Documentation

◆ HolderType

template<typename Holder, typename... Operations>
using HolderType = Holder

Holder type materialized by this recipe.

Definition at line 353 of file MessageOperation.h.

Constructor & Destructor Documentation

◆ MessageRecipe()

template<typename Holder, typename... Operations>
MessageRecipe ( std::tuple< Operations... > operations)
inlineexplicit

Constructs a recipe from its owned operations.

Parameters
operationsOperations to apply in tuple order.
Exceptions
Anyexception thrown while moving the operations into the recipe.

Definition at line 358 of file MessageOperation.h.

Member Function Documentation

◆ append() [1/2]

template<typename Holder, typename... Operations>
template<typename Operation>
auto append ( Operation && operation) && -> typename details::ApplicableMessageOperationResult< Holder, Operation, MessageRecipe< Holder, Operations..., typename std::decay< Operation >::type > >::Type
inline

Returns a recipe with one operation appended.

Template Parameters
OperationMessage operation type whose decay-stored form can be applied through a const reference to Holder.
Parameters
operationOperation moved into the returned recipe when possible.
Returns
Extended recipe owning the current and appended operations.
Exceptions
Anyexception thrown while moving an operation.

Definition at line 409 of file MessageOperation.h.

◆ append() [2/2]

template<typename Holder, typename... Operations>
template<typename Operation>
auto append ( Operation && operation) const & -> typename details::ApplicableMessageOperationResult< Holder, Operation, MessageRecipe< Holder, Operations..., typename std::decay< Operation >::type > >::Type
inline

Returns a recipe with one operation appended.

Template Parameters
OperationMessage operation type whose decay-stored form can be applied through a const reference to Holder.
Parameters
operationOperation copied or moved into the returned recipe.
Returns
Extended recipe; this recipe remains unchanged.
Exceptions
Anyexception thrown while copying or moving an operation.

Definition at line 395 of file MessageOperation.h.

◆ applyTo()

template<typename Holder, typename... Operations>
void applyTo ( Holder & holder) const
inline

Initializes and populates a holder from this recipe.

Parameters
holderHolder receiving the recipe's operations.
Note
Operations are applied from left to right. The recipe is unchanged and can be applied again to another holder.
This function does not roll back mutations when an operation throws. The holder retains the effects of preceding operations and any partial effects produced by the throwing operation.
Exceptions
Anyexception thrown by an owned operation.

Definition at line 371 of file MessageOperation.h.

◆ operator%() [1/2]

template<typename Holder, typename... Operations>
template<typename Callable>
auto operator% ( Callable && callable) && -> decltype( std::move(*this).append( details::makeMessageOperation< details::CallableOperation >(std::forward< Callable >(callable))))
inline

Returns a recipe with an underlying-message customization appended.

Template Parameters
CallableCallable type invoked with the mutable underlying message.
Parameters
callableCallable moved into the returned recipe when possible.
Returns
Extended recipe owning the current operations and customization.
Note
Use the infix form recipe % callable.
Remainder has higher precedence than bitwise OR, so the customization is appended before the next pipeline stage. The callable's return value is ignored. Reference captures must remain valid until every recipe application completes.
The stored callable must be invocable through a const reference; mutable lambdas are not supported by reusable recipes.
Warning
Do not retain repeating-group entry views obtained by callable after it returns. Growing any earlier repeating group can relocate and invalidate them.
Exceptions
Anyexception thrown while storing, moving, or invoking the callable.

Definition at line 452 of file MessageOperation.h.

◆ operator%() [2/2]

template<typename Holder, typename... Operations>
template<typename Callable>
auto operator% ( Callable && callable) const & -> decltype( std::declval< const MessageRecipe & >().append( details::makeMessageOperation< details::CallableOperation >(std::forward< Callable >(callable))))
inline

Returns a recipe with an underlying-message customization appended.

Template Parameters
CallableCallable type invoked with the mutable underlying message.
Parameters
callableCallable copied or moved into the returned recipe.
Returns
Extended recipe; this recipe remains unchanged.
Note
Use the infix form recipe % callable.
Remainder has higher precedence than bitwise OR, so the customization is appended before the next pipeline stage. The callable's return value is ignored. Reference captures must remain valid until every recipe application completes.
The stored callable must be invocable through a const reference; mutable lambdas are not supported by reusable recipes.
Warning
Do not retain repeating-group entry views obtained by callable after it returns. Growing any earlier repeating group can relocate and invalidate them.
Exceptions
Anyexception thrown while storing, copying, or invoking the callable.

Definition at line 430 of file MessageOperation.h.

◆ operator()()

template<typename Holder, typename... Operations>
Holder & operator() ( Holder & holder) const
inline

Initializes and populates a holder from this recipe.

Parameters
holderHolder receiving the recipe's operations.
Returns
The supplied holder.
Note
This is the callable form of applyTo and preserves its operation ordering, repeatability, and partial-mutation behavior.
Exceptions
Anyexception thrown by an owned operation.

Definition at line 382 of file MessageOperation.h.

◆ MessageRecipe

template<typename Holder, typename... Operations>
template<typename, typename...>
friend class MessageRecipe
friend

Definition at line 349 of file MessageOperation.h.