IVGCVSW-3963 Implement the Request Counter Directory Handler
* Integrated the RequestCounterDirectoryCommandHandler in the
ProfilingService class
* Code refactoring
* Added/Updated unit tests
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: I60d9f8acf166e29b3dabc921dbdb8149461bd85f
diff --git a/src/profiling/ProfilingService.hpp b/src/profiling/ProfilingService.hpp
index edeb6bd..0e66924 100644
--- a/src/profiling/ProfilingService.hpp
+++ b/src/profiling/ProfilingService.hpp
@@ -13,6 +13,7 @@
#include "BufferManager.hpp"
#include "SendCounterPacket.hpp"
#include "ConnectionAcknowledgedCommandHandler.hpp"
+#include "RequestCounterDirectoryCommandHandler.hpp"
namespace armnn
{
@@ -81,6 +82,7 @@
BufferManager m_BufferManager;
SendCounterPacket m_SendCounterPacket;
ConnectionAcknowledgedCommandHandler m_ConnectionAcknowledgedCommandHandler;
+ RequestCounterDirectoryCommandHandler m_RequestCounterDirectoryCommandHandler;
protected:
// Default constructor/destructor kept protected for testing
@@ -103,9 +105,17 @@
, m_ConnectionAcknowledgedCommandHandler(1,
m_PacketVersionResolver.ResolvePacketVersion(1).GetEncodedValue(),
m_StateMachine)
+ , m_RequestCounterDirectoryCommandHandler(3,
+ m_PacketVersionResolver.ResolvePacketVersion(3).GetEncodedValue(),
+ m_CounterDirectory,
+ m_SendCounterPacket,
+ m_StateMachine)
{
// Register the "Connection Acknowledged" command handler
m_CommandHandlerRegistry.RegisterFunctor(&m_ConnectionAcknowledgedCommandHandler);
+
+ // Register the "Request Counter Directory" command handler
+ m_CommandHandlerRegistry.RegisterFunctor(&m_RequestCounterDirectoryCommandHandler);
}
~ProfilingService() = default;
@@ -124,6 +134,10 @@
{
return instance.m_ProfilingConnection.get();
}
+ void TransitionToState(ProfilingService& instance, ProfilingState newState)
+ {
+ instance.m_StateMachine.TransitionToState(newState);
+ }
};
} // namespace profiling