Jim Flynn | 4e755a5 | 2020-03-29 17:48:26 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "TimelineModel.hpp" |
| 7 | |
| 8 | namespace armnn |
| 9 | { |
| 10 | |
| 11 | namespace profiling |
| 12 | { |
| 13 | |
| 14 | void TimelineModel::AddLabel(const ITimelineDecoder::Label& label) |
| 15 | { |
| 16 | m_LabelMap.emplace(label.m_Guid, label); |
| 17 | } |
| 18 | |
| 19 | void TimelineModel::AddEntity(uint64_t guid) |
| 20 | { |
| 21 | m_Entities.emplace(guid, guid); |
| 22 | } |
| 23 | |
| 24 | Entity* 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 | |
| 37 | void TimelineModel::AddRelationship(const ITimelineDecoder::Relationship& relationship) |
| 38 | { |
| 39 | m_Relationships.emplace(relationship.m_Guid, relationship); |
| 40 | } |
| 41 | |
| 42 | ModelRelationship* 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 |