COMMS
Template library intended to help with implementation of communication protocols.
Namespaces | Classes | Typedefs | Enumerations | Functions
comms Namespace Reference

Main namespace for all classes / functions of COMMS library. More...

Detailed Description

Main namespace for all classes / functions of COMMS library.

Namespaces

 field
 Namespace that contains definitions of all message fields.
 
 option
 Namespace that contains all the options used to define protocol as well as customize application specific configuration.
 
 protocol
 Namespace that contains definition of layers that can be used to wrap message data with transport data.
 
 traits
 Namespace for various traits tag classes.
 
 units
 Namespace containing units conversion operations.
 
 util
 Namespace for various utility classes and/or functions used by COMMS library.
 

Classes

class  Assert
 Base class for any custom assertion behaviour. More...
 
class  EmptyHandler
 Empty message handler, does nothing. More...
 
class  EnableAssert
 Enable new assertion behaviour. More...
 
class  Field
 Base class to all the field classes. More...
 
class  GenericHandler
 Generic common message handler. More...
 
class  GenericMessage
 Generic Message. More...
 
class  Message
 Main interface class for all the messages. More...
 
class  MessageBase
 Base class for all the custom protocol messages. More...
 
class  MsgDispatcher
 An auxiliary class to force a particular way of dispatching message to its handler. More...
 
class  MsgFactory
 Message factory class. More...
 

Typedefs

template<typename TFieldBase , typename TExtraOpts = comms::option::app::EmptyOption>
using GenericMessageFields = std::tuple< comms::field::ArrayList< TFieldBase, std::uint8_t, TExtraOpts > >
 Definition of fields for comms::GenericMessage message. More...
 
template<typename TMsg , typename TDefaultType = std::intmax_t>
using MessageIdType = typename comms::util::LazyDeepConditional< TMsg::InterfaceOptions::HasMsgIdType >::template Type< comms::details::MessageIdTypeRetriever, comms::util::AliasType, TDefaultType, TMsg >
 Get type of message ID used by interface class. More...
 

Enumerations

enum class  ErrorStatus {
  Success , UpdateRequired , NotEnoughData , ProtocolError ,
  BufferOverflow , InvalidMsgId , InvalidMsgData , MsgAllocFailure ,
  NotSupported , NumOfErrorStatuses
}
 Error statuses reported by the Communication module. More...
 
enum class  MsgFactoryCreateFailureReason { None , InvalidId , AllocFailure , NumOfValues }
 

Functions

template<typename T >
details::ValueAssignWrapper< T > cast_assign (T &value)
 Helper function to assign value with static_cast to appropriate type. More...
 
template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto dispatchMsg (TId &&id, std::size_t index, TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using either "polymorphic" or "static binary search" behavior. More...
 
template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto dispatchMsg (TId &&id, TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using either "polymorphic" or "static binary search" behavior. More...
 
template<typename TAllMessages , typename TMsg , typename THandler >
auto dispatchMsg (TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using either "polymorphic" or "static binary search" behavior. More...
 
template<typename TMsg , typename THandler >
constexpr bool dispatchMsgIsDirect ()
 Compile time check whether the message object can use its own polymorphic dispatch() (see Polymorphic Dispatch Message for Handling) when dispatchMsg() is invoked. More...
 
template<typename TMsg , typename THandler >
constexpr bool dispatchMsgIsDirect (TMsg &&msg, THandler &&handler)
 Similar to other dispatchMsgIsDirect(), but can help in deducing template arguments. More...
 
template<typename TAllMessages , typename TMsg , typename THandler >
constexpr bool dispatchMsgIsPolymorphic ()
 Compile time check whether the dispatchMsg() will use "polymorphic" (including "direct") dispatch for provided tuple of messages and handler. More...
 
template<typename TAllMessages , typename TMsg , typename THandler >
constexpr bool dispatchMsgIsPolymorphic (TMsg &&msg, THandler &&handler)
 Similar to other dispatchMsgIsPolymorphic(), but can help in deducing template arguments. More...
 
template<typename TAllMessages , typename TMsg , typename THandler >
constexpr bool dispatchMsgIsStaticBinSearch ()
 Compile time check whether the dispatchMsg() will use "static binary search" dispatch for provided tuple of messages and handler. More...
 
template<typename TAllMessages , typename TMsg , typename THandler >
constexpr bool dispatchMsgIsStaticBinSearch (TMsg &&msg, THandler &&handler)
 Similar to other dispatchMsgIsStaticBinSearch(), but can help in deducing template arguments. More...
 
template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto dispatchMsgLinearSwitch (TId &&id, std::size_t index, TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using linear switch behavior. More...
 
template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto dispatchMsgLinearSwitch (TId &&id, TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using linear switch behavior. More...
 
template<typename TAllMessages , typename TMsg , typename THandler >
auto dispatchMsgLinearSwitch (TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using linear switch behavior. More...
 
template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto dispatchMsgPolymorphic (TId &&id, std::size_t index, TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using polymorphic behavior. More...
 
template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto dispatchMsgPolymorphic (TId &&id, TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using polymorphic behavior. More...
 
template<typename TAllMessages , typename TMsg , typename THandler >
auto dispatchMsgPolymorphic (TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using polymorphic behavior. More...
 
template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto dispatchMsgStaticBinSearch (TId &&id, std::size_t index, TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using static binary search behavior. More...
 
template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto dispatchMsgStaticBinSearch (TId &&id, TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using static binary search behavior. More...
 
template<typename TAllMessages , typename TMsg , typename THandler >
auto dispatchMsgStaticBinSearch (TMsg &msg, THandler &handler) -> details::MessageInterfaceDispatchRetType< typename std::decay< decltype(handler)>::type >
 Dispatch message object into appropriate handle() function in the provided handler using static binary search behavior. More...
 
template<typename TAllMessages , typename TId , typename THandler >
bool dispatchMsgType (TId &&id, std::size_t index, THandler &handler)
 Dispatch message id into appropriate handle() function in the provided handler using either "polymorphic" or "static binary search" behavior. More...
 
template<typename TAllMessages , typename TId , typename THandler >
bool dispatchMsgType (TId &&id, THandler &handler)
 Dispatch message id into appropriate handle() function in the provided handler using either "polymorphic" or "static binary search" behavior. More...
 
template<typename TAllMessages , typename TId >
std::size_t dispatchMsgTypeCountStaticBinSearch (TId &&id)
 Count number of message types in the provided tuple that have the requested numeric ID. More...
 
template<typename TAllMessages >
constexpr bool dispatchMsgTypeIsPolymorphic ()
 Compile time check whether the dispatchMsgType() will use "polymorphic" dispatch for provided tuple of messages. More...
 
template<typename TAllMessages >
constexpr bool dispatchMsgTypeIsStaticBinSearch ()
 Compile time check whether the dispatchMsgType() or dispatchMsgType() will use "static binary search" dispatch for provided tuple of messages. More...
 
template<typename TAllMessages , typename TId , typename THandler >
bool dispatchMsgTypeLinearSwitch (TId &&id, std::size_t index, THandler &handler)
 Dispatch message id into appropriate handle() function in the provided handler using linear switch behavior. More...
 
template<typename TAllMessages , typename TId , typename THandler >
bool dispatchMsgTypeLinearSwitch (TId &&id, THandler &handler)
 Dispatch message id into appropriate handle() function in the provided handler using linear switch behavior. More...
 
template<typename TAllMessages , typename TId , typename THandler >
bool dispatchMsgTypePolymorphic (TId &&id, std::size_t index, THandler &handler)
 Dispatch message id into appropriate handle() function in the provided handler using polymorphic behavior. More...
 
template<typename TAllMessages , typename TId , typename THandler >
bool dispatchMsgTypePolymorphic (TId &&id, THandler &handler)
 Dispatch message id into appropriate handle() function in the provided handler using polymorphic behavior. More...
 
template<typename TAllMessages , typename TId , typename THandler >
bool dispatchMsgTypeStaticBinSearch (TId &&id, std::size_t index, THandler &handler)
 Dispatch message id into appropriate handle() function in the provided handler using static binary search behavior. More...
 
template<typename TAllMessages , typename TId , typename THandler >
bool dispatchMsgTypeStaticBinSearch (TId &&id, THandler &handler)
 Dispatch message id into appropriate handle() function in the provided handler using static binary search behavior. More...
 
template<typename TFieldTo , typename TFieldFrom >
TFieldTo field_cast (const TFieldFrom &field)
 Cast between fields. More...
 
template<typename T >
constexpr bool isMessage ()
 Compile time check of of whether the type is a message. More...
 
template<typename T >
constexpr bool isMessageBase ()
 Compile time check of of whether the type is a message extending comms::MessageBase. More...
 
template<typename TBufIter , typename TFrame , typename THandler , typename... TExtraValues>
std::size_t processAllWithDispatch (TBufIter bufIter, std::size_t len, TFrame &&frame, THandler &handler)
 Process all available input and dispatch all created message objects to appropriate handling function. More...
 
template<typename TDispatcher , typename TBufIter , typename TFrame , typename THandler , typename... TExtraValues>
std::size_t processAllWithDispatchViaDispatcher (TBufIter bufIter, std::size_t len, TFrame &&frame, THandler &handler)
 Process all available input and dispatch all created message objects to appropriate handling function. More...
 
template<typename TBufIter , typename TFrame , typename TMsg , typename... TExtraValues>
comms::ErrorStatus processSingle (TBufIter &bufIter, std::size_t len, TFrame &&frame, TMsg &msg, TExtraValues... extraValues)
 Process input until first message is recognized and its object is created or missing data is reported. More...
 
template<typename TBufIter , typename TFrame , typename TMsg , typename THandler , typename... TExtraValues>
comms::ErrorStatus processSingleWithDispatch (TBufIter &bufIter, std::size_t len, TFrame &&frame, TMsg &msg, THandler &handler, TExtraValues... extraValues)
 Process input until first message is recognized, its object is created and dispatched to appropriate handling function, or missing data is reported. More...
 
template<typename TDispatcher , typename TBufIter , typename TFrame , typename TMsg , typename THandler , typename... TExtraValues>
comms::ErrorStatus processSingleWithDispatchViaDispatcher (TBufIter &bufIter, std::size_t len, TFrame &&frame, TMsg &msg, THandler &handler, TExtraValues... extraValues)
 Process input until first message is recognized, its object is created and dispatched to appropriate handling function, or missing data is reported. More...
 
template<typename TMessage , typename TIter >
auto readIteratorFor (TIter &&iter) -> decltype(details::ReadIteratorHelper<>::template get< TMessage >(std::forward< TIter >(iter)))
 Create and initialise iterator for message read. More...
 
template<typename TMessage , typename TIter >
auto readIteratorFor (TMessage &&msg, TIter &&iter) -> decltype(details::ReadIteratorHelper<>::template get< typename std::decay< decltype(msg)>::type >(std::forward< TIter >(iter)))
 Create and initialise iterator for message read. More...
 
template<typename... TOptions>
const Message< TOptions... > & toMessage (const Message< TOptions... > &msg)
 Upcast type of the message object to comms::Message in order to have access to its internal types.
 
template<typename... TOptions>
Message< TOptions... > & toMessage (Message< TOptions... > &msg)
 Upcast type of the message object to comms::Message in order to have access to its internal types.
 
template<typename TMessage , typename... TOptions>
const MessageBase< TMessage, TOptions... > & toMessageBase (const MessageBase< TMessage, TOptions... > &msg)
 Upcast type of the message object to comms::MessageBase in order to have access to its internal types.
 
template<typename TMessage , typename... TOptions>
MessageBase< TMessage, TOptions... > & toMessageBase (MessageBase< TMessage, TOptions... > &msg)
 Upcast type of the message object to comms::MessageBase in order to have access to its internal types.
 
constexpr unsigned version ()
 Version of the COMMS library as single numeric value.
 
constexpr unsigned versionCreate (unsigned major, unsigned minor, unsigned patch)
 Create version of the library as single unsigned numeric value.
 
constexpr unsigned versionMajor ()
 Major verion of the library.
 
constexpr unsigned versionMinor ()
 Minor verion of the library.
 
constexpr unsigned versionPatch ()
 Patch level of the library.
 
template<typename TMessage , typename TIter >
auto writeIteratorFor (TIter &&iter) -> decltype(details::WriteIteratorHelper<>::template get< TMessage >(std::forward< TIter >(iter)))
 Create and initialise iterator for message write. More...
 
template<typename TMessage , typename TIter >
auto writeIteratorFor (TMessage &&msg, TIter &&iter) -> decltype(details::WriteIteratorHelper<>::template get< typename std::decay< decltype(msg)>::type >(std::forward< TIter >(iter)))
 Create and initialise iterator for message write. More...
 

Typedef Documentation

◆ GenericMessageFields

template<typename TFieldBase , typename TExtraOpts = comms::option::app::EmptyOption>
using comms::GenericMessageFields = typedef std::tuple< comms::field::ArrayList< TFieldBase, std::uint8_t, TExtraOpts > >

Definition of fields for comms::GenericMessage message.

Defined as single variable length raw bytes sequence (comms::field::ArrayList).

Template Parameters
Baseclass for the sequence field definition, expected to be a variant of comms::Field
Extraoption(s) (bundled as std::tuple if multiple) to be passed to comms::field::ArrayList field definition.

◆ MessageIdType

template<typename TMsg , typename TDefaultType = std::intmax_t>
using comms::MessageIdType = typedef typename comms::util::LazyDeepConditional< TMsg::InterfaceOptions::HasMsgIdType >::template Type< comms::details::MessageIdTypeRetriever, comms::util::AliasType, TDefaultType, TMsg >

Get type of message ID used by interface class.

In case common interface class defines its message ID type (using comms::option::MsgIdType option) the latter is returned, otherwise the default type (TDefaultType) is reported.

Template Parameters
TMsgMessage interface class (extended or typedef-ed comms::Message)
TDefaultTypeDefault type to return in case message interface class doesn't define its ID type

Enumeration Type Documentation

◆ ErrorStatus

enum comms::ErrorStatus
strong

Error statuses reported by the Communication module.

Enumerator
Success 

Used to indicate successful outcome of the operation.

UpdateRequired 

Used to indicate that write operation wasn't complete, call to update(...) is required.

NotEnoughData 

Used to indicate that stream buffer didn't contain enough data to complete read operation.

ProtocolError 

Used to indicate that any of the used protocol layers encountered an error while processing the data.

BufferOverflow 

Used to indicate that stream buffer was overflowed when attempting to write data.

InvalidMsgId 

Used to indicate that received message has unknown id.

InvalidMsgData 

Used to indicate that a message has invalid data.

MsgAllocFailure 

Used to indicate that message allocation has failed.

NotSupported 

The operation is not supported.

NumOfErrorStatuses 

Number of supported error statuses, must be last.

◆ MsgFactoryCreateFailureReason

Enumerator
None 

No reason.

InvalidId 

Invalid message id.

AllocFailure 

Allocation of the object has failied.

NumOfValues 

Number of available values, must be last.

Function Documentation

◆ cast_assign()

template<typename T >
details::ValueAssignWrapper<T> comms::cast_assign ( T &  value)

Helper function to assign value with static_cast to appropriate type.

Can be used to assign any value, including value of a field.

auto someValue = ...;
comms::cast_assign(field.value()) = someValue; // Sets field's value with appropriate static_cast.
details::ValueAssignWrapper< T > cast_assign(T &value)
Helper function to assign value with static_cast to appropriate type.
Definition: cast.h:29
Note
Defined in "comms/cast.h" headerfile

◆ dispatchMsg() [1/3]

template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto comms::dispatchMsg ( TId &&  id,
std::size_t  index,
TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using either "polymorphic" or "static binary search" behavior.

The function performs compile time evaluation of the provided TAllMessages tuple and uses logic described in Default Way to Dispatch to choose the way to dispatch.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]indexIndex (or offset) of the message type among those having the same ID.
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page.
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h
See also
dispatchMsgIsPolymorphic()
dispatchMsgIsStaticBinSearch()
dispatchMsgIsDirect();

◆ dispatchMsg() [2/3]

template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto comms::dispatchMsg ( TId &&  id,
TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using either "polymorphic" or "static binary search" behavior.

The function performs compile time evaluation of the provided TAllMessages tuple and uses logic described in Default Way to Dispatch to choose the way to dispatch.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page.
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h
See also
dispatchMsgIsPolymorphic()
dispatchMsgIsStaticBinSearch()
dispatchMsgIsDirect();

◆ dispatchMsg() [3/3]

template<typename TAllMessages , typename TMsg , typename THandler >
auto comms::dispatchMsg ( TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using either "polymorphic" or "static binary search" behavior.

The function performs compile time evaluation of the provided TAllMessages tuple and uses logic described in Default Way to Dispatch to choose the way to dispatch.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page.
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h
See also
dispatchMsgIsPolymorphic()
dispatchMsgIsStaticBinSearch()
dispatchMsgIsDirect();

◆ dispatchMsgIsDirect() [1/2]

template<typename TMsg , typename THandler >
constexpr bool comms::dispatchMsgIsDirect ( )
constexpr

Compile time check whether the message object can use its own polymorphic dispatch() (see Polymorphic Dispatch Message for Handling) when dispatchMsg() is invoked.

Template Parameters
TMsgType of the message interface.
THandlerType of the message handler.
Note
Defined in comms/dispatch.h

◆ dispatchMsgIsDirect() [2/2]

template<typename TMsg , typename THandler >
constexpr bool comms::dispatchMsgIsDirect ( TMsg &&  msg,
THandler &&  handler 
)
constexpr

Similar to other dispatchMsgIsDirect(), but can help in deducing template arguments.

Parameters
msgReference to the message object via its interface class.
handlerReference to the handler object.
Note
The result can be evaluated at compile time, but compilers don't support usage of this form in static_assert.
Defined in comms/dispatch.h

◆ dispatchMsgIsPolymorphic() [1/2]

template<typename TAllMessages , typename TMsg , typename THandler >
constexpr bool comms::dispatchMsgIsPolymorphic ( )
constexpr

Compile time check whether the dispatchMsg() will use "polymorphic" (including "direct") dispatch for provided tuple of messages and handler.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
TMsgType of the common message interface.
THandlerType of the handler being used for dispatch.
Note
Will return true in case dispatchMsgIsDirect() returns true;
Defined in comms/dispatch.h

◆ dispatchMsgIsPolymorphic() [2/2]

template<typename TAllMessages , typename TMsg , typename THandler >
constexpr bool comms::dispatchMsgIsPolymorphic ( TMsg &&  msg,
THandler &&  handler 
)
constexpr

Similar to other dispatchMsgIsPolymorphic(), but can help in deducing template arguments.

Parameters
msgReference to the message object via its interface class.
handlerReference to the handler object.
Note
The result can be evaluated at compile time, but compilers don't support usage of this form in static_assert.
Defined in comms/dispatch.h

◆ dispatchMsgIsStaticBinSearch() [1/2]

template<typename TAllMessages , typename TMsg , typename THandler >
constexpr bool comms::dispatchMsgIsStaticBinSearch ( )
constexpr

Compile time check whether the dispatchMsg() will use "static binary search" dispatch for provided tuple of messages and handler.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
TMsgType of the common message interface.
THandlerType of the handler being used for dispatch.
Note
Will return false in case dispatchMsgIsDirect() returns true;
Defined in comms/dispatch.h

◆ dispatchMsgIsStaticBinSearch() [2/2]

template<typename TAllMessages , typename TMsg , typename THandler >
constexpr bool comms::dispatchMsgIsStaticBinSearch ( TMsg &&  msg,
THandler &&  handler 
)
constexpr

Similar to other dispatchMsgIsStaticBinSearch(), but can help in deducing template arguments.

Parameters
msgReference to the message object via its interface class.
handlerReference to the handler object.
Note
The result can be evaluated at compile time, but compilers don't support usage of this form in static_assert.
Defined in comms/dispatch.h

◆ dispatchMsgLinearSwitch() [1/3]

template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto comms::dispatchMsgLinearSwitch ( TId &&  id,
std::size_t  index,
TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using linear switch behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]indexIndex (or offset) of the message type among those having the same ID.
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page.
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h

◆ dispatchMsgLinearSwitch() [2/3]

template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto comms::dispatchMsgLinearSwitch ( TId &&  id,
TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using linear switch behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page.
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h

◆ dispatchMsgLinearSwitch() [3/3]

template<typename TAllMessages , typename TMsg , typename THandler >
auto comms::dispatchMsgLinearSwitch ( TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using linear switch behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page.
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h

◆ dispatchMsgPolymorphic() [1/3]

template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto comms::dispatchMsgPolymorphic ( TId &&  id,
std::size_t  index,
TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using polymorphic behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]indexIndex (or offset) of the message type among those having the same ID.
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h

◆ dispatchMsgPolymorphic() [2/3]

template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto comms::dispatchMsgPolymorphic ( TId &&  id,
TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using polymorphic behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h

◆ dispatchMsgPolymorphic() [3/3]

template<typename TAllMessages , typename TMsg , typename THandler >
auto comms::dispatchMsgPolymorphic ( TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using polymorphic behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page.
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h

◆ dispatchMsgStaticBinSearch() [1/3]

template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto comms::dispatchMsgStaticBinSearch ( TId &&  id,
std::size_t  index,
TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using static binary search behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]indexIndex (or offset) of the message type among those having the same ID.
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h

◆ dispatchMsgStaticBinSearch() [2/3]

template<typename TAllMessages , typename TId , typename TMsg , typename THandler >
auto comms::dispatchMsgStaticBinSearch ( TId &&  id,
TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using static binary search behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page.
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h

◆ dispatchMsgStaticBinSearch() [3/3]

template<typename TAllMessages , typename TMsg , typename THandler >
auto comms::dispatchMsgStaticBinSearch ( TMsg &  msg,
THandler &  handler 
) -> details::MessageInterfaceDispatchRetType< typename std::decay<decltype(handler)>::type>

Dispatch message object into appropriate handle() function in the provided handler using static binary search behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]msgMessage object held by reference to its interface class.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Object section of the Advanced Guide to Message Dispatching tutorial page.
Returns
What the called handle() member function of handler object returns.
Note
Defined in comms/dispatch.h

◆ dispatchMsgType() [1/2]

template<typename TAllMessages , typename TId , typename THandler >
bool comms::dispatchMsgType ( TId &&  id,
std::size_t  index,
THandler &  handler 
)

Dispatch message id into appropriate handle() function in the provided handler using either "polymorphic" or "static binary search" behavior.

The function performs compile time evaluation of the provided TAllMessages tuple and uses logic described in Default Way to Dispatch to choose the way to dispatch.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]indexIndex (or offset) of the message type among those having the same ID.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Type section of the Advanced Guide to Message Dispatching tutorial page
Returns
true in case the appropriate handle() member function of the handler object has been called, false otherwise.
Note
Defined in comms/dispatch.h
See also
dispatchMsgTypeIsPolymorphic()
dispatchMsgTypeIsStaticBinSearch()

◆ dispatchMsgType() [2/2]

template<typename TAllMessages , typename TId , typename THandler >
bool comms::dispatchMsgType ( TId &&  id,
THandler &  handler 
)

Dispatch message id into appropriate handle() function in the provided handler using either "polymorphic" or "static binary search" behavior.

The function performs compile time evaluation of the provided TAllMessages tuple and uses logic described in Default Way to Dispatch to choose the way to dispatch.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Type section of the Advanced Guide to Message Dispatching tutorial page.
Returns
true in case the appropriate handle() member function of the handler object has been called, false otherwise.
Note
Defined in comms/dispatch.h
See also
dispatchMsgTypeIsPolymorphic()
dispatchMsgTypeIsStaticBinSearch()

◆ dispatchMsgTypeCountStaticBinSearch()

template<typename TAllMessages , typename TId >
std::size_t comms::dispatchMsgTypeCountStaticBinSearch ( TId &&  id)

Count number of message types in the provided tuple that have the requested numeric ID.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
Note
Defined in comms/dispatch.h

◆ dispatchMsgTypeIsPolymorphic()

template<typename TAllMessages >
constexpr bool comms::dispatchMsgTypeIsPolymorphic ( )
constexpr

Compile time check whether the dispatchMsgType() will use "polymorphic" dispatch for provided tuple of messages.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Note
Defined in comms/dispatch.h

◆ dispatchMsgTypeIsStaticBinSearch()

template<typename TAllMessages >
constexpr bool comms::dispatchMsgTypeIsStaticBinSearch ( )
constexpr

Compile time check whether the dispatchMsgType() or dispatchMsgType() will use "static binary search" dispatch for provided tuple of messages.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Note
Defined in comms/dispatch.h

◆ dispatchMsgTypeLinearSwitch() [1/2]

template<typename TAllMessages , typename TId , typename THandler >
bool comms::dispatchMsgTypeLinearSwitch ( TId &&  id,
std::size_t  index,
THandler &  handler 
)

Dispatch message id into appropriate handle() function in the provided handler using linear switch behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]indexIndex (or offset) of the message type among those having the same ID.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Type section of the Advanced Guide to Message Dispatching tutorial page.
Returns
true in case the appropriate handle() member function of the handler object has been called, false otherwise.
Note
Defined in comms/dispatch.h

◆ dispatchMsgTypeLinearSwitch() [2/2]

template<typename TAllMessages , typename TId , typename THandler >
bool comms::dispatchMsgTypeLinearSwitch ( TId &&  id,
THandler &  handler 
)

Dispatch message id into appropriate handle() function in the provided handler using linear switch behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Type section of the Advanced Guide to Message Dispatching tutorial page.
Returns
true in case the appropriate handle() member function of the handler object has been called, false otherwise.
Note
Defined in comms/dispatch.h

◆ dispatchMsgTypePolymorphic() [1/2]

template<typename TAllMessages , typename TId , typename THandler >
bool comms::dispatchMsgTypePolymorphic ( TId &&  id,
std::size_t  index,
THandler &  handler 
)

Dispatch message id into appropriate handle() function in the provided handler using polymorphic behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]indexIndex (or offset) of the message type among those having the same ID.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Type section of the Advanced Guide to Message Dispatching tutorial page.
Returns
true in case the appropriate handle() member function of the handler object has been called, false otherwise.
Note
Defined in comms/dispatch.h

◆ dispatchMsgTypePolymorphic() [2/2]

template<typename TAllMessages , typename TId , typename THandler >
bool comms::dispatchMsgTypePolymorphic ( TId &&  id,
THandler &  handler 
)

Dispatch message id into appropriate handle() function in the provided handler using polymorphic behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Type section of the Advanced Guide to Message Dispatching tutorial page.
Returns
true in case the appropriate handle() member function of the handler object has been called, false otherwise.
Note
Defined in comms/dispatch.h

◆ dispatchMsgTypeStaticBinSearch() [1/2]

template<typename TAllMessages , typename TId , typename THandler >
bool comms::dispatchMsgTypeStaticBinSearch ( TId &&  id,
std::size_t  index,
THandler &  handler 
)

Dispatch message id into appropriate handle() function in the provided handler using static binary search behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]indexIndex (or offset) of the message type among those having the same ID.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Type section of the Advanced Guide to Message Dispatching tutorial page.
Returns
true in case the appropriate handle() member function of the handler object has been called, false otherwise.
Note
Defined in comms/dispatch.h

◆ dispatchMsgTypeStaticBinSearch() [2/2]

template<typename TAllMessages , typename TId , typename THandler >
bool comms::dispatchMsgTypeStaticBinSearch ( TId &&  id,
THandler &  handler 
)

Dispatch message id into appropriate handle() function in the provided handler using static binary search behavior.

Template Parameters
TAllMessagesstd::tuple of supported message classes, sorted in ascending order by their numeric IDs.
Parameters
[in]idID of the message known at runtime.
[in]handlerHandler object, it's required public interface is explained in Dispatch of the Message Type section of the Advanced Guide to Message Dispatching tutorial page.
Returns
true in case the appropriate handle() member function of the handler object has been called, false otherwise.
Note
Defined in comms/dispatch.h

◆ field_cast()

template<typename TFieldTo , typename TFieldFrom >
TFieldTo comms::field_cast ( const TFieldFrom &  field)

Cast between fields.

Sometimes the protocol may treat some specific field differently based on indication bit in some other field. This function can be used to cast one field to another type.

SomeFieldType someField = comms::field_cast<SomeFieldType>(someOtherField);

The function will perform some compile time analysis and will do a simple static_cast between the contained values if they are convertible. Otherwise the write + read operations will be performed, i.e. the source field will be written into a temporary buffer, and the target field will perform a read operation from that buffer.

Template Parameters
TFieldToType to cast to.
TFieldFromType to cast from.
Parameters
[in]fieldOriginal field
Returns
Field of the new type with internal value equivalent to one of the original field.
Note
Defined in "comms/cast.h" headerfile

◆ isMessage()

template<typename T >
constexpr bool comms::isMessage ( )
constexpr

Compile time check of of whether the type is a message.

Checks existence of InterfaceOptions inner type.

◆ isMessageBase()

template<typename T >
constexpr bool comms::isMessageBase ( )
constexpr

Compile time check of of whether the type is a message extending comms::MessageBase.

Checks existence of ImplOptions inner type.

◆ processAllWithDispatch()

template<typename TBufIter , typename TFrame , typename THandler , typename... TExtraValues>
std::size_t comms::processAllWithDispatch ( TBufIter  bufIter,
std::size_t  len,
TFrame &&  frame,
THandler &  handler 
)

Process all available input and dispatch all created message objects to appropriate handling function.

All the created message objects are immediatelly destructed after dispatching.

Parameters
[in,out]bufIterIterator to input buffer. Passed by value and is NOT updated when buffer is iterated over (unlike comms::processSingle(), comms::processSingleWithDispatch(), comms::processSingleWithDispatchViaDispatcher()).
[in]lenNumber of remaining bytes in input buffer.
[in]frameProtocol frame / stack (see Transport Framing) that is used to process the raw input.
[in]handlerHandler to handle message object when dispatched. The dispatch is performed using comms::dispatchMsg() function.
Returns
Number of consumed bytes from the buffer. The caller is responsible to remove them from the buffer.
Note
Defined in comms/process.h
If default dispatch behaviour of the comms::dispatchMsg() function doesn't suit the application needs, consider using comms::processAllWithDispatchViaDispatcher() instead.
See also
Advanced Guide to Message Dispatching
comms::processAllWithDispatchViaDispatcher().
Advanced Guide to Message Dispatching
Reading Transport Framing and Message Payload

◆ processAllWithDispatchViaDispatcher()

template<typename TDispatcher , typename TBufIter , typename TFrame , typename THandler , typename... TExtraValues>
std::size_t comms::processAllWithDispatchViaDispatcher ( TBufIter  bufIter,
std::size_t  len,
TFrame &&  frame,
THandler &  handler 
)

Process all available input and dispatch all created message objects to appropriate handling function.

Similar to comms::processAllWithDispatch(), but allows forcing a particular dispatch policy. All the created message objects are immediatelly destructed after dispatching.

Template Parameters
TDispatcherA variant of comms::MsgDispatcher class. It's going to be used to dispatch message object into appropriate handling function instead of using comms::dispatchMsg() like comms::processSingleWithDispatch() does.
Parameters
[in,out]bufIterIterator to input buffer. Passed by value and is NOT updated when buffer is iterated over (unlike comms::processSingle(), comms::processSingleWithDispatch(), comms::processSingleWithDispatchViaDispatcher()).
[in]lenNumber of remaining bytes in input buffer.
[in]frameProtocol frame / stack (see Transport Framing) that is used to process the raw input.
[in]handlerHandler to handle message object when dispatched. The dispatch is performed via provded TDispatcher class (see comms::MsgDispatcher).
Returns
Number of consumed bytes from the buffer. The caller is responsible to remove them from the buffer.
Note
Defined in comms/process.h
See also
comms::processAllWithDispatch().
Advanced Guide to Message Dispatching
Reading Transport Framing and Message Payload

◆ processSingle()

template<typename TBufIter , typename TFrame , typename TMsg , typename... TExtraValues>
comms::ErrorStatus comms::processSingle ( TBufIter &  bufIter,
std::size_t  len,
TFrame &&  frame,
TMsg &  msg,
TExtraValues...  extraValues 
)

Process input until first message is recognized and its object is created or missing data is reported.

Can be used to implement Reading Transport Framing and Message Payload.

Parameters
[in,out]bufIterIterator to input buffer. Passed by reference and is updated when buffer is iterated over. Number of consumed bytes cat be determined by calculating the distance between originally passed value and the one after function returns.
[in]lenNumber of remaining bytes in input buffer.
[in]frameProtocol frame / stack (see Transport Framing) that is used to process the raw input.
[in,out]msgSmart pointer (see MsgPtr defintion of the Transport Framing) to message object to be allocated, or reference to actual message object (extending comms::MessageBase) when such is known.
[in,out]extraValuesExtra values that are passed as variadic parameters to read() member function of the protocol frame / stack.
Returns
ErrorStatus of the protocol frame / stack read() operation.
Note
Defined in comms/process.h
See also
Advanced Guide to Message Dispatching

◆ processSingleWithDispatch()

template<typename TBufIter , typename TFrame , typename TMsg , typename THandler , typename... TExtraValues>
comms::ErrorStatus comms::processSingleWithDispatch ( TBufIter &  bufIter,
std::size_t  len,
TFrame &&  frame,
TMsg &  msg,
THandler &  handler,
TExtraValues...  extraValues 
)

Process input until first message is recognized, its object is created and dispatched to appropriate handling function, or missing data is reported.

Similar to comms::processSingle(), but adds dispatch stage. Can be used to implement Reading Transport Framing and Message Payload.

Parameters
[in,out]bufIterIterator to input buffer. Passed by reference and is updated when buffer is iterated over. Number of consumed bytes cat be determined by calculating the distance between originally passed value and the one after function returns.
[in]lenNumber of remaining bytes in input buffer.
[in]frameProtocol frame / stack (see Transport Framing) that is used to process the raw input.
[in,out]msgSmart pointer (see MsgPtr defintion of the Transport Framing) to message object to be allocated, or reference to actual message object (extending comms::MessageBase) when such is known.
[in]handlerHandler to handle message object when dispatched. The dispatch is performed using comms::dispatchMsg() function.
[in,out]extraValuesExtra values that are passed as variadic parameters to read() member function of the protocol frame / stack.
Returns
ErrorStatus of the protocol frame / stack read() operation.
Note
Defined in comms/process.h
If default dispatch behaviour of the comms::dispatchMsg() function doesn't suit the application needs, consider using comms::processSingleWithDispatchViaDispatcher() instead.
See also
Advanced Guide to Message Dispatching

◆ processSingleWithDispatchViaDispatcher()

template<typename TDispatcher , typename TBufIter , typename TFrame , typename TMsg , typename THandler , typename... TExtraValues>
comms::ErrorStatus comms::processSingleWithDispatchViaDispatcher ( TBufIter &  bufIter,
std::size_t  len,
TFrame &&  frame,
TMsg &  msg,
THandler &  handler,
TExtraValues...  extraValues 
)

Process input until first message is recognized, its object is created and dispatched to appropriate handling function, or missing data is reported.

Similar to comms::processSingleWithDispatch(), but allows forcing a particular dispatch policy.

Template Parameters
TDispatcherA variant of comms::MsgDispatcher class. It's going to be used to dispatch message object into appropriate handling function instead of using comms::dispatchMsg() like comms::processSingleWithDispatch() does.
Parameters
[in,out]bufIterIterator to input buffer. Passed by reference and is updated when buffer is iterated over. Number of consumed bytes cat be determined by calculating the distance between originally passed value and the one after function returns.
[in]lenNumber of remaining bytes in input buffer.
[in]frameProtocol frame / stack (see Transport Framing) that is used to process the raw input.
[in,out]msgSmart pointer (see MsgPtr defintion of the Transport Framing) to message object to be allocated, or reference to actual message object (extending comms::MessageBase) when such is known.
[in]handlerHandler to handle message object when dispatched. The dispatch is performed via provded TDispatcher class (see comms::MsgDispatcher).
[in,out]extraValuesExtra values that are passed as variadic parameters to read() member function of the protocol frame / stack.
Returns
ErrorStatus of the protocol frame / stack read() operation.
Note
Defined in comms/process.h
See also
comms::processSingleWithDispatch().
Advanced Guide to Message Dispatching
Reading Transport Framing and Message Payload

◆ readIteratorFor() [1/2]

template<typename TMessage , typename TIter >
auto comms::readIteratorFor ( TIter &&  iter) -> decltype(details::ReadIteratorHelper<>::template get<TMessage>(std::forward<TIter>(iter)))

Create and initialise iterator for message read.

Template Parameters
TMessageType of message interface class or smart pointer to it.
Parameters
[in]iterIterator value.
Returns
The same iter value, but casted to appropriate type

◆ readIteratorFor() [2/2]

template<typename TMessage , typename TIter >
auto comms::readIteratorFor ( TMessage &&  msg,
TIter &&  iter 
) -> decltype(details::ReadIteratorHelper<>::template get<typename std::decay<decltype(msg)>::type>(std::forward<TIter>(iter)))

Create and initialise iterator for message read.

Template Parameters
TMessageType of message interface class or smart pointer to it.
Parameters
[in]msgUnused message object helps detecting proper message type.
[in]iterIterator value.
Returns
The same iter value, but casted to appropriate type

◆ writeIteratorFor() [1/2]

template<typename TMessage , typename TIter >
auto comms::writeIteratorFor ( TIter &&  iter) -> decltype(details::WriteIteratorHelper<>::template get<TMessage>(std::forward<TIter>(iter)))

Create and initialise iterator for message write.

Template Parameters
TMessageType of message interface class or smart pointer to it.
Parameters
[in]iterIterator value.
Returns
The same iter value, but casted to appropriate type

◆ writeIteratorFor() [2/2]

template<typename TMessage , typename TIter >
auto comms::writeIteratorFor ( TMessage &&  msg,
TIter &&  iter 
) -> decltype(details::WriteIteratorHelper<>::template get<typename std::decay<decltype(msg)>::type>(std::forward<TIter>(iter)))

Create and initialise iterator for message write.

Template Parameters
TMessageType of message interface class or smart pointer to it.
Parameters
[in]msgUnused message object helps detecting proper message type.
[in]iterIterator value.
Returns
The same iter value, but casted to appropriate type