From fb14ebbd68e04876809145296af96f6f41857418 Mon Sep 17 00:00:00 2001 From: James Ward Date: Thu, 26 Nov 2020 11:08:12 +0000 Subject: IVGCVSW-5348 Update Doxygen Docu * Update Doxygen Documentation for 20.11 release Signed-off-by: James Ward Change-Id: Ib47edac7923a642a277b1169d1085e5622021dc0 --- 20.11/_gatord_mock_main_8cpp.xhtml | 239 +++++++++++++++++++++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 20.11/_gatord_mock_main_8cpp.xhtml (limited to '20.11/_gatord_mock_main_8cpp.xhtml') diff --git a/20.11/_gatord_mock_main_8cpp.xhtml b/20.11/_gatord_mock_main_8cpp.xhtml new file mode 100644 index 0000000000..a4bdb7f01e --- /dev/null +++ b/20.11/_gatord_mock_main_8cpp.xhtml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + +ArmNN: tests/profiling/gatordmock/GatordMockMain.cpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.11 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
GatordMockMain.cpp File Reference
+
+
+
#include "CommandFileParser.hpp"
+#include "CommandLineProcessor.hpp"
+#include "GatordMockService.hpp"
+#include <server/include/basePipeServer/ConnectionHandler.hpp>
+#include <string>
+#include <signal.h>
+
+

Go to the source code of this file.

+ + + + + + + + +

+Functions

void exit_capture (int signum)
 
bool CreateMockService (std::unique_ptr< arm::pipe::BasePipeServer > basePipeServer, std::string commandFile, bool isEchoEnabled)
 
int main (int argc, char *argv[])
 
+

Function Documentation

+ +

◆ CreateMockService()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool CreateMockService (std::unique_ptr< arm::pipe::BasePipeServer > basePipeServer,
std::string commandFile,
bool isEchoEnabled 
)
+
+ +

Definition at line 26 of file GatordMockMain.cpp.

+ +

References GatordMockService::LaunchReceivingThread(), CommandFileParser::ParseFile(), GatordMockService::SendConnectionAck(), GatordMockService::WaitForReceivingThread(), and GatordMockService::WaitForStreamMetaData().

+
29 {
30  GatordMockService mockService(std::move(basePipeServer), isEchoEnabled);
31 
32  // Send receive the stream metadata and send connection ack.
33  if (!mockService.WaitForStreamMetaData())
34  {
35  return EXIT_FAILURE;
36  }
37  mockService.SendConnectionAck();
38 
39  // Prepare to receive data.
40  mockService.LaunchReceivingThread();
41 
42  // Process the SET and WAIT command from the file.
43  CommandFileParser commandLineParser;
44  commandLineParser.ParseFile(commandFile, mockService);
45 
46  // Once we've finished processing the file wait for the receiving thread to close.
47  mockService.WaitForReceivingThread();
48 
49  return EXIT_SUCCESS;
50 }
void ParseFile(std::string CommandFile, GatordMockService &mockService)
+
A class that implements a Mock Gatord server.
+
This class parses a command file for the GatordMockService.
+
+
+
+ +

◆ exit_capture()

+ +
+
+ + + + + + + + +
void exit_capture (int signum)
+
+ +

Definition at line 20 of file GatordMockMain.cpp.

+ +

References armnn::IgnoreUnused().

+ +

Referenced by main().

+
21 {
23  run = false;
24 }
void IgnoreUnused(Ts &&...)
+
+
+
+ +

◆ main()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int main (int argc,
char * argv[] 
)
+
+ +

Definition at line 52 of file GatordMockMain.cpp.

+ +

References exit_capture(), CommandLineProcessor::GetCommandFile(), CommandLineProcessor::GetUdsNamespace(), and CommandLineProcessor::ProcessCommandLine().

+
53 {
54  // We need to capture ctrl-c so we can close any remaining sockets before exit
55  signal(SIGINT, exit_capture);
56 
57  // Process command line arguments
58  CommandLineProcessor cmdLine;
59  if (!cmdLine.ProcessCommandLine(argc, argv))
60  {
61  return EXIT_FAILURE;
62  }
63 
64  std::vector<std::thread> threads;
65  std::string commandFile = cmdLine.GetCommandFile();
66 
67  // make the socket non-blocking so we can exit the loop
68  arm::pipe::ConnectionHandler connectionHandler(cmdLine.GetUdsNamespace(), true);
69 
70  while (run)
71  {
72  auto basePipeServer = connectionHandler.GetNewBasePipeServer(cmdLine.IsEchoEnabled());
73 
74  if (basePipeServer != nullptr)
75  {
76  threads.emplace_back(
77  std::thread(CreateMockService, std::move(basePipeServer), commandFile, cmdLine.IsEchoEnabled()));
78  }
79 
80  std::this_thread::sleep_for(std::chrono::milliseconds(100u));
81  }
82 
83  std::for_each(threads.begin(), threads.end(), [](std::thread& t){t.join();});
84 }
bool ProcessCommandLine(int argc, char *argv[])
+
void exit_capture(int signum)
+
bool CreateMockService(std::unique_ptr< arm::pipe::BasePipeServer > basePipeServer, std::string commandFile, bool isEchoEnabled)
+ + + +
Use Boost program options to process the command line.
+
+
+
+
+
+ + + + -- cgit v1.2.1