175 lines
20 KiB
HTML
175 lines
20 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.13.2"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>GridFire: src/python/expectations/bindings.cpp Source File</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>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="cookie.js"></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" />
|
|
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
|
<link href="doxygen-awesome-sidebar-only.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 id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">GridFire<span id="projectnumber"> 0.0.1a</span>
|
|
</div>
|
|
<div id="projectbrief">General Purpose Nuclear Network</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.13.2 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { codefold.init(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search',true);
|
|
$(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</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">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function(){initNavTree('expectations_2bindings_8cpp_source.html',''); initResizable(true); });
|
|
/* @license-end */
|
|
</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">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">bindings.cpp</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="expectations_2bindings_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#include <pybind11/pybind11.h></span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#include <pybind11/stl.h></span> <span class="comment">// Needed for vectors, maps, sets, strings</span></div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#include <pybind11/stl_bind.h></span> <span class="comment">// Needed for binding std::vector, std::map etc. if needed directly</span></div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include "<a class="code" href="expectations_2bindings_8h.html">bindings.h</a>"</span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keyword">namespace </span>py = pybind11;</div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include "<a class="code" href="expectations_8h.html">gridfire/expectations/expectations.h</a>"</span></div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
|
|
<div class="foldopen" id="foldopen00011" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="expectations_2bindings_8cpp.html#ac6720822f6ad76636adbc1ae6febc2c2"> 11</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="expectations_2bindings_8cpp.html#ac6720822f6ad76636adbc1ae6febc2c2">register_expectation_bindings</a>(py::module &m) {</div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> py::enum_<gridfire::expectations::EngineErrorTypes>(m, <span class="stringliteral">"EngineErrorTypes"</span>)</div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> .value(<span class="stringliteral">"FAILURE"</span>, <a class="code hl_enumvalue" href="namespacegridfire_1_1expectations.html#a926cb0409b1f38770eb028bcac70a87ca36fc6065a3e970bc3e6b2e59da52bf2a">gridfire::expectations::EngineErrorTypes::FAILURE</a>)</div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> .value(<span class="stringliteral">"INDEX"</span>, <a class="code hl_enumvalue" href="namespacegridfire_1_1expectations.html#a926cb0409b1f38770eb028bcac70a87cacb4ae3b37047fb4b2c0d16f8bf84f076">gridfire::expectations::EngineErrorTypes::INDEX</a>)</div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> .value(<span class="stringliteral">"STALE"</span>, <a class="code hl_enumvalue" href="namespacegridfire_1_1expectations.html#a926cb0409b1f38770eb028bcac70a87ca4d855a061b3066dc14a3b12ed26b5456">gridfire::expectations::EngineErrorTypes::STALE</a>)</div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> .export_values();</div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> py::enum_<gridfire::expectations::StaleEngineErrorTypes>(m, <span class="stringliteral">"StaleEngineErrorTypes"</span>)</div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> .value(<span class="stringliteral">"SYSTEM_RESIZED"</span>, <a class="code hl_enumvalue" href="namespacegridfire_1_1expectations.html#aef568e2802c03adef56dbcb6511d66c7a109aa03c8823fcc0ab193b7e48664cbf">gridfire::expectations::StaleEngineErrorTypes::SYSTEM_RESIZED</a>)</div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> .export_values();</div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="comment">// Bind the base class</span></div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> py::class_<gridfire::expectations::EngineError>(m, <span class="stringliteral">"EngineError"</span>)</div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> .def_readonly(<span class="stringliteral">"message"</span>, &<a class="code hl_variable" href="structgridfire_1_1expectations_1_1_engine_error.html#ad05b8d2f5ce9925f749c9f528f2428dc">gridfire::expectations::EngineError::m_message</a>)</div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> .def_readonly(<span class="stringliteral">"type"</span>, &<a class="code hl_variable" href="structgridfire_1_1expectations_1_1_engine_error.html#ac5fcafed01de529e03afa055d18bd897">gridfire::expectations::EngineError::type</a>)</div>
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> .def(<span class="stringliteral">"__str__"</span>, [](<span class="keyword">const</span> <a class="code hl_struct" href="structgridfire_1_1expectations_1_1_engine_error.html">gridfire::expectations::EngineError</a> &e) {<span class="keywordflow">return</span> e.<a class="code hl_variable" href="structgridfire_1_1expectations_1_1_engine_error.html#ad05b8d2f5ce9925f749c9f528f2428dc">m_message</a>;});</div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="comment">// Bind the EngineIndexError, specifying EngineError as the base</span></div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> py::class_<gridfire::expectations::EngineIndexError, gridfire::expectations::EngineError>(m, <span class="stringliteral">"EngineIndexError"</span>)</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> .def(py::init<int>(), py::arg(<span class="stringliteral">"index"</span>))</div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> .def_readonly(<span class="stringliteral">"index"</span>, &<a class="code hl_variable" href="structgridfire_1_1expectations_1_1_engine_index_error.html#aa20994243d56f24d89230887b881e03e">gridfire::expectations::EngineIndexError::m_index</a>)</div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> .def(<span class="stringliteral">"__str__"</span>, [](<span class="keyword">const</span> <a class="code hl_struct" href="structgridfire_1_1expectations_1_1_engine_index_error.html">gridfire::expectations::EngineIndexError</a> &e) {</div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">return</span> e.<a class="code hl_variable" href="structgridfire_1_1expectations_1_1_engine_error.html#ad05b8d2f5ce9925f749c9f528f2428dc">m_message</a> + <span class="stringliteral">" at index "</span> + std::to_string(e.m_index);</div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> });</div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// Bind the StaleEngineError, specifying EngineError as the base</span></div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> py::class_<gridfire::expectations::StaleEngineError, gridfire::expectations::EngineError>(m, <span class="stringliteral">"StaleEngineError"</span>)</div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> .def(py::init<gridfire::expectations::StaleEngineErrorTypes>(), py::arg(<span class="stringliteral">"stale_type"</span>))</div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> .def_readonly(<span class="stringliteral">"stale_type"</span>, &<a class="code hl_variable" href="structgridfire_1_1expectations_1_1_stale_engine_error.html#a10bce51a63024715959a66673b909590">gridfire::expectations::StaleEngineError::staleType</a>)</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> .def(<span class="stringliteral">"__str__"</span>, [](<span class="keyword">const</span> <a class="code hl_struct" href="structgridfire_1_1expectations_1_1_stale_engine_error.html">gridfire::expectations::StaleEngineError</a> &e) {</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">return</span> <span class="keyword">static_cast<</span>std::string<span class="keyword">></span>(e);</div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> });</div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span>}</div>
|
|
</div>
|
|
<div class="ttc" id="aexpectations_2bindings_8cpp_html_ac6720822f6ad76636adbc1ae6febc2c2"><div class="ttname"><a href="expectations_2bindings_8cpp.html#ac6720822f6ad76636adbc1ae6febc2c2">register_expectation_bindings</a></div><div class="ttdeci">void register_expectation_bindings(py::module &m)</div><div class="ttdef"><b>Definition</b> <a href="#l00011">bindings.cpp:11</a></div></div>
|
|
<div class="ttc" id="aexpectations_2bindings_8h_html"><div class="ttname"><a href="expectations_2bindings_8h.html">bindings.h</a></div></div>
|
|
<div class="ttc" id="aexpectations_8h_html"><div class="ttname"><a href="expectations_8h.html">expectations.h</a></div></div>
|
|
<div class="ttc" id="anamespacegridfire_1_1expectations_html_a926cb0409b1f38770eb028bcac70a87ca36fc6065a3e970bc3e6b2e59da52bf2a"><div class="ttname"><a href="namespacegridfire_1_1expectations.html#a926cb0409b1f38770eb028bcac70a87ca36fc6065a3e970bc3e6b2e59da52bf2a">gridfire::expectations::EngineErrorTypes::FAILURE</a></div><div class="ttdeci">@ FAILURE</div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00008">expected_engine.h:8</a></div></div>
|
|
<div class="ttc" id="anamespacegridfire_1_1expectations_html_a926cb0409b1f38770eb028bcac70a87ca4d855a061b3066dc14a3b12ed26b5456"><div class="ttname"><a href="namespacegridfire_1_1expectations.html#a926cb0409b1f38770eb028bcac70a87ca4d855a061b3066dc14a3b12ed26b5456">gridfire::expectations::EngineErrorTypes::STALE</a></div><div class="ttdeci">@ STALE</div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00010">expected_engine.h:10</a></div></div>
|
|
<div class="ttc" id="anamespacegridfire_1_1expectations_html_a926cb0409b1f38770eb028bcac70a87cacb4ae3b37047fb4b2c0d16f8bf84f076"><div class="ttname"><a href="namespacegridfire_1_1expectations.html#a926cb0409b1f38770eb028bcac70a87cacb4ae3b37047fb4b2c0d16f8bf84f076">gridfire::expectations::EngineErrorTypes::INDEX</a></div><div class="ttdeci">@ INDEX</div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00009">expected_engine.h:9</a></div></div>
|
|
<div class="ttc" id="anamespacegridfire_1_1expectations_html_aef568e2802c03adef56dbcb6511d66c7a109aa03c8823fcc0ab193b7e48664cbf"><div class="ttname"><a href="namespacegridfire_1_1expectations.html#aef568e2802c03adef56dbcb6511d66c7a109aa03c8823fcc0ab193b7e48664cbf">gridfire::expectations::StaleEngineErrorTypes::SYSTEM_RESIZED</a></div><div class="ttdeci">@ SYSTEM_RESIZED</div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00014">expected_engine.h:14</a></div></div>
|
|
<div class="ttc" id="astructgridfire_1_1expectations_1_1_engine_error_html"><div class="ttname"><a href="structgridfire_1_1expectations_1_1_engine_error.html">gridfire::expectations::EngineError</a></div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00018">expected_engine.h:18</a></div></div>
|
|
<div class="ttc" id="astructgridfire_1_1expectations_1_1_engine_error_html_ac5fcafed01de529e03afa055d18bd897"><div class="ttname"><a href="structgridfire_1_1expectations_1_1_engine_error.html#ac5fcafed01de529e03afa055d18bd897">gridfire::expectations::EngineError::type</a></div><div class="ttdeci">const EngineErrorTypes type</div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00020">expected_engine.h:20</a></div></div>
|
|
<div class="ttc" id="astructgridfire_1_1expectations_1_1_engine_error_html_ad05b8d2f5ce9925f749c9f528f2428dc"><div class="ttname"><a href="structgridfire_1_1expectations_1_1_engine_error.html#ad05b8d2f5ce9925f749c9f528f2428dc">gridfire::expectations::EngineError::m_message</a></div><div class="ttdeci">std::string m_message</div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00019">expected_engine.h:19</a></div></div>
|
|
<div class="ttc" id="astructgridfire_1_1expectations_1_1_engine_index_error_html"><div class="ttname"><a href="structgridfire_1_1expectations_1_1_engine_index_error.html">gridfire::expectations::EngineIndexError</a></div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00033">expected_engine.h:33</a></div></div>
|
|
<div class="ttc" id="astructgridfire_1_1expectations_1_1_engine_index_error_html_aa20994243d56f24d89230887b881e03e"><div class="ttname"><a href="structgridfire_1_1expectations_1_1_engine_index_error.html#aa20994243d56f24d89230887b881e03e">gridfire::expectations::EngineIndexError::m_index</a></div><div class="ttdeci">int m_index</div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00034">expected_engine.h:34</a></div></div>
|
|
<div class="ttc" id="astructgridfire_1_1expectations_1_1_stale_engine_error_html"><div class="ttname"><a href="structgridfire_1_1expectations_1_1_stale_engine_error.html">gridfire::expectations::StaleEngineError</a></div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00044">expected_engine.h:44</a></div></div>
|
|
<div class="ttc" id="astructgridfire_1_1expectations_1_1_stale_engine_error_html_a10bce51a63024715959a66673b909590"><div class="ttname"><a href="structgridfire_1_1expectations_1_1_stale_engine_error.html#a10bce51a63024715959a66673b909590">gridfire::expectations::StaleEngineError::staleType</a></div><div class="ttdeci">StaleEngineErrorTypes staleType</div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00045">expected_engine.h:45</a></div></div>
|
|
</div><!-- fragment --></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="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_5c0d64f70903e893b1efe571a4b8de29.html">python</a></li><li class="navelem"><a class="el" href="dir_1ae9febcce3c81c54e014e2202672ae2.html">expectations</a></li><li class="navelem"><a class="el" href="expectations_2bindings_8cpp.html">bindings.cpp</a></li>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|