dxFeed Graal CXX API
|
A filter for sessions used by various search methods. More...
#include <SessionFilter.hpp>
Public Member Functions | |
SessionFilter (SessionFilterEnum code, std::string name, std::optional< SessionType > type, std::optional< bool > trading) noexcept | |
Creates filter with specified type and trading flag conditions. | |
template<typename Session > | |
bool | accept (Session session) const noexcept |
Tests whether or not the specified session is an acceptable result. | |
Static Public Attributes | |
static const SessionFilter | ANY {SessionFilterEnum::ANY, "ANY", std::nullopt, std::nullopt} |
Accepts any session - useful for pure schedule navigation. | |
static const SessionFilter | TRADING {SessionFilterEnum::TRADING, "TRADING", std::nullopt, true} |
Accepts trading sessions only - those with (Session::isTrading() == true) . | |
static const SessionFilter | NON_TRADING {SessionFilterEnum::NON_TRADING, "NON_TRADING", std::nullopt, false} |
Accepts non-trading sessions only - those with (Session::isTrading() == false) . | |
static const SessionFilter | NO_TRADING |
Accepts any session with type SessionType::NO_TRADING. | |
static const SessionFilter | PRE_MARKET |
Accepts any session with type SessionType::PRE_MARKET. | |
static const SessionFilter | REGULAR {SessionFilterEnum::REGULAR, "REGULAR", SessionType::REGULAR, std::nullopt} |
Accepts any session with type SessionType::REGULAR. | |
static const SessionFilter | AFTER_MARKET |
Accepts any session with type SessionType::AFTER_MARKET. | |
Protected Attributes | |
std::optional< SessionType > | type_ |
Required type, std::nullopt if not relevant. | |
std::optional< bool > | trading_ |
Required trading flag, std::nullopt if not relevant. | |
Friends | |
struct | Session |
struct | Schedule |
struct | Day |
A filter for sessions used by various search methods.
This class provides predefined filters for certain Session attributes, although users can create their own filters to suit their needs.
Please note that sessions can be either trading or non-trading, and this distinction can be either based on rules (e.g. weekends) or dictated by special occasions (e.g. holidays). Different filters treat this distinction differently - some accept only trading sessions, some only non-trading, and some ignore type of session altogether.
|
noexcept |
Creates filter with specified type and trading flag conditions.
Both parameters specify what value corresponding attributes should have. If some parameter is std::nullopt then corresponding attribute is ignored (any value is accepted).
code | The enum code |
name | The enum name |
type | required type, std::nullopt if not relevant |
trading | required trading flag, std::nullopt if not relevant |