blob: 73aa0c5580d39a4e6bfc5bae61e35e007b930e2e [file] [log] [blame]
Jim Flynn4e755a52020-03-29 17:48:26 +01001//
2// Copyright © 2020 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "TimelineModel.hpp"
7
8namespace armnn
9{
10
11namespace profiling
12{
13
14void TimelineModel::AddLabel(const ITimelineDecoder::Label& label)
15{
16 m_LabelMap.emplace(label.m_Guid, label);
17}
18
19void TimelineModel::AddEntity(uint64_t guid)
20{
21 m_Entities.emplace(guid, guid);
22}
23
24Entity* TimelineModel::findEntity(uint64_t id)
25{
26 auto iter = m_Entities.find(id);
27 if (iter != m_Entities.end())
28 {
29 return &(iter->second);
30 }
31 else
32 {
33 return nullptr;
34 }
35}
36
37void TimelineModel::AddRelationship(const ITimelineDecoder::Relationship& relationship)
38{
39 m_Relationships.emplace(relationship.m_Guid, relationship);
40}
41
42ModelRelationship* TimelineModel::findRelationship(uint64_t id)
43{
44 auto iter = m_Relationships.find(id);
45 if (iter != m_Relationships.end())
46 {
47 return &(iter->second);
48 }
49 else
50 {
51 return nullptr;
52 }
53}
54
55} // namespace profiling
56
57} // namespace armnn