31#ifndef DW_FRAMEWORK_CHANNEL_PACKET_HPP_
32#define DW_FRAMEWORK_CHANNEL_PACKET_HPP_
36#include <dwshared/dwfoundation/dw/core/base/ExceptionWithStatus.hpp>
37#include <dwshared/dwfoundation/dw/core/safety/Safety.hpp>
69 throw ExceptionWithStatus(DW_NOT_SUPPORTED,
"ChannelPacketBase: serialize: not implemented");
95 throw ExceptionWithStatus(DW_BAD_ALLOC,
"ChannelPacketBase: initBuffer: cannot allocate memory");
114 throw ExceptionWithStatus(DW_INTERNAL_ERROR,
"ChannelPacketBase: getGenericData: not set by implementation.");
128 static_assert(std::is_constructible<T>::value,
"T must be constructible");
129 static_assert(std::is_trivially_copyable<T>::value,
"Type argument T is not trivially copyable");
131 virtual void notImplemented() = 0;
GenericData getGenericData() override
dw::core::Optional< GenericData > m_frame
uint8_t * getBuffer() override
std::unique_ptr< uint8_t[]> m_buffer
void deserialize(size_t) override=0
ChannelSocketPacketBase(size_t bufferSize)
void initBuffer(size_t bufferSize)
size_t serialize() override
virtual void serializeImpl()
size_t getBufferSize() override
ChannelSocketPacketBase()=default