diff options
author | Jim Flynn <jim.flynn@arm.com> | 2022-03-23 23:01:26 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2022-03-23 23:43:35 +0000 |
commit | 3e9bc19ad523361e6b18057849e30c0c48183915 (patch) | |
tree | b7b012a9734ce39d054fc5d92302780fd838e5c8 /profiling/client/src/IPacketBuffer.hpp | |
parent | 277618302d0f131eac0b6ac2015dd3eb09aa6ff9 (diff) | |
download | armnn-3e9bc19ad523361e6b18057849e30c0c48183915.tar.gz |
IVGCVSW-6706 Create the libpipeClient library
Change-Id: I2368aade38ad3808fab55d8a86cd659d4e95d91e
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'profiling/client/src/IPacketBuffer.hpp')
-rw-r--r-- | profiling/client/src/IPacketBuffer.hpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/profiling/client/src/IPacketBuffer.hpp b/profiling/client/src/IPacketBuffer.hpp new file mode 100644 index 0000000000..02c40e4ab1 --- /dev/null +++ b/profiling/client/src/IPacketBuffer.hpp @@ -0,0 +1,48 @@ +// +// Copyright © 2019 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include <memory> + +namespace arm +{ + +namespace pipe +{ + +class IReadOnlyPacketBuffer // interface used by the read thread +{ +public: + virtual ~IReadOnlyPacketBuffer() {} + + virtual const unsigned char* GetReadableData() const = 0; + + virtual unsigned int GetSize() const = 0; + + virtual void MarkRead() = 0; +}; + +class IPacketBuffer : public IReadOnlyPacketBuffer // interface used by code that writes binary packets +{ +public: + virtual ~IPacketBuffer() {} + + virtual void Commit(unsigned int size) = 0; + + virtual void Release() = 0; + + virtual unsigned char* GetWritableData() = 0; + + /// release the memory held and reset internal point to null. + /// After this function is invoked the PacketBuffer is unusable. + virtual void Destroy() = 0; +}; + +using IPacketBufferPtr = std::unique_ptr<IPacketBuffer>; + +} // namespace pipe + +} // namespace arm |