aboutsummaryrefslogtreecommitdiff
path: root/tests/profiling/timelineDecoder/TimelineDecoder.hpp
diff options
context:
space:
mode:
authorFinn Williams <Finn.Williams@arm.com>2020-02-21 11:14:08 +0000
committerJim Flynn <jim.flynn@arm.com>2020-03-02 12:51:36 +0000
commit510f6183d289b176702a18f020449c68be6f1075 (patch)
tree28e8e4f27af5d1ee912c93d47628ec219d37a722 /tests/profiling/timelineDecoder/TimelineDecoder.hpp
parent4c998993bda1475595be5505690ff4e08dc2389e (diff)
downloadarmnn-510f6183d289b176702a18f020449c68be6f1075.tar.gz
IVGCVSW-4164 Change the callbacks to a C++ pure virtual interface
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: I0a15b9f228ceb5a8393a48571b345394c005ee1f
Diffstat (limited to 'tests/profiling/timelineDecoder/TimelineDecoder.hpp')
-rw-r--r--tests/profiling/timelineDecoder/TimelineDecoder.hpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/profiling/timelineDecoder/TimelineDecoder.hpp b/tests/profiling/timelineDecoder/TimelineDecoder.hpp
new file mode 100644
index 0000000000..81e6a95c09
--- /dev/null
+++ b/tests/profiling/timelineDecoder/TimelineDecoder.hpp
@@ -0,0 +1,63 @@
+//
+// Copyright © 2020 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+#pragma once
+
+#include "ITimelineDecoder.hpp"
+#include <vector>
+namespace armnn
+{
+class TimelineDecoder : public ITimelineDecoder
+{
+
+public:
+
+ struct Model
+ {
+ std::vector<Entity> m_Entities;
+ std::vector<EventClass> m_EventClasses;
+ std::vector<Event> m_Events;
+ std::vector<Label> m_Labels;
+ std::vector<Relationship> m_Relationships;
+ };
+
+ using OnNewEntityCallback = void (*)(Model &, const Entity);
+ using OnNewEventClassCallback = void (*)(Model &, const EventClass);
+ using OnNewEventCallback = void (*)(Model &, const Event);
+ using OnNewLabelCallback = void (*)(Model &, const Label);
+ using OnNewRelationshipCallback = void (*)(Model &, const Relationship);
+
+ virtual ErrorCode CreateEntity(const Entity &) override;
+ virtual ErrorCode CreateEventClass(const EventClass &) override;
+ virtual ErrorCode CreateEvent(const Event &) override;
+ virtual ErrorCode CreateLabel(const Label &) override;
+ virtual ErrorCode CreateRelationship(const Relationship &) override;
+
+ const Model& GetModel();
+
+
+ ErrorCode SetEntityCallback(const OnNewEntityCallback);
+ ErrorCode SetEventClassCallback(const OnNewEventClassCallback);
+ ErrorCode SetEventCallback(const OnNewEventCallback);
+ ErrorCode SetLabelCallback(const OnNewLabelCallback);
+ ErrorCode SetRelationshipCallback(const OnNewRelationshipCallback);
+
+ void print();
+
+private:
+ Model m_Model;
+
+ OnNewEntityCallback m_OnNewEntityCallback;
+ OnNewEventClassCallback m_OnNewEventClassCallback;
+ OnNewEventCallback m_OnNewEventCallback;
+ OnNewLabelCallback m_OnNewLabelCallback;
+ OnNewRelationshipCallback m_OnNewRelationshipCallback;
+
+ void printLabels();
+ void printEntities();
+ void printEventClasses();
+ void printRelationships();
+ void printEvents();
+};
+} \ No newline at end of file