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/test/ProfilingTests.hpp b/src/profiling/test/ProfilingTests.hpp
index 3e6cf63..e168616 100644
--- a/src/profiling/test/ProfilingTests.hpp
+++ b/src/profiling/test/ProfilingTests.hpp
@@ -40,17 +40,6 @@
     }
 };
 
-struct CoutRedirect
-{
-public:
-    CoutRedirect(std::streambuf* newStreamBuffer)
-        : m_Old(std::cout.rdbuf(newStreamBuffer)) {}
-    ~CoutRedirect() { std::cout.rdbuf(m_Old); }
-
-private:
-    std::streambuf* m_Old;
-};
-
 struct StreamRedirector
 {
 public:
@@ -190,6 +179,11 @@
         return boost::polymorphic_downcast<MockProfilingConnection*>(profilingConnection);
     }
 
+    void ForceTransitionToState(ProfilingState newState)
+    {
+        TransitionToState(ProfilingService::Instance(), newState);
+    }
+
 private:
     MockProfilingConnectionFactoryPtr m_MockProfilingConnectionFactory;
     IProfilingConnectionFactory* m_BackupProfilingConnectionFactory;