From 510f6183d289b176702a18f020449c68be6f1075 Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Fri, 21 Feb 2020 11:14:08 +0000 Subject: IVGCVSW-4164 Change the callbacks to a C++ pure virtual interface Signed-off-by: Finn Williams Change-Id: I0a15b9f228ceb5a8393a48571b345394c005ee1f --- .../profiling/timelineDecoder/ITimelineDecoder.hpp | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 tests/profiling/timelineDecoder/ITimelineDecoder.hpp (limited to 'tests/profiling/timelineDecoder/ITimelineDecoder.hpp') diff --git a/tests/profiling/timelineDecoder/ITimelineDecoder.hpp b/tests/profiling/timelineDecoder/ITimelineDecoder.hpp new file mode 100644 index 0000000000..7199b38d24 --- /dev/null +++ b/tests/profiling/timelineDecoder/ITimelineDecoder.hpp @@ -0,0 +1,68 @@ +// +// Copyright © 2020 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include +#include + +class ITimelineDecoder +{ + +public: + + enum class ErrorCode + { + ErrorCode_Success, + ErrorCode_Fail + }; + + enum class RelationshipType + { + RetentionLink, /// Head retains(parents) Tail + ExecutionLink, /// Head execution start depends on Tail execution completion + DataLink, /// Head uses data of Tail + LabelLink /// Head uses label Tail (Tail MUST be a guid of a label). + }; + + struct Entity + { + uint64_t m_Guid; + }; + + struct EventClass + { + uint64_t m_Guid; + }; + + struct Event + { + uint64_t m_Guid; + uint64_t m_TimeStamp; + uint64_t m_ThreadId; + }; + + struct Label + { + uint64_t m_Guid; + std::string m_Name; + }; + + struct Relationship + { + RelationshipType m_RelationshipType; + uint64_t m_Guid; + uint64_t m_HeadGuid; + uint64_t m_TailGuid; + }; + + virtual ~ITimelineDecoder() = default; + + virtual ErrorCode CreateEntity(const Entity&) = 0; + virtual ErrorCode CreateEventClass(const EventClass&) = 0; + virtual ErrorCode CreateEvent(const Event&) = 0; + virtual ErrorCode CreateLabel(const Label&) = 0; + virtual ErrorCode CreateRelationship(const Relationship&) = 0; +}; \ No newline at end of file -- cgit v1.2.1