ArmNN
 21.02
IPacketBuffer.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <memory>
9 
10 namespace armnn
11 {
12 
13 namespace profiling
14 {
15 
16 class IReadOnlyPacketBuffer // interface used by the read thread
17 {
18 public:
20 
21  virtual const unsigned char* GetReadableData() const = 0;
22 
23  virtual unsigned int GetSize() const = 0;
24 
25  virtual void MarkRead() = 0;
26 };
27 
28 class IPacketBuffer : public IReadOnlyPacketBuffer // interface used by code that writes binary packets
29 {
30 public:
31  virtual ~IPacketBuffer() {}
32 
33  virtual void Commit(unsigned int size) = 0;
34 
35  virtual void Release() = 0;
36 
37  virtual unsigned char* GetWritableData() = 0;
38 
39  /// release the memory held and reset internal point to null.
40  /// After this function is invoked the PacketBuffer is unusable.
41  virtual void Destroy() = 0;
42 };
43 
44 using IPacketBufferPtr = std::unique_ptr<IPacketBuffer>;
45 
46 } // namespace profiling
47 
48 } // namespace armnn
virtual unsigned int GetSize() const =0
Copyright (c) 2021 ARM Limited and Contributors.
virtual const unsigned char * GetReadableData() const =0
std::unique_ptr< IPacketBuffer > IPacketBufferPtr