183 lines
18 KiB
HTML
183 lines
18 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.0"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>My Project: include/Algo.hh 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>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { init_search(); });
|
|
/* @license-end */
|
|
</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 id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">My Project
|
|
</div>
|
|
</td>
|
|
<td> <div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
|
|
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.13.0 -->
|
|
<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>
|
|
</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('Algo_8hh_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">Algo.hh</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="Algo_8hh.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">#pragma once</span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// C++ Includes</span></div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include <memory></span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include <queue></span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include <atomic></span></div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include <thread></span></div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <future></span></div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// FastInAHurry includes</span></div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include "<a class="code" href="Publisher_8hh.html">Publisher.hh</a>"</span></div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include "<a class="code" href="ThreadSafeQueue_8hh.html">utils/ThreadSafeQueue.hh</a>"</span></div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include "<a class="code" href="ThreadPool_8hh.html">utils/ThreadPool.hh</a>"</span></div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
|
|
<div class="foldopen" id="foldopen00017" data-start="{" data-end="};">
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="classAlgo.html"> 17</a></span><span class="keyword">class </span><a class="code hl_function" href="classAlgo.html#aaf4f951979fc60411ed84c558f081867">Algo</a> {</div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">public</span>:</div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <a class="code hl_function" href="classAlgo.html#aaf4f951979fc60411ed84c558f081867">Algo</a>();</div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classAlgo.html#ac8b70d722d4b2c1ad5cad4a63c3b7c62">initialize</a>();</div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classAlgo.html#ac223b246cd2f8851c4e0893ff41547fa">generate_orders</a>();</div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classAlgo.html#a8fcaaeaa5ad212a126490a19370c9b7e">process</a>();</div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classAlgo.html#ac556564d232b2d90cec73718538ec804">send</a>(trading::Order&);</div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classAlgo.html#a6fef1866e14e8a08788cb1d54afcedaf">initialized</a>();</div>
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classAlgo.html#a330f03f9df9e5d1e2b701bc3f5e94524">stop</a>();</div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="keyword">private</span>:</div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="classAlgo.html#a889e1362976e78c4904007ee5edfd3fe"> 28</a></span> std::queue<trading::Order> <a class="code hl_variable" href="classAlgo.html#a889e1362976e78c4904007ee5edfd3fe">_orders</a>;</div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="classAlgo.html#a6cffb1f6d087978eba685bcb1d06b11d"> 29</a></span> std::atomic<bool> <a class="code hl_variable" href="classAlgo.html#a6cffb1f6d087978eba685bcb1d06b11d">_initialized</a>{<span class="keyword">false</span>};</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="classAlgo.html#a3ce5d714379ab5094b6d82b99421b4a3"> 30</a></span> std::atomic<bool> <a class="code hl_variable" href="classAlgo.html#a3ce5d714379ab5094b6d82b99421b4a3">_running</a>{<span class="keyword">false</span>};</div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="classAlgo.html#af5bcfa2719e948826f71983a18ec017d"> 31</a></span> std::shared_ptr<Publisher> <a class="code hl_variable" href="classAlgo.html#af5bcfa2719e948826f71983a18ec017d">_pub</a>;</div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="classAlgo.html#ac4f2da176cc2dc9ba757140a635fe9b8"> 33</a></span> <a class="code hl_class" href="classutils_1_1ThreadSafeQueue.html">utils::ThreadSafeQueue<trading::Order></a> <a class="code hl_variable" href="classAlgo.html#ac4f2da176cc2dc9ba757140a635fe9b8">_order_queue</a>;</div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="classAlgo.html#adb85594bf1d2e7c9357d353b5e97787d"> 34</a></span> <a class="code hl_class" href="classutils_1_1ThreadPool.html">utils::ThreadPool</a> <a class="code hl_variable" href="classAlgo.html#adb85594bf1d2e7c9357d353b5e97787d">_thread_pool</a>;</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"><a class="line" href="classAlgo.html#a4943cab875d5261b0abec360b68878e8"> 36</a></span> std::mutex <a class="code hl_variable" href="classAlgo.html#a4943cab875d5261b0abec360b68878e8">_send_mutex</a>;</div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="classAlgo.html#a743ddc60baad0afa7f036a529c340460"> 37</a></span> std::jthread <a class="code hl_variable" href="classAlgo.html#a743ddc60baad0afa7f036a529c340460">_reader_thread</a>;</div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="classAlgo.html#ac72ec5a778fce0be42ebf635f2c504d0"> 38</a></span> std::vector<std::jthread> <a class="code hl_variable" href="classAlgo.html#ac72ec5a778fce0be42ebf635f2c504d0">_worker_threads</a>;</div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classAlgo.html#a671449864b2d1a1af9a57970eb104a0f"> 39</a></span> std::vector<std::future<bool>> <a class="code hl_variable" href="classAlgo.html#a671449864b2d1a1af9a57970eb104a0f">_futures</a>;</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span>};</div>
|
|
</div>
|
|
<div class="ttc" id="aPublisher_8hh_html"><div class="ttname"><a href="Publisher_8hh.html">Publisher.hh</a></div></div>
|
|
<div class="ttc" id="aThreadPool_8hh_html"><div class="ttname"><a href="ThreadPool_8hh.html">ThreadPool.hh</a></div></div>
|
|
<div class="ttc" id="aThreadSafeQueue_8hh_html"><div class="ttname"><a href="ThreadSafeQueue_8hh.html">ThreadSafeQueue.hh</a></div></div>
|
|
<div class="ttc" id="aclassAlgo_html_a330f03f9df9e5d1e2b701bc3f5e94524"><div class="ttname"><a href="classAlgo.html#a330f03f9df9e5d1e2b701bc3f5e94524">Algo::stop</a></div><div class="ttdeci">void stop()</div><div class="ttdef"><b>Definition</b> Algo.cc:23</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_a3ce5d714379ab5094b6d82b99421b4a3"><div class="ttname"><a href="classAlgo.html#a3ce5d714379ab5094b6d82b99421b4a3">Algo::_running</a></div><div class="ttdeci">std::atomic< bool > _running</div><div class="ttdef"><b>Definition</b> Algo.hh:30</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_a4943cab875d5261b0abec360b68878e8"><div class="ttname"><a href="classAlgo.html#a4943cab875d5261b0abec360b68878e8">Algo::_send_mutex</a></div><div class="ttdeci">std::mutex _send_mutex</div><div class="ttdef"><b>Definition</b> Algo.hh:36</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_a671449864b2d1a1af9a57970eb104a0f"><div class="ttname"><a href="classAlgo.html#a671449864b2d1a1af9a57970eb104a0f">Algo::_futures</a></div><div class="ttdeci">std::vector< std::future< bool > > _futures</div><div class="ttdef"><b>Definition</b> Algo.hh:39</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_a6cffb1f6d087978eba685bcb1d06b11d"><div class="ttname"><a href="classAlgo.html#a6cffb1f6d087978eba685bcb1d06b11d">Algo::_initialized</a></div><div class="ttdeci">std::atomic< bool > _initialized</div><div class="ttdef"><b>Definition</b> Algo.hh:29</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_a6fef1866e14e8a08788cb1d54afcedaf"><div class="ttname"><a href="classAlgo.html#a6fef1866e14e8a08788cb1d54afcedaf">Algo::initialized</a></div><div class="ttdeci">bool initialized()</div><div class="ttdef"><b>Definition</b> Algo.cc:43</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_a743ddc60baad0afa7f036a529c340460"><div class="ttname"><a href="classAlgo.html#a743ddc60baad0afa7f036a529c340460">Algo::_reader_thread</a></div><div class="ttdeci">std::jthread _reader_thread</div><div class="ttdef"><b>Definition</b> Algo.hh:37</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_a889e1362976e78c4904007ee5edfd3fe"><div class="ttname"><a href="classAlgo.html#a889e1362976e78c4904007ee5edfd3fe">Algo::_orders</a></div><div class="ttdeci">std::queue< trading::Order > _orders</div><div class="ttdef"><b>Definition</b> Algo.hh:28</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_a8fcaaeaa5ad212a126490a19370c9b7e"><div class="ttname"><a href="classAlgo.html#a8fcaaeaa5ad212a126490a19370c9b7e">Algo::process</a></div><div class="ttdeci">void process()</div><div class="ttdef"><b>Definition</b> Algo.cc:47</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_aaf4f951979fc60411ed84c558f081867"><div class="ttname"><a href="classAlgo.html#aaf4f951979fc60411ed84c558f081867">Algo::Algo</a></div><div class="ttdeci">Algo()</div><div class="ttdef"><b>Definition</b> Algo.cc:11</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_ac223b246cd2f8851c4e0893ff41547fa"><div class="ttname"><a href="classAlgo.html#ac223b246cd2f8851c4e0893ff41547fa">Algo::generate_orders</a></div><div class="ttdeci">void generate_orders()</div><div class="ttdef"><b>Definition</b> Algo.cc:39</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_ac4f2da176cc2dc9ba757140a635fe9b8"><div class="ttname"><a href="classAlgo.html#ac4f2da176cc2dc9ba757140a635fe9b8">Algo::_order_queue</a></div><div class="ttdeci">utils::ThreadSafeQueue< trading::Order > _order_queue</div><div class="ttdef"><b>Definition</b> Algo.hh:33</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_ac556564d232b2d90cec73718538ec804"><div class="ttname"><a href="classAlgo.html#ac556564d232b2d90cec73718538ec804">Algo::send</a></div><div class="ttdeci">void send(trading::Order &)</div><div class="ttdef"><b>Definition</b> Algo.cc:106</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_ac72ec5a778fce0be42ebf635f2c504d0"><div class="ttname"><a href="classAlgo.html#ac72ec5a778fce0be42ebf635f2c504d0">Algo::_worker_threads</a></div><div class="ttdeci">std::vector< std::jthread > _worker_threads</div><div class="ttdef"><b>Definition</b> Algo.hh:38</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_ac8b70d722d4b2c1ad5cad4a63c3b7c62"><div class="ttname"><a href="classAlgo.html#ac8b70d722d4b2c1ad5cad4a63c3b7c62">Algo::initialize</a></div><div class="ttdeci">void initialize()</div><div class="ttdef"><b>Definition</b> Algo.cc:15</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_adb85594bf1d2e7c9357d353b5e97787d"><div class="ttname"><a href="classAlgo.html#adb85594bf1d2e7c9357d353b5e97787d">Algo::_thread_pool</a></div><div class="ttdeci">utils::ThreadPool _thread_pool</div><div class="ttdef"><b>Definition</b> Algo.hh:34</div></div>
|
|
<div class="ttc" id="aclassAlgo_html_af5bcfa2719e948826f71983a18ec017d"><div class="ttname"><a href="classAlgo.html#af5bcfa2719e948826f71983a18ec017d">Algo::_pub</a></div><div class="ttdeci">std::shared_ptr< Publisher > _pub</div><div class="ttdef"><b>Definition</b> Algo.hh:31</div></div>
|
|
<div class="ttc" id="aclassutils_1_1ThreadPool_html"><div class="ttname"><a href="classutils_1_1ThreadPool.html">utils::ThreadPool</a></div><div class="ttdef"><b>Definition</b> ThreadPool.hh:12</div></div>
|
|
<div class="ttc" id="aclassutils_1_1ThreadSafeQueue_html"><div class="ttname"><a href="classutils_1_1ThreadSafeQueue.html">utils::ThreadSafeQueue</a></div><div class="ttdef"><b>Definition</b> ThreadSafeQueue.hh:11</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_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="Algo_8hh.html">Algo.hh</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.0 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|