From 4e755a50e35a1f5ac1b011dc4baf89e6d97f116e Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Sun, 29 Mar 2020 17:48:26 +0100 Subject: IVGCVSW-4595 Add IFileOnlyPacketHandlers to file only profiling connection Change-Id: Ib49a8cbbf323da4109cdab9750e6c4d276e484b7 Signed-off-by: Jim Flynn --- src/profiling/test/TimelineModel.cpp | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/profiling/test/TimelineModel.cpp (limited to 'src/profiling/test/TimelineModel.cpp') diff --git a/src/profiling/test/TimelineModel.cpp b/src/profiling/test/TimelineModel.cpp new file mode 100644 index 0000000000..73aa0c5580 --- /dev/null +++ b/src/profiling/test/TimelineModel.cpp @@ -0,0 +1,57 @@ +// +// Copyright © 2020 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#include "TimelineModel.hpp" + +namespace armnn +{ + +namespace profiling +{ + +void TimelineModel::AddLabel(const ITimelineDecoder::Label& label) +{ + m_LabelMap.emplace(label.m_Guid, label); +} + +void TimelineModel::AddEntity(uint64_t guid) +{ + m_Entities.emplace(guid, guid); +} + +Entity* TimelineModel::findEntity(uint64_t id) +{ + auto iter = m_Entities.find(id); + if (iter != m_Entities.end()) + { + return &(iter->second); + } + else + { + return nullptr; + } +} + +void TimelineModel::AddRelationship(const ITimelineDecoder::Relationship& relationship) +{ + m_Relationships.emplace(relationship.m_Guid, relationship); +} + +ModelRelationship* TimelineModel::findRelationship(uint64_t id) +{ + auto iter = m_Relationships.find(id); + if (iter != m_Relationships.end()) + { + return &(iter->second); + } + else + { + return nullptr; + } +} + +} // namespace profiling + +} // namespace armnn \ No newline at end of file -- cgit v1.2.1