9#include "comms/details/detect.h"
10#include "comms/details/tag.h"
20class WriteIteratorHelper
22 template <
typename... TParams>
23 using HasWriteIterTag = comms::details::tag::Tag1<>;
25 template <
typename... TParams>
26 using MsgPointerTag = comms::details::tag::Tag2<>;
28 template <
typename... TParams>
29 using CastTag = comms::details::tag::Tag3<>;
31 template <
typename TMsg>
33 typename comms::util::LazyShallowConditional<
40 template <
typename TMsg>
41 using MsgPtrOrCastTag =
42 typename comms::util::LazyShallowConditional<
43 hasElementType<TMsg>()
49 template <
typename TMsg>
51 typename comms::util::LazyShallowConditional<
52 comms::isMessage<TMsg>()
59 template <
typename TMsg,
typename TIter,
typename... TParams>
60 static auto getInternal(TIter&& iter, HasWriteIterTag<TParams...>) ->
typename TMsg::WriteIterator
62 static_assert(std::is_convertible<
typename std::decay<
decltype(iter)>::type,
typename TMsg::WriteIterator>::value,
63 "Provided iterator is not convertible to read iterator type used by message interface");
64 return typename TMsg::WriteIterator(std::forward<TIter>(iter));
67 template <
typename TMsg,
typename TIter,
typename... TParams>
68 static auto getInternal(TIter&& iter, CastTag<TParams...>) ->
decltype(std::forward<TIter>(iter))
70 return std::forward<TIter>(iter);
73 template <
typename TMsg,
typename TIter,
typename... TParams>
74 static auto getInternal(TIter&& iter, MsgPointerTag<TParams...>) ->
75 decltype(getInternal<typename TMsg::element_type>(std::forward<TIter>(iter), Tag<typename TMsg::element_type>()))
77 return getInternal<typename TMsg::element_type>(std::forward<TIter>(iter), Tag<typename TMsg::element_type>());
81 template <
typename TMsg,
typename TIter>
82 static auto get(TIter&& iter) ->
decltype(getInternal<TMsg>(std::forward<TIter>(iter), Tag<TMsg>()))
84 return getInternal<TMsg>(std::forward<TIter>(iter), Tag<TMsg>());
Contains definition of Message object interface and various base classes for custom messages.
Main namespace for all classes / functions of COMMS library.
Replacement to some types from standard type_traits.