algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator Class Reference

Walks the outstanding orders, oldest first. More...

#include <algotradelib/src/backtest/engine.hpp>

Public Types

using iterator_category = std::forward_iterator_tag
 A forward iterator.
using value_type = QueuedOrder<BrokerTag>
 An outstanding order.
using difference_type = std::ptrdiff_t
 The distance between two positions.
using pointer = const QueuedOrder<BrokerTag>*
 A pointer to an order.
using reference = const QueuedOrder<BrokerTag>&
 A reference to an order.

Public Member Functions

 const_iterator ()=default
 An iterator past the end of an empty queue.
reference operator* () const noexcept
 Returns the order here.
pointer operator-> () const noexcept
 Points at the order here.
const_iterator & operator++ () noexcept
 Moves to the next outstanding order.
const_iterator operator++ (int) noexcept
 Moves to the next outstanding order.

Friends

class Queue
bool operator== (const const_iterator &lhs, const const_iterator &rhs) noexcept
 Compares two positions in one queue.
bool operator!= (const const_iterator &lhs, const const_iterator &rhs) noexcept
 Compares two positions in one queue.

Detailed Description

template<typename BrokerTag>
class algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator

Walks the outstanding orders, oldest first.

Definition at line 296 of file engine.hpp.

Member Typedef Documentation

◆ difference_type

template<typename BrokerTag>
using algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator::difference_type = std::ptrdiff_t

The distance between two positions.

Definition at line 303 of file engine.hpp.

◆ iterator_category

template<typename BrokerTag>
using algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator::iterator_category = std::forward_iterator_tag

A forward iterator.

Definition at line 299 of file engine.hpp.

◆ pointer

template<typename BrokerTag>
using algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator::pointer = const QueuedOrder<BrokerTag>*

A pointer to an order.

Definition at line 305 of file engine.hpp.

◆ reference

template<typename BrokerTag>
using algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator::reference = const QueuedOrder<BrokerTag>&

A reference to an order.

Definition at line 307 of file engine.hpp.

◆ value_type

template<typename BrokerTag>
using algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator::value_type = QueuedOrder<BrokerTag>

An outstanding order.

Definition at line 301 of file engine.hpp.

Constructor & Destructor Documentation

◆ const_iterator()

template<typename BrokerTag>
algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator::const_iterator ( )
default

Member Function Documentation

◆ operator*()

template<typename BrokerTag>
reference algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator::operator* ( ) const
inlinenoexcept

Returns the order here.

Returns
The order.

Definition at line 315 of file engine.hpp.

◆ operator++() [1/2]

template<typename BrokerTag>
const_iterator & algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator::operator++ ( )
inlinenoexcept

Moves to the next outstanding order.

Returns
This iterator.

Definition at line 329 of file engine.hpp.

◆ operator++() [2/2]

template<typename BrokerTag>
const_iterator algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator::operator++ ( int )
inlinenoexcept

Moves to the next outstanding order.

Returns
The iterator as it was.

Definition at line 338 of file engine.hpp.

◆ operator->()

template<typename BrokerTag>
pointer algotradelib::backtest::QueueingExecutor< BrokerTag >::Queue::const_iterator::operator-> ( ) const
inlinenoexcept

Points at the order here.

Returns
A pointer to it.

Definition at line 322 of file engine.hpp.

◆ operator!=

template<typename BrokerTag>
bool operator!= ( const const_iterator & lhs,
const const_iterator & rhs )
friend

Compares two positions in one queue.

Parameters
lhsThe first.
rhsThe second.
Returns
true if they differ.

Definition at line 358 of file engine.hpp.

◆ operator==

template<typename BrokerTag>
bool operator== ( const const_iterator & lhs,
const const_iterator & rhs )
friend

Compares two positions in one queue.

Parameters
lhsThe first.
rhsThe second.
Returns
true if they are the same.

Definition at line 349 of file engine.hpp.

◆ Queue

template<typename BrokerTag>
friend class Queue
friend

Definition at line 363 of file engine.hpp.


The documentation for this class was generated from the following file: