blob: 8a083df0f83d1badfc5484acdeb4c0c7f967636b [file] [log] [blame]
Nikhil Raj9aed8fb2021-11-17 13:16:45 +00001<!-- Copyright (c) 2020 ARM Limited. -->
2<!-- -->
3<!-- SPDX-License-Identifier: MIT -->
4<!-- -->
5<!-- HTML header for doxygen 1.8.13-->
6<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7<html xmlns="http://www.w3.org/1999/xhtml">
8<head>
9<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
10<meta http-equiv="X-UA-Compatible" content="IE=9"/>
11<meta name="generator" content="Doxygen 1.8.13"/>
12<meta name="robots" content="NOINDEX, NOFOLLOW" />
13<meta name="viewport" content="width=device-width, initial-scale=1"/>
14<title>ArmNN: CommandLineProcessor Class Reference</title>
15<link href="tabs.css" rel="stylesheet" type="text/css"/>
16<script type="text/javascript" src="jquery.js"></script>
17<script type="text/javascript" src="dynsections.js"></script>
18<link href="navtree.css" rel="stylesheet" type="text/css"/>
19<script type="text/javascript" src="resize.js"></script>
20<script type="text/javascript" src="navtreedata.js"></script>
21<script type="text/javascript" src="navtree.js"></script>
22<script type="text/javascript">
23 $(document).ready(initResizable);
24</script>
25<link href="search/search.css" rel="stylesheet" type="text/css"/>
26<script type="text/javascript" src="search/searchdata.js"></script>
27<script type="text/javascript" src="search/search.js"></script>
28<script type="text/x-mathjax-config">
29 MathJax.Hub.Config({
30 extensions: ["tex2jax.js"],
31 jax: ["input/TeX","output/HTML-CSS"],
32});
33</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
34<link href="doxygen.css" rel="stylesheet" type="text/css" />
35<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
36</head>
37<body>
38<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
39<div id="titlearea">
40<table cellspacing="0" cellpadding="0">
41 <tbody>
42 <tr style="height: 56px;">
43 <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/>
44 <td style="padding-left: 0.5em;">
45 <div id="projectname">
46 &#160;<span id="projectnumber">21.11</span>
47 </div>
48 </td>
49 </tr>
50 </tbody>
51</table>
52</div>
53<!-- end header part -->
54<!-- Generated by Doxygen 1.8.13 -->
55<script type="text/javascript">
56var searchBox = new SearchBox("searchBox", "search",false,'Search');
57</script>
58<script type="text/javascript" src="menudata.js"></script>
59<script type="text/javascript" src="menu.js"></script>
60<script type="text/javascript">
61$(function() {
62 initMenu('',true,false,'search.php','Search');
63 $(document).ready(function() { init_search(); });
64});
65</script>
66<div id="main-nav"></div>
67</div><!-- top -->
68<div id="side-nav" class="ui-resizable side-nav-resizable">
69 <div id="nav-tree">
70 <div id="nav-tree-contents">
71 <div id="nav-sync" class="sync"></div>
72 </div>
73 </div>
74 <div id="splitbar" style="-moz-user-select:none;"
75 class="ui-resizable-handle">
76 </div>
77</div>
78<script type="text/javascript">
79$(document).ready(function(){initNavTree('classarmnn_1_1gatordmock_1_1_command_line_processor.xhtml','');});
80</script>
81<div id="doc-content">
82<!-- window showing the filter options -->
83<div id="MSearchSelectWindow"
84 onmouseover="return searchBox.OnSearchSelectShow()"
85 onmouseout="return searchBox.OnSearchSelectHide()"
86 onkeydown="return searchBox.OnSearchSelectKey(event)">
87</div>
88
89<!-- iframe showing the search results (closed by default) -->
90<div id="MSearchResultsWindow">
91<iframe src="javascript:void(0)" frameborder="0"
92 name="MSearchResults" id="MSearchResults">
93</iframe>
94</div>
95
96<div class="header">
97 <div class="summary">
98<a href="#pub-methods">Public Member Functions</a> &#124;
99<a href="classarmnn_1_1gatordmock_1_1_command_line_processor-members.xhtml">List of all members</a> </div>
100 <div class="headertitle">
101<div class="title">CommandLineProcessor Class Reference</div> </div>
102</div><!--header-->
103<div class="contents">
104
105<p>Use Boost program options to process the command line.
106 <a href="classarmnn_1_1gatordmock_1_1_command_line_processor.xhtml#details">More...</a></p>
107
108<p><code>#include &lt;<a class="el" href="_command_line_processor_8hpp_source.xhtml">CommandLineProcessor.hpp</a>&gt;</code></p>
109<table class="memberdecls">
110<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
111Public Member Functions</h2></td></tr>
112<tr class="memitem:a2f7e28f477647e992871d50e7b793221"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_command_line_processor.xhtml#a2f7e28f477647e992871d50e7b793221">ProcessCommandLine</a> (int argc, char *argv[])</td></tr>
113<tr class="separator:a2f7e28f477647e992871d50e7b793221"><td class="memSeparator" colspan="2">&#160;</td></tr>
114<tr class="memitem:a75f41b893fe47f7bc9d30f58d94ab905"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_command_line_processor.xhtml#a75f41b893fe47f7bc9d30f58d94ab905">IsEchoEnabled</a> ()</td></tr>
115<tr class="separator:a75f41b893fe47f7bc9d30f58d94ab905"><td class="memSeparator" colspan="2">&#160;</td></tr>
116<tr class="memitem:a40e03b7685895e3d6fc5e45b0889f3f5"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_command_line_processor.xhtml#a40e03b7685895e3d6fc5e45b0889f3f5">GetUdsNamespace</a> ()</td></tr>
117<tr class="separator:a40e03b7685895e3d6fc5e45b0889f3f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
118<tr class="memitem:afc0b543e840606e43193b7d037c07c03"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1gatordmock_1_1_command_line_processor.xhtml#afc0b543e840606e43193b7d037c07c03">GetCommandFile</a> ()</td></tr>
119<tr class="separator:afc0b543e840606e43193b7d037c07c03"><td class="memSeparator" colspan="2">&#160;</td></tr>
120</table>
121<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
122<div class="textblock"><p>Use Boost program options to process the command line. </p>
123<p>-h or &ndash;help to print the options. -n or &ndash;namespace to specify the UDS namespace that the server will be listening on. -e or &ndash;echo print all sent and received packets to stdout. -f or &ndash;file The path to the file that contains instructions for the mock gatord. </p>
124
125<p class="definition">Definition at line <a class="el" href="_command_line_processor_8hpp_source.xhtml#l00020">20</a> of file <a class="el" href="_command_line_processor_8hpp_source.xhtml">CommandLineProcessor.hpp</a>.</p>
126</div><h2 class="groupheader">Member Function Documentation</h2>
127<a id="afc0b543e840606e43193b7d037c07c03"></a>
128<h2 class="memtitle"><span class="permalink"><a href="#afc0b543e840606e43193b7d037c07c03">&#9670;&nbsp;</a></span>GetCommandFile()</h2>
129
130<div class="memitem">
131<div class="memproto">
132<table class="mlabels">
133 <tr>
134 <td class="mlabels-left">
135 <table class="memname">
136 <tr>
137 <td class="memname">std::string GetCommandFile </td>
138 <td>(</td>
139 <td class="paramname"></td><td>)</td>
140 <td></td>
141 </tr>
142 </table>
143 </td>
144 <td class="mlabels-right">
145<span class="mlabels"><span class="mlabel">inline</span></span> </td>
146 </tr>
147</table>
148</div><div class="memdoc">
149
150<p class="definition">Definition at line <a class="el" href="_command_line_processor_8hpp_source.xhtml#l00033">33</a> of file <a class="el" href="_command_line_processor_8hpp_source.xhtml">CommandLineProcessor.hpp</a>.</p>
151
152<p class="reference">Referenced by <a class="el" href="_gatord_mock_main_8cpp_source.xhtml#l00052">main()</a>.</p>
153<div class="fragment"><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keywordflow">return</span> m_File;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; }</div></div><!-- fragment -->
154</div>
155</div>
156<a id="a40e03b7685895e3d6fc5e45b0889f3f5"></a>
157<h2 class="memtitle"><span class="permalink"><a href="#a40e03b7685895e3d6fc5e45b0889f3f5">&#9670;&nbsp;</a></span>GetUdsNamespace()</h2>
158
159<div class="memitem">
160<div class="memproto">
161<table class="mlabels">
162 <tr>
163 <td class="mlabels-left">
164 <table class="memname">
165 <tr>
166 <td class="memname">std::string GetUdsNamespace </td>
167 <td>(</td>
168 <td class="paramname"></td><td>)</td>
169 <td></td>
170 </tr>
171 </table>
172 </td>
173 <td class="mlabels-right">
174<span class="mlabels"><span class="mlabel">inline</span></span> </td>
175 </tr>
176</table>
177</div><div class="memdoc">
178
179<p class="definition">Definition at line <a class="el" href="_command_line_processor_8hpp_source.xhtml#l00029">29</a> of file <a class="el" href="_command_line_processor_8hpp_source.xhtml">CommandLineProcessor.hpp</a>.</p>
180
181<p class="reference">Referenced by <a class="el" href="_gatord_mock_main_8cpp_source.xhtml#l00052">main()</a>.</p>
182<div class="fragment"><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; {</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <span class="keywordflow">return</span> m_UdsNamespace;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; }</div></div><!-- fragment -->
183</div>
184</div>
185<a id="a75f41b893fe47f7bc9d30f58d94ab905"></a>
186<h2 class="memtitle"><span class="permalink"><a href="#a75f41b893fe47f7bc9d30f58d94ab905">&#9670;&nbsp;</a></span>IsEchoEnabled()</h2>
187
188<div class="memitem">
189<div class="memproto">
190<table class="mlabels">
191 <tr>
192 <td class="mlabels-left">
193 <table class="memname">
194 <tr>
195 <td class="memname">bool IsEchoEnabled </td>
196 <td>(</td>
197 <td class="paramname"></td><td>)</td>
198 <td></td>
199 </tr>
200 </table>
201 </td>
202 <td class="mlabels-right">
203<span class="mlabels"><span class="mlabel">inline</span></span> </td>
204 </tr>
205</table>
206</div><div class="memdoc">
207
208<p class="definition">Definition at line <a class="el" href="_command_line_processor_8hpp_source.xhtml#l00024">24</a> of file <a class="el" href="_command_line_processor_8hpp_source.xhtml">CommandLineProcessor.hpp</a>.</p>
209<div class="fragment"><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; {</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; <span class="keywordflow">return</span> m_Echo;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; }</div></div><!-- fragment -->
210</div>
211</div>
212<a id="a2f7e28f477647e992871d50e7b793221"></a>
213<h2 class="memtitle"><span class="permalink"><a href="#a2f7e28f477647e992871d50e7b793221">&#9670;&nbsp;</a></span>ProcessCommandLine()</h2>
214
215<div class="memitem">
216<div class="memproto">
217 <table class="memname">
218 <tr>
219 <td class="memname">bool ProcessCommandLine </td>
220 <td>(</td>
221 <td class="paramtype">int&#160;</td>
222 <td class="paramname"><em>argc</em>, </td>
223 </tr>
224 <tr>
225 <td class="paramkey"></td>
226 <td></td>
227 <td class="paramtype">char *&#160;</td>
228 <td class="paramname"><em>argv</em>[]&#160;</td>
229 </tr>
230 <tr>
231 <td></td>
232 <td>)</td>
233 <td></td><td></td>
234 </tr>
235 </table>
236</div><div class="memdoc">
237
238<p class="definition">Definition at line <a class="el" href="_command_line_processor_8cpp_source.xhtml#l00016">16</a> of file <a class="el" href="_command_line_processor_8cpp_source.xhtml">CommandLineProcessor.cpp</a>.</p>
239
240<p class="reference">Referenced by <a class="el" href="_gatord_mock_main_8cpp_source.xhtml#l00052">main()</a>.</p>
241<div class="fragment"><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;{</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160; cxxopts::Options options(<span class="stringliteral">&quot;GatordMock&quot;</span>,</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; <span class="stringliteral">&quot;Simulate a Gatord server to interact with ArmNN external profiling.&quot;</span>);</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; <span class="keywordflow">try</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; {</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; options.add_options()</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; (<span class="stringliteral">&quot;h,help&quot;</span>, <span class="stringliteral">&quot;Display help messages&quot;</span>)</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; (<span class="stringliteral">&quot;f,file&quot;</span>,</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; <span class="stringliteral">&quot;The path to the file that contains instructions for the mock gatord.&quot;</span>,</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; cxxopts::value&lt;std::string&gt;(m_File))</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; (<span class="stringliteral">&quot;n,namespace&quot;</span>,</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <span class="stringliteral">&quot;The Unix domain socket namespace this server will bind to.\n&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <span class="stringliteral">&quot;This will always be prepended with \\0 to use the abstract namespace&quot;</span>,</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; cxxopts::value&lt;std::string&gt;(m_UdsNamespace)-&gt;default_value(<span class="stringliteral">&quot;gatord_namespace&quot;</span>))</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; (<span class="stringliteral">&quot;e,echo&quot;</span>,</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; <span class="stringliteral">&quot;Echo packets sent and received to stdout. Disabled by default. &quot;</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="stringliteral">&quot;Default value = false.&quot;</span>,</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; cxxopts::value&lt;bool&gt;(m_Echo)-&gt;default_value(<span class="stringliteral">&quot;false&quot;</span>));</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; }</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::exception&amp; e)</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; {</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; std::cerr &lt;&lt; <span class="stringliteral">&quot;Fatal internal error: [&quot;</span> &lt;&lt; e.what() &lt;&lt; <span class="stringliteral">&quot;]&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; }</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keywordflow">try</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keyword">auto</span> result = options.parse(argc, argv);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordflow">if</span> (result.count(<span class="stringliteral">&quot;help&quot;</span>))</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; {</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; std::cout &lt;&lt; options.help() &lt;&lt; std::endl;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; }</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="comment">// Currently the file parameter is mandatory.</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordflow">if</span> (!result.count(<span class="stringliteral">&quot;file&quot;</span>))</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; {</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; std::cout &lt;&lt; <span class="stringliteral">&quot;-f/--file parameter is mandatory.&quot;</span> &lt;&lt; std::endl;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; }</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="comment">// Sets bool value correctly.</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keywordflow">if</span> (result.count(<span class="stringliteral">&quot;echo&quot;</span>))</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; m_Echo = <span class="keyword">true</span>;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; }</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; }</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">catch</span> (<span class="keyword">const</span> cxxopts::OptionException&amp; e)</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; {</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; std::cerr &lt;&lt; e.what() &lt;&lt; std::endl;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; }</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;}</div></div><!-- fragment -->
242</div>
243</div>
244<hr/>The documentation for this class was generated from the following files:<ul>
245<li>tests/profiling/gatordmock/<a class="el" href="_command_line_processor_8hpp_source.xhtml">CommandLineProcessor.hpp</a></li>
246<li>tests/profiling/gatordmock/<a class="el" href="_command_line_processor_8cpp_source.xhtml">CommandLineProcessor.cpp</a></li>
247</ul>
248</div><!-- contents -->
249</div><!-- doc-content -->
250<!-- start footer part -->
251<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
252 <ul>
253 <li class="navelem"><a class="el" href="namespacearmnn.xhtml">armnn</a></li><li class="navelem"><a class="el" href="namespacearmnn_1_1gatordmock.xhtml">gatordmock</a></li><li class="navelem"><a class="el" href="classarmnn_1_1gatordmock_1_1_command_line_processor.xhtml">CommandLineProcessor</a></li>
254 <li class="footer">Generated on Wed Nov 17 2021 12:59:46 for ArmNN by
255 <a href="http://www.doxygen.org/index.html">
256 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
257 </ul>
258</div>
259</body>
260</html>