aboutsummaryrefslogtreecommitdiff
path: root/include/armnn/profiling/ILocalPacketHandler.hpp
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2020-03-29 17:48:26 +0100
committerfinn.williams <finn.williams@arm.com>2020-04-27 16:38:55 +0000
commit4e755a50e35a1f5ac1b011dc4baf89e6d97f116e (patch)
tree9660dba96819145e4f1bfe34e4482dca211ffc26 /include/armnn/profiling/ILocalPacketHandler.hpp
parent303980c502c721f13d65e7087be6c0758df65044 (diff)
downloadarmnn-4e755a50e35a1f5ac1b011dc4baf89e6d97f116e.tar.gz
IVGCVSW-4595 Add IFileOnlyPacketHandlers to file only profiling connection
Change-Id: Ib49a8cbbf323da4109cdab9750e6c4d276e484b7 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'include/armnn/profiling/ILocalPacketHandler.hpp')
-rw-r--r--include/armnn/profiling/ILocalPacketHandler.hpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/armnn/profiling/ILocalPacketHandler.hpp b/include/armnn/profiling/ILocalPacketHandler.hpp
new file mode 100644
index 0000000000..a2b9d5fd56
--- /dev/null
+++ b/include/armnn/profiling/ILocalPacketHandler.hpp
@@ -0,0 +1,48 @@
+//
+// Copyright © 2020 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+
+#include <armnn/utility/IgnoreUnused.hpp>
+
+#include <cstdint>
+#include <memory>
+#include <vector>
+
+namespace armnn
+{
+
+namespace profiling
+{
+// forward declare to prevent a circular dependency
+class Packet;
+class IProfilingConnection;
+
+class ILocalPacketHandler
+{
+public:
+ virtual ~ILocalPacketHandler() {};
+
+ /// @return lists the headers of the packets that this handler accepts
+ /// only these packets will get sent to this handler.
+ /// If this function returns an empty list then ALL packets
+ /// will be sent to the PacketHandler i.e. a universal handler.
+ virtual std::vector<uint32_t> GetHeadersAccepted() = 0;
+
+ /// process the packet
+ virtual void HandlePacket(const Packet& packet) = 0;
+
+ /// Set a profiling connection on the handler. Only need to implement this
+ /// function if the handler will be writing data back to the profiled application.
+ virtual void SetConnection(IProfilingConnection* profilingConnection) {armnn::IgnoreUnused(profilingConnection);}
+};
+
+using ILocalPacketHandlerPtr = std::unique_ptr<ILocalPacketHandler>;
+using ILocalPacketHandlerSharedPtr = std::shared_ptr<ILocalPacketHandler>;
+
+} // namespace profiling
+
+} // namespace armnn \ No newline at end of file