aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/Packet.hpp
diff options
context:
space:
mode:
authorMatteo Martincigh <matteo.martincigh@arm.com>2019-10-09 16:47:04 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-10-09 17:44:11 +0100
commitd0613b56cea7eba0604e0548bddffd773a4eb554 (patch)
tree18e5a28c346018340910c456eedd56717ab01c9c /src/profiling/Packet.hpp
parent09ca49cdcfbe377da979a19df9bcdb7cbffc7b50 (diff)
downloadarmnn-d0613b56cea7eba0604e0548bddffd773a4eb554.tar.gz
IVGCVSW-3937 Improve the Connection Acknowledged Handler
* The Connection Acknowledged Handler should report an error is it's called while in a wrong state * Stopping the threads in the ProfilingService before having to start them again * Updated the unit tests to check the changes * Removed unnecessary Packet.cpp file * Fixed memory leak Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I8c4d33b4d97994df86fe6c9f8c659f880ec64c16
Diffstat (limited to 'src/profiling/Packet.hpp')
-rw-r--r--src/profiling/Packet.hpp39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/profiling/Packet.hpp b/src/profiling/Packet.hpp
index 2aae14b741..fae368b64e 100644
--- a/src/profiling/Packet.hpp
+++ b/src/profiling/Packet.hpp
@@ -2,11 +2,12 @@
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
+
#pragma once
#include <armnn/Exceptions.hpp>
-#include <boost/log/trivial.hpp>
+#include <memory>
namespace armnn
{
@@ -46,26 +47,32 @@ 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(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))
+ {
+ other.m_Header = 0;
+ other.m_PacketFamily = 0;
+ other.m_PacketId = 0;
+ other.m_Length = 0;
+ }
+
+ ~Packet() = default;
Packet(const Packet& other) = delete;
Packet& operator=(const Packet&) = delete;
Packet& operator=(Packet&&) = default;
- uint32_t GetHeader() const;
- uint32_t GetPacketFamily() const;
- uint32_t GetPacketId() const;
- uint32_t GetLength() const;
- const char* const GetData() const;
-
- uint32_t GetPacketClass() const;
- uint32_t GetPacketType() const;
+ uint32_t GetHeader() const { return m_Header; }
+ uint32_t GetPacketFamily() const { return m_PacketFamily; }
+ uint32_t GetPacketId() const { return m_PacketId; }
+ uint32_t GetPacketClass() const { return m_PacketId >> 3; }
+ uint32_t GetPacketType() const { return m_PacketId & 7; }
+ uint32_t GetLength() const { return m_Length; }
+ const char* const GetData() const { return m_Data.get(); }
bool IsEmpty() { return m_Header == 0 && m_Length == 0; }