ArmNN
 20.05
ILocalPacketHandler.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 
10 
11 #include <cstdint>
12 #include <memory>
13 #include <vector>
14 
15 namespace armnn
16 {
17 
18 namespace profiling
19 {
20 // forward declare to prevent a circular dependency
21 class Packet;
22 class IProfilingConnection;
23 
25 {
26 public:
27  virtual ~ILocalPacketHandler() {};
28 
29  /// @return lists the headers of the packets that this handler accepts
30  /// only these packets will get sent to this handler.
31  /// If this function returns an empty list then ALL packets
32  /// will be sent to the PacketHandler i.e. a universal handler.
33  virtual std::vector<uint32_t> GetHeadersAccepted() = 0;
34 
35  /// process the packet
36  virtual void HandlePacket(const Packet& packet) = 0;
37 
38  /// Set a profiling connection on the handler. Only need to implement this
39  /// function if the handler will be writing data back to the profiled application.
40  virtual void SetConnection(IProfilingConnection* profilingConnection) {armnn::IgnoreUnused(profilingConnection);}
41 };
42 
43 using ILocalPacketHandlerPtr = std::unique_ptr<ILocalPacketHandler>;
44 using ILocalPacketHandlerSharedPtr = std::shared_ptr<ILocalPacketHandler>;
45 
46 } // namespace profiling
47 
48 } // namespace armnn
std::shared_ptr< ILocalPacketHandler > ILocalPacketHandlerSharedPtr
std::unique_ptr< ILocalPacketHandler > ILocalPacketHandlerPtr
Copyright (c) 2020 ARM Limited.
void IgnoreUnused(Ts &&...)
virtual std::vector< uint32_t > GetHeadersAccepted()=0
virtual void SetConnection(IProfilingConnection *profilingConnection)
Set a profiling connection on the handler.
virtual void HandlePacket(const Packet &packet)=0
process the packet