IVGCVSW-4070 Implement "send post-optimized network structure"

 * Send post-optimisation network structure if profiling service is enabled
 * Refactor TimelineUtilityMethods
 * Fix RecordEvent to link eventGuid with eventClassGuid
 * Add common types and guid to LabelsAndEventClasses
 * Add CreateRelationship to TimelineUtilityMethods
 * Add CreateTypedEntity to TimelineUtilityMethods
 * Add MarkEntityWithType to TimelineUtilityMethods
 * Move VerifyTimeline functions to ProfilingTestUtils
 * Post-optimisation network structure unit tests to Ref, Cl, Neon

Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com>
Change-Id: I0194f2037c236450c912f4c3cb11e46b80c0f512
diff --git a/src/profiling/TimelineUtilityMethods.hpp b/src/profiling/TimelineUtilityMethods.hpp
index 3683ed3..8e07161 100644
--- a/src/profiling/TimelineUtilityMethods.hpp
+++ b/src/profiling/TimelineUtilityMethods.hpp
@@ -17,18 +17,34 @@
 class TimelineUtilityMethods
 {
 public:
-    TimelineUtilityMethods(ISendTimelinePacket& sendTimelinePacket)
-        : m_SendTimelinePacket(sendTimelinePacket)
-    {}
+
+    // static factory method which will return a pointer to a timelie utility methods
+    // object if profiling is enabled. Otherwise will return a null unique_ptr
+    static std::unique_ptr<TimelineUtilityMethods> GetTimelineUtils();
+
+    TimelineUtilityMethods(std::unique_ptr<ISendTimelinePacket>& sendTimelinePacket)
+        : m_SendTimelinePacket(std::move(sendTimelinePacket)) {}
+
+    TimelineUtilityMethods(TimelineUtilityMethods&& other)
+        : m_SendTimelinePacket(std::move(other.m_SendTimelinePacket)) {}
+
+    TimelineUtilityMethods(const TimelineUtilityMethods& other) = delete;
+
+    TimelineUtilityMethods& operator=(const TimelineUtilityMethods& other) = delete;
+
+    TimelineUtilityMethods& operator=(TimelineUtilityMethods&& other) = default;
+
     ~TimelineUtilityMethods() = default;
 
     void SendWellKnownLabelsAndEventClasses();
 
     ProfilingDynamicGuid CreateNamedTypedEntity(const std::string& name, const std::string& type);
 
-    void CreateNamedTypedEntity(ProfilingDynamicGuid entityGuid, const std::string& name, const std::string& type);
+    void CreateNamedTypedEntity(ProfilingGuid entityGuid, const std::string& name, const std::string& type);
 
-    void CreateTypedLabel(ProfilingGuid entityGuid, const std::string& entityName, ProfilingStaticGuid labelTypeGuid);
+    void CreateNamedTypedEntity(ProfilingGuid entityGuid, const std::string& name, ProfilingStaticGuid typeGuid);
+
+    void MarkEntityWithLabel(ProfilingGuid entityGuid, const std::string &labelName, ProfilingStaticGuid labelLinkGuid);
 
     ProfilingStaticGuid DeclareLabel(const std::string& labelName);
 
@@ -40,15 +56,34 @@
                                                      const std::string& entityName,
                                                      const std::string& entityType);
 
-    void CreateNamedTypedChildEntity(ProfilingDynamicGuid entityGuid,
+    void CreateNamedTypedChildEntity(ProfilingGuid entityGuid,
                                      ProfilingGuid parentEntityGuid,
                                      const std::string& entityName,
                                      const std::string& entityType);
 
+    void CreateNamedTypedChildEntity(ProfilingGuid entityGuid,
+                                     ProfilingGuid parentEntityGuid,
+                                     const std::string& entityName,
+                                     ProfilingStaticGuid typeGuid);
+
+    ProfilingDynamicGuid CreateRelationship(ProfilingRelationshipType relationshipType,
+                                            ProfilingGuid headGuid,
+                                            ProfilingGuid tailGuid);
+
+    ProfilingDynamicGuid CreateConnectionRelationship(ProfilingRelationshipType relationshipType,
+                                                      ProfilingGuid headGuid,
+                                                      ProfilingGuid tailGuid);
+
+    void CreateTypedEntity(ProfilingGuid entityGuid, ProfilingStaticGuid typeGuid);
+
+    void MarkEntityWithType(ProfilingGuid entityGuid, ProfilingStaticGuid typeNameGuid);
+
     ProfilingDynamicGuid RecordEvent(ProfilingGuid entityGuid, ProfilingStaticGuid eventClassGuid);
 
+    void Commit() { m_SendTimelinePacket->Commit(); }
+
 private:
-    ISendTimelinePacket& m_SendTimelinePacket;
+    std::unique_ptr<ISendTimelinePacket> m_SendTimelinePacket;
 };
 
 } // namespace profiling