feat(trading): trb data structures
This commit is contained in:
parent
3c949f3da3
commit
d23e2ed4d4
1 changed files with 9 additions and 9 deletions
|
|
@ -200,19 +200,19 @@
|
||||||
</p>
|
</p>
|
||||||
<div class="code" data-file="monotonic.cpp"></div>
|
<div class="code" data-file="monotonic.cpp"></div>
|
||||||
<h3>further improvements</h3>
|
<h3>further improvements</h3>
|
||||||
|
<p>
|
||||||
|
The final implementation utilized in the TRB includes the
|
||||||
|
following features:
|
||||||
|
</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
The class could leverage templates to take in a comparator
|
A ringbuffer a statically-allocated <code>std::array</code>, as
|
||||||
<span><code>std::less<double></code></span>
|
any fix-sized queue can be supplanted with one
|
||||||
) to easily specify a minimum/maximum
|
|
||||||
<span><code>ExtremaCircularBuffer</code></span>
|
|
||||||
as well as a value type to support all operations.
|
|
||||||
</li>
|
</li>
|
||||||
|
<li>A templatized value type and comparator for flexibility</li>
|
||||||
<li>
|
<li>
|
||||||
As it stands, the class also only maintains one of either
|
C++ specific optimizations (rule of 5, smart pointers, and an
|
||||||
extrema, and using two monotonic deques, while still
|
STL-compliant API)
|
||||||
<i>theoretically</i> optimal, doesn't give me a good
|
|
||||||
feeling. The second map-based approach might be favorable here.
|
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue