13#include "comms/details/detect.h"
22using ProcessMsgDecayType =
typename std::decay<T>::type;
24template <
bool TIsMessage,
bool TIsMsgPtr>
25struct ProcessMsgIdRetrieveHelper
32struct ProcessMsgIdRetrieveHelper<true, false>
39struct ProcessMsgIdRetrieveHelper<false, true>
43 using ElementType =
typename T::element_type;
47 typename ProcessMsgIdRetrieveHelper<comms::isMessage<ElementType<T> >(), hasElementType<ElementType<T> >()>::
48 template Type<ElementType<T> >;
52using ProcessMsgIdType =
53 typename ProcessMsgIdRetrieveHelper<comms::isMessage<ProcessMsgDecayType<T> >(), hasElementType<ProcessMsgDecayType<T> >()>::
54 template Type<ProcessMsgDecayType<T> >;
57template <
bool TIsMessage,
bool TIsMsgPtr>
58struct ProcessMsgCastToMsgObjHelper;
61struct ProcessMsgCastToMsgObjHelper<true, false>
64 static auto cast(T& msg) ->
decltype(msg)
71struct ProcessMsgCastToMsgObjHelper<false, true>
74 static auto cast(T& msg) ->
decltype(*msg)
81using ProcessMsgCastParamIsMessage =
82 std::integral_constant<
84 isMessage<ProcessMsgDecayType<T> >()
88using ProcessMsgCastParamIsMsgPtr =
89 std::integral_constant<
91 hasElementType<ProcessMsgDecayType<T> >()
95auto processMsgCastToMsgObj(T& msg) ->
96 decltype(ProcessMsgCastToMsgObjHelper<ProcessMsgCastParamIsMessage<T>::value, ProcessMsgCastParamIsMsgPtr<T>::value>::cast(msg))
98 return ProcessMsgCastToMsgObjHelper<ProcessMsgCastParamIsMessage<T>::value, ProcessMsgCastParamIsMsgPtr<T>::value>::cast(msg);
Contains definition of Message object interface and various base classes for custom messages.
Main namespace for all classes / functions of COMMS library.
typename comms::util::LazyDeepConditional< TMsg::InterfaceOptions::HasMsgIdType >::template Type< comms::details::MessageIdTypeRetriever, comms::util::AliasType, TDefaultType, TMsg > MessageIdType
Get type of message ID used by interface class.
Definition Message.h:564