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