blob: 72aa554f3be272a2c9867e06798faa31d131db6b [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ArmNN: CommandLineProcessor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">ArmNN
&#160;<span id="projectnumber">NotReleased</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classarmnn_1_1gatordmock_1_1_command_line_processor.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classarmnn_1_1gatordmock_1_1_command_line_processor-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">CommandLineProcessor Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="tests_2profiling_2gatordmock_2_command_line_processor_8hpp_source.html">CommandLineProcessor.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<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>
<tr class="separator:a2f7e28f477647e992871d50e7b793221"><td class="memSeparator" colspan="2">&#160;</td></tr>
<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>
<tr class="separator:a75f41b893fe47f7bc9d30f58d94ab905"><td class="memSeparator" colspan="2">&#160;</td></tr>
<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>
<tr class="separator:a40e03b7685895e3d6fc5e45b0889f3f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<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>
<tr class="separator:afc0b543e840606e43193b7d037c07c03"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<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>
<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>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="afc0b543e840606e43193b7d037c07c03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afc0b543e840606e43193b7d037c07c03">&#9670;&nbsp;</a></span>GetCommandFile()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::string GetCommandFile </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<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>
<p class="reference">Referenced by <a class="el" href="_gatord_mock_main_8cpp_source.html#l00018">main()</a>.</p>
<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 -->
</div>
</div>
<a id="a40e03b7685895e3d6fc5e45b0889f3f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40e03b7685895e3d6fc5e45b0889f3f5">&#9670;&nbsp;</a></span>GetUdsNamespace()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::string GetUdsNamespace </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<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>
<p class="reference">Referenced by <a class="el" href="_gatord_mock_main_8cpp_source.html#l00018">main()</a>.</p>
<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 -->
</div>
</div>
<a id="a75f41b893fe47f7bc9d30f58d94ab905"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a75f41b893fe47f7bc9d30f58d94ab905">&#9670;&nbsp;</a></span>IsEchoEnabled()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool IsEchoEnabled </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<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>
<p class="reference">Referenced by <a class="el" href="_gatord_mock_main_8cpp_source.html#l00018">main()</a>.</p>
<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 -->
</div>
</div>
<a id="a2f7e28f477647e992871d50e7b793221"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f7e28f477647e992871d50e7b793221">&#9670;&nbsp;</a></span>ProcessCommandLine()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ProcessCommandLine </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>argc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *&#160;</td>
<td class="paramname"><em>argv</em>[]&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<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>
<p class="reference">References <a class="el" href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407acb5e100e5a9a3e7f6d1fd97512215282">armnn::error</a>.</p>
<p class="reference">Referenced by <a class="el" href="_gatord_mock_main_8cpp_source.html#l00018">main()</a>.</p>
<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>
</div><!-- fragment -->
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>tests/profiling/gatordmock/<a class="el" href="tests_2profiling_2gatordmock_2_command_line_processor_8hpp_source.html">CommandLineProcessor.hpp</a></li>
<li>tests/profiling/gatordmock/<a class="el" href="tests_2profiling_2gatordmock_2_command_line_processor_8cpp_source.html">CommandLineProcessor.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<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>
<li class="footer">Generated on Fri Mar 13 2020 16:07:05 for ArmNN by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>