From a0c7871cf140d1e9cf59a213626ee534c0122c7f Mon Sep 17 00:00:00 2001 From: FinnWilliamsArm Date: Mon, 16 Sep 2019 12:06:47 +0100 Subject: IVGCVSW-3826: Implement IProfiling functions !armnn:1814 Signed-off-by: Teresa Charlin Signed-off-by: FinnWilliamsArm Change-Id: I82c7453d7969880e321572637adc0fb9c0e5fd7b --- src/profiling/Packet.hpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/profiling/Packet.hpp') diff --git a/src/profiling/Packet.hpp b/src/profiling/Packet.hpp index c5e7f3c029..1e047a6511 100644 --- a/src/profiling/Packet.hpp +++ b/src/profiling/Packet.hpp @@ -17,10 +17,8 @@ namespace profiling class Packet { public: - Packet(uint32_t header, uint32_t length, const char* data) - : m_Header(header), - m_Length(length), - m_Data(data) + Packet(uint32_t header, uint32_t length, std::unique_ptr& data) + : m_Header(header), m_Length(length), m_Data(std::move(data)) { m_PacketId = ((header >> 16) & 1023); m_PacketFamily = (header >> 26); @@ -31,11 +29,21 @@ public: } } + Packet(Packet&& other) : + m_Header(other.m_Header), + m_PacketFamily(other.m_PacketFamily), + m_PacketId(other.m_PacketId), + m_Length(other.m_Length), + m_Data(std::move(other.m_Data)){}; + + Packet(const Packet& other) = delete; + Packet& operator=(const Packet&) = delete; + uint32_t GetHeader() const; uint32_t GetPacketFamily() const; uint32_t GetPacketId() const; uint32_t GetLength() const; - const char* GetData() const; + const char* const GetData() const; uint32_t GetPacketClass() const; uint32_t GetPacketType() const; @@ -45,7 +53,7 @@ private: uint32_t m_PacketFamily; uint32_t m_PacketId; uint32_t m_Length; - const char* m_Data; + std::unique_ptr m_Data; }; } // namespace profiling -- cgit v1.2.1