aboutsummaryrefslogtreecommitdiff
path: root/src/timelineDecoder/TimelineDecoder.cpp
diff options
context:
space:
mode:
authorFinn Williams <Finn.Williams@arm.com>2020-02-27 16:21:41 +0000
committerJim Flynn <jim.flynn@arm.com>2020-03-18 12:59:19 +0000
commite6a2ccd09060ba93203ddc5a7f79260cedf2c147 (patch)
treec542464311f16acde42fbe01df9f4d8a78feff64 /src/timelineDecoder/TimelineDecoder.cpp
parenteba482e691bb314e1379d29f267ec3b46a082d01 (diff)
downloadarmnn-e6a2ccd09060ba93203ddc5a7f79260cedf2c147.tar.gz
IVGCVSW-4161 Provide for per model call back registration
!armnn:2810 Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: Idf56d42bd767baa5df0059a2f489f75281f8ac71
Diffstat (limited to 'src/timelineDecoder/TimelineDecoder.cpp')
-rw-r--r--src/timelineDecoder/TimelineDecoder.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/timelineDecoder/TimelineDecoder.cpp b/src/timelineDecoder/TimelineDecoder.cpp
index 2f9ac135b4..f7f4663530 100644
--- a/src/timelineDecoder/TimelineDecoder.cpp
+++ b/src/timelineDecoder/TimelineDecoder.cpp
@@ -4,13 +4,14 @@
//
#include "TimelineDecoder.hpp"
-#include "../profiling/ProfilingUtils.hpp"
-
+#include <ProfilingUtils.hpp>
#include <iostream>
+
namespace armnn
{
namespace timelinedecoder
{
+
TimelineDecoder::TimelineStatus TimelineDecoder::CreateEntity(const Entity &entity)
{
if (m_OnNewEntityCallback == nullptr)
@@ -120,6 +121,34 @@ TimelineDecoder::TimelineStatus TimelineDecoder::SetRelationshipCallback(OnNewRe
return TimelineStatus::TimelineStatus_Success;
}
+void TimelineDecoder::SetDefaultCallbacks()
+{
+ SetEntityCallback([](Model& model, const ITimelineDecoder::Entity entity)
+ {
+ model.m_Entities.emplace_back(entity);
+ });
+
+ SetEventClassCallback([](Model& model, const ITimelineDecoder::EventClass eventClass)
+ {
+ model.m_EventClasses.emplace_back(eventClass);
+ });
+
+ SetEventCallback([](Model& model, const ITimelineDecoder::Event event)
+ {
+ model.m_Events.emplace_back(event);
+ });
+
+ SetLabelCallback([](Model& model, const ITimelineDecoder::Label label)
+ {
+ model.m_Labels.emplace_back(label);
+ });
+
+ SetRelationshipCallback([](Model& model, const ITimelineDecoder::Relationship relationship)
+ {
+ model.m_Relationships.emplace_back(relationship);
+ });
+}
+
void TimelineDecoder::print()
{
printLabels();