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.hpp | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/profiling/test/TimelineModel.hpp (limited to 'src/profiling/test/TimelineModel.hpp') diff --git a/src/profiling/test/TimelineModel.hpp b/src/profiling/test/TimelineModel.hpp new file mode 100644 index 0000000000..7b88d5fa2c --- /dev/null +++ b/src/profiling/test/TimelineModel.hpp @@ -0,0 +1,67 @@ +// +// Copyright © 2020 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include + +#include +#include + +namespace armnn +{ + +namespace profiling +{ +using LabelMap = std::map; +using Attribute = std::pair; +using Attributes = std::map; +class Entity +{ +public: + Entity(uint64_t guid) : m_Guid(guid) {} + uint64_t GetGuid() {return m_Guid;} + void AddChild(Entity* child) + { + if (child != nullptr) + { + m_Children.push_back(child); + } + } + void AddAttribute(const std::string& type, const std::string& value) + { + Attribute attr(type, value); + m_Attributes.emplace(type, attr); + } +private: + uint64_t m_Guid; + Attributes m_Attributes; + std::vector m_Children; +}; +using Entities = std::map; +struct ModelRelationship +{ + ModelRelationship(const ITimelineDecoder::Relationship& relationship) : m_Relationship(relationship) {} + ITimelineDecoder::Relationship m_Relationship; + std::vector m_RelatedEntities; +}; +using Relationships = std::map; +class TimelineModel +{ +public: + void AddLabel(const ITimelineDecoder::Label& label); + void AddEntity(uint64_t guid); + Entity* findEntity(uint64_t id); + void AddRelationship(const ITimelineDecoder::Relationship& relationship); + ModelRelationship* findRelationship(uint64_t id); +private: + LabelMap m_LabelMap; + Entities m_Entities; + Relationships m_Relationships; +}; + +} // namespace profiling + +} // namespace armnn \ No newline at end of file -- cgit v1.2.1