From e6a2ccd09060ba93203ddc5a7f79260cedf2c147 Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Thu, 27 Feb 2020 16:21:41 +0000 Subject: IVGCVSW-4161 Provide for per model call back registration !armnn:2810 Signed-off-by: Finn Williams Change-Id: Idf56d42bd767baa5df0059a2f489f75281f8ac71 --- src/timelineDecoder/TimelineDecoder.cpp | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'src/timelineDecoder/TimelineDecoder.cpp') 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 #include + 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(); -- cgit v1.2.1