25 #if defined(ONIXS_CONFLATEDTCP_HAS_GATEWAY_EMULATOR) 33 namespace ConflatedTCP {
36 using namespace Messaging;
43 template<
typename Message>
53 template <
class AnotherType>
57 , container_(rhs.container_)
64 template <
class AnotherType>
68 , container_(
std::move(rhs.container_))
107 std::swap(rhs.size_, size_);
108 std::swap(rhs.container_, container_);
109 std::swap(rhs.message_, message_);
143 operator const Message()
const 151 return container_.get();
159 message_ = Message();
165 return message_.toString();
170 template<
typename MessageT>
176 return MessageT::TemplateId;
179 template<
typename MessageT>
184 return Messaging::typify<MessageT>(message);
187 template <
class AnotherType>
190 if(rhs->templateId() != getTemplateId<Message>())
193 message_ = this->typify<Message>(rhs);
208 , container_(
std::move(container))
209 , message_(container_.get(), size_)
214 template <
typename AnotherType,
typename BaseType>
void reset()
Resets the message.
Message typify(const SbeMessage &message)
Casts SBE-encoded message to a given type.
Message * operator->() noexcept
MessagePtr(MessagePtr &&rhs) noexcept
MessagePtr & operator=(MessagePtr &&rhs) noexcept
void swap(MessagePtr &rhs) noexcept
MessageHeader::TemplateId MessageTemplateId
Message type (template) identification.
#define ONIXS_CONFLATEDTCP_EXPORTED
const Message & message() const noexcept
void throwWrongType(UInt16, UInt16)
MessagePtr(const MessagePtr< AnotherType > &rhs)
Create from another type.
Message & message() noexcept
#define ONIXS_CONFLATEDTCP_NORETURN
MessagePtr(MessagePtr< AnotherType > &&rhs)
Creates from the given type.
std::string toString() const
UInt16 MessageSize
Message length type.
const Message * operator->() const noexcept
MessagePtr< AnotherType > cast(const MessagePtr< BaseType > &ptr)
Tries to cast to another type.
std::shared_ptr< UInt8 > Container
MessagePtr()
Creates an empty message container.