dxFeed Graal CXX API
Loading...
Searching...
No Matches
dxfcpp::SymbolWrapper Struct Referencefinal

A helper wrapper class needed to pass heterogeneous symbols using a container and convert them to internal Graal representation. More...

#include <SymbolWrapper.hpp>

Public Member Functions

template<ConvertibleToStringSymbol Symbol>
 SymbolWrapper (Symbol &&symbol) noexcept
 Constructor for any wrapped symbol.
 
 SymbolWrapper (const StringSymbol &stringSymbol) noexcept
 Constructor for any wrapped string symbol.
 
 SymbolWrapper (const WildcardSymbol &wildcardSymbol) noexcept
 Constructor for any wrapped wildcard (*) symbol.
 
 SymbolWrapper (const IndexedEventSubscriptionSymbol &indexedEventSubscriptionSymbol) noexcept
 Constructor for IndexedEventSubscriptionSymbol.
 
 SymbolWrapper (const TimeSeriesSubscriptionSymbol &timeSeriesSubscriptionSymbol) noexcept
 Constructor for TimeSeriesSubscriptionSymbol.
 
 SymbolWrapper (const CandleSymbol &candleSymbol) noexcept
 Constructor for CandleSymbol.
 
void * toGraal () const noexcept
 Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
 
std::string toString () const noexcept
 Returns a string representation of the current object.
 
bool isStringSymbol () const noexcept
 
std::string asStringSymbol () const noexcept
 
bool isWildcardSymbol () const noexcept
 
std::optional< WildcardSymbolasWildcardSymbol () const noexcept
 
bool isIndexedEventSubscriptionSymbol () const noexcept
 
std::optional< IndexedEventSubscriptionSymbolasIndexedEventSubscriptionSymbol () const noexcept
 
bool isTimeSeriesSubscriptionSymbol () const noexcept
 
std::optional< TimeSeriesSubscriptionSymbolasTimeSeriesSubscriptionSymbol () const noexcept
 
bool isCandleSymbol () const noexcept
 
std::optional< CandleSymbolasCandleSymbol () const noexcept
 

Static Public Member Functions

static void freeGraal (void *graalNative) noexcept
 Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
 

Detailed Description

A helper wrapper class needed to pass heterogeneous symbols using a container and convert them to internal Graal representation.

Constructor & Destructor Documentation

◆ SymbolWrapper() [1/6]

template<ConvertibleToStringSymbol Symbol>
dxfcpp::SymbolWrapper::SymbolWrapper ( Symbol && symbol)
inlinenoexcept

Constructor for any wrapped symbol.

Must be implicit to wrap symbols passed to collection or container

Template Parameters
SymbolThe symbol type
Parameters
symbolThe symbol

◆ SymbolWrapper() [2/6]

dxfcpp::SymbolWrapper::SymbolWrapper ( const StringSymbol & stringSymbol)
inlinenoexcept

Constructor for any wrapped string symbol.

Must be implicit to wrap symbols passed to collection or container

Parameters
stringSymbolThe wrapped string (std::string, std::string_view, const char*) symbol

◆ SymbolWrapper() [3/6]

dxfcpp::SymbolWrapper::SymbolWrapper ( const WildcardSymbol & wildcardSymbol)
inlinenoexcept

Constructor for any wrapped wildcard (*) symbol.

Parameters
wildcardSymbolThe wrapped wildcard symbol

◆ SymbolWrapper() [4/6]

dxfcpp::SymbolWrapper::SymbolWrapper ( const IndexedEventSubscriptionSymbol & indexedEventSubscriptionSymbol)
inlinenoexcept

Constructor for IndexedEventSubscriptionSymbol.

Parameters
indexedEventSubscriptionSymbolThe IndexedEventSubscriptionSymbol

◆ SymbolWrapper() [5/6]

dxfcpp::SymbolWrapper::SymbolWrapper ( const TimeSeriesSubscriptionSymbol & timeSeriesSubscriptionSymbol)
inlinenoexcept

Constructor for TimeSeriesSubscriptionSymbol.

Parameters
timeSeriesSubscriptionSymbolThe TimeSeriesSubscriptionSymbol

◆ SymbolWrapper() [6/6]

dxfcpp::SymbolWrapper::SymbolWrapper ( const CandleSymbol & candleSymbol)
inlinenoexcept

Constructor for CandleSymbol.

Parameters
candleSymbolThe CandleSymbol

Member Function Documentation

◆ asCandleSymbol()

std::optional< CandleSymbol > dxfcpp::SymbolWrapper::asCandleSymbol ( ) const
inlinenoexcept
Returns
CandleSymbol (optional) or std::nullopt if current SymbolWrapper doesn't hold CandleSymbol

◆ asIndexedEventSubscriptionSymbol()

std::optional< IndexedEventSubscriptionSymbol > dxfcpp::SymbolWrapper::asIndexedEventSubscriptionSymbol ( ) const
inlinenoexcept
Returns
IndexedEventSubscriptionSymbol (optional) or std::nullopt if current SymbolWrapper doesn't hold IndexedEventSubscriptionSymbol

◆ asStringSymbol()

std::string dxfcpp::SymbolWrapper::asStringSymbol ( ) const
inlinenoexcept
Returns
String representation of StringSymbol or an empty string

◆ asTimeSeriesSubscriptionSymbol()

std::optional< TimeSeriesSubscriptionSymbol > dxfcpp::SymbolWrapper::asTimeSeriesSubscriptionSymbol ( ) const
inlinenoexcept
Returns
TimeSeriesSubscriptionSymbol (optional) or std::nullopt if current SymbolWrapper doesn't hold TimeSeriesSubscriptionSymbol

◆ asWildcardSymbol()

std::optional< WildcardSymbol > dxfcpp::SymbolWrapper::asWildcardSymbol ( ) const
inlinenoexcept
Returns
WildcardSymbol (optional) or std::nullopt if current SymbolWrapper doesn't hold WildcardSymbol

◆ freeGraal()

void dxfcpp::SymbolWrapper::freeGraal ( void * graalNative)
staticnoexcept

Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.

◆ isCandleSymbol()

bool dxfcpp::SymbolWrapper::isCandleSymbol ( ) const
inlinenoexcept
Returns
true if current SymbolWrapper holds a CandleSymbol

◆ isIndexedEventSubscriptionSymbol()

bool dxfcpp::SymbolWrapper::isIndexedEventSubscriptionSymbol ( ) const
inlinenoexcept
Returns
true if current SymbolWrapper holds a IndexedEventSubscriptionSymbol

◆ isStringSymbol()

bool dxfcpp::SymbolWrapper::isStringSymbol ( ) const
inlinenoexcept
Returns
true if current SymbolWrapper holds a StringSymbol

◆ isTimeSeriesSubscriptionSymbol()

bool dxfcpp::SymbolWrapper::isTimeSeriesSubscriptionSymbol ( ) const
inlinenoexcept
Returns
true if current SymbolWrapper holds a TimeSeriesSubscriptionSymbol

◆ isWildcardSymbol()

bool dxfcpp::SymbolWrapper::isWildcardSymbol ( ) const
inlinenoexcept
Returns
true if current SymbolWrapper holds a WildcardSymbol

◆ toGraal()

void * dxfcpp::SymbolWrapper::toGraal ( ) const
inlinenoexcept

Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).

Fills the dxFeed Graal SDK structure's fields by the data of the current entity (recursively if necessary). Returns the pointer to the filled structure.

Returns
The pointer to the filled dxFeed Graal SDK structure

◆ toString()

std::string dxfcpp::SymbolWrapper::toString ( ) const
inlinenoexcept

Returns a string representation of the current object.

Returns
a string representation