IVGCVSW-6816 Inject counter registration into ProfilingService

Change-Id: I87ce3a1306eced9fc347cc383d9c7bc8994f0b0c
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
diff --git a/src/profiling/ProfilingService.hpp b/src/profiling/ProfilingService.hpp
index 7919c30..efad871 100644
--- a/src/profiling/ProfilingService.hpp
+++ b/src/profiling/ProfilingService.hpp
@@ -50,7 +50,9 @@
     using BackendProfilingContext = std::unordered_map<std::string,
                                                        std::shared_ptr<IBackendProfilingContext>>;
 
-    ProfilingService(armnn::Optional<IReportStructure&> reportStructure = armnn::EmptyOptional())
+    ProfilingService(uint16_t maxGlobalCounterId,
+                     IInitialiseProfilingService& initialiser,
+                     armnn::Optional<IReportStructure&> reportStructure = armnn::EmptyOptional())
         : m_Options()
         , m_TimelineReporting(false)
         , m_CounterDirectory()
@@ -118,8 +120,9 @@
                                                       m_StateMachine,
                                                       *this)
         , m_TimelinePacketWriterFactory(m_BufferManager)
-        , m_MaxGlobalCounterId(INFERENCES_RUN)
+        , m_MaxGlobalCounterId(maxGlobalCounterId)
         , m_ServiceActive(false)
+        , m_Initialiser(initialiser)
     {
         // Register the "Connection Acknowledged" command handler
         m_CommandHandlerRegistry.RegisterFunctor(&m_ConnectionAcknowledgedCommandHandler);
@@ -151,7 +154,7 @@
     void Update();
 
     // Disconnects the profiling service from the external server
-    void Disconnect();
+    void Disconnect() override;
 
     // Store a profiling context returned from a backend that support profiling.
     void AddBackendProfilingContext(const std::string& backendId,
@@ -170,6 +173,8 @@
     // counter global/backend mapping functions
     const ICounterMappings& GetCounterMappings() const override;
     IRegisterCounterMapping& GetCounterMappingRegistry() override;
+    bool IsCategoryRegistered(const std::string& categoryName) const override;
+    bool IsCounterRegistered(const std::string& counterName) const override;
 
     // Getters for the profiling service state
     bool IsProfilingEnabled() const override;
@@ -185,6 +190,8 @@
     uint32_t SubtractCounterValue(uint16_t counterUid, uint32_t value) override;
     uint32_t IncrementCounterValue(uint16_t counterUid) override;
 
+    void InitializeCounterValue(uint16_t counterUid) override;
+
     std::unique_ptr<ISendTimelinePacket> GetSendTimelinePacket() const override;
 
     ISendCounterPacket& GetSendCounterPacket() override
@@ -211,7 +218,6 @@
 
     // Initialization/reset functions
     void Initialize();
-    void InitializeCounterValue(uint16_t counterUid);
     void Reset();
     void Stop();
 
@@ -256,6 +262,8 @@
     std::condition_variable m_ServiceActiveConditionVariable;
     bool m_ServiceActive;
 
+    IInitialiseProfilingService& m_Initialiser;
+
 protected:
 
     // Protected methods for testing