feat(trading): trb data structures

This commit is contained in:
Barrett Ruth 2024-11-30 20:24:45 -06:00
parent 3c949f3da3
commit d23e2ed4d4

View file

@ -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&lt;double&gt;</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&apos;t give me a good
feeling. The second map-based approach might be favorable here.
</li> </li>
</ol> </ol>
</div> </div>