aboutsummaryrefslogtreecommitdiff
path: root/tests/profiling/GatordMockService.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/profiling/GatordMockService.hpp')
-rw-r--r--tests/profiling/GatordMockService.hpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/profiling/GatordMockService.hpp b/tests/profiling/GatordMockService.hpp
new file mode 100644
index 0000000000..c19e710d69
--- /dev/null
+++ b/tests/profiling/GatordMockService.hpp
@@ -0,0 +1,50 @@
+//
+// Copyright © 2019 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include <string>
+
+namespace armnn
+{
+
+namespace gatordmock
+{
+
+
+/**
+ * A class that implements a Mock Gatord server. It will listen on a specified Unix domain socket (UDS)
+ * namespace for client connections.
+ */
+class GatordMockService
+{
+public:
+
+ /**
+ * Establish the Unix domain socket and set it to listen for connections.
+ *
+ * @param udsNamespace the namespace (socket address) associated with the listener.
+ * @return true only if the socket has been correctly setup.
+ */
+ bool OpenListeningSocket(std::string udsNamespace);
+
+ /**
+ * Block waiting to accept one client to connect to the UDS.
+ *
+ * @return the file descriptor of the client connection.
+ */
+ int BlockForOneClient();
+
+private:
+
+ int m_ListeningSocket;
+};
+
+
+} // namespace gatordmock
+
+} // namespace armnn
+
+