ArmNN
 20.05
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 
40 using IPacketBufferPtr = std::unique_ptr<IPacketBuffer>;
41 
42 } // namespace profiling
43 
44 } // namespace armnn
virtual unsigned int GetSize() const =0
Copyright (c) 2020 ARM Limited.
virtual const unsigned char * GetReadableData() const =0
std::unique_ptr< IPacketBuffer > IPacketBufferPtr