aboutsummaryrefslogtreecommitdiff
path: root/profiling/client/src/PacketBuffer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'profiling/client/src/PacketBuffer.hpp')
-rw-r--r--profiling/client/src/PacketBuffer.hpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/profiling/client/src/PacketBuffer.hpp b/profiling/client/src/PacketBuffer.hpp
new file mode 100644
index 0000000000..3fa5c608fe
--- /dev/null
+++ b/profiling/client/src/PacketBuffer.hpp
@@ -0,0 +1,47 @@
+//
+// Copyright © 2019 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include "IPacketBuffer.hpp"
+
+#include <memory>
+
+namespace arm
+{
+
+namespace pipe
+{
+
+class PacketBuffer : public IPacketBuffer
+{
+public:
+ PacketBuffer(unsigned int maxSize);
+
+ ~PacketBuffer() {}
+
+ const unsigned char* GetReadableData() const override;
+
+ unsigned int GetSize() const override;
+
+ void MarkRead() override;
+
+ void Commit(unsigned int size) override;
+
+ void Release() override;
+
+ unsigned char* GetWritableData() override;
+
+ void Destroy() override;
+
+private:
+ unsigned int m_MaxSize;
+ unsigned int m_Size;
+ std::unique_ptr<unsigned char[]> m_Data;
+};
+
+} // namespace pipe
+
+} // namespace arm