dxFeed Graal CXX API v4.0.0
Loading...
Searching...
No Matches
EventSourceWrapper Struct Referencefinal

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

#include <EventSourceWrapper.hpp>

Public Member Functions

 EventSourceWrapper (const IndexedEventSource &data) noexcept
 Constructs a wrapper from IndexedEventSource.
 
 EventSourceWrapper (const OrderSource &data) noexcept
 Constructs a wrapper from OrderSource.
 
void * toGraal () const noexcept
 Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
 
std::unique_ptr< void, decltype(&EventSourceWrapper::freeGraal)> toGraalUnique () const noexcept
 Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
 
std::string toString () const
 Returns a string representation of the current object.
 
std::string toStringUnderlying () const
 Returns a string representation of the underlying object.
 
bool isIndexedEventSource () const noexcept
 
bool isOrderSource () const noexcept
 
std::optional< IndexedEventSourceasIndexedEventSource () const noexcept
 
std::optional< OrderSourceasOrderSource () const noexcept
 
const DataType & getData () const noexcept
 

Static Public Member Functions

static void freeGraal (void *graalNative)
 Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
 
static EventSourceWrapper fromGraal (void *graalNative)
 Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ EventSourceWrapper() [1/2]

EventSourceWrapper::EventSourceWrapper ( const IndexedEventSource & data)
inlinenoexcept

Constructs a wrapper from IndexedEventSource.

Parameters
dataThe IndexedEventSource.

◆ EventSourceWrapper() [2/2]

EventSourceWrapper::EventSourceWrapper ( const OrderSource & data)
inlinenoexcept

Constructs a wrapper from OrderSource.

Parameters
dataThe OrderSource.

Member Function Documentation

◆ asIndexedEventSource()

std::optional< IndexedEventSource > EventSourceWrapper::asIndexedEventSource ( ) const
inlinenoexcept
Returns
IndexedEventSource (optional) or std::nullopt if current EventSourceWrapper doesn't hold IndexedEventSource.

◆ asOrderSource()

std::optional< OrderSource > EventSourceWrapper::asOrderSource ( ) const
inlinenoexcept
Returns
OrderSource (optional) or std::nullopt if current EventSourceWrapper doesn't hold OrderSource.

◆ freeGraal()

static void EventSourceWrapper::freeGraal ( void * graalNative)
inlinestatic

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

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.
Exceptions
InvalidArgumentException

References IndexedEventSource::freeGraal().

◆ fromGraal()

EventSourceWrapper EventSourceWrapper::fromGraal ( void * graalNative)
static

Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.
Returns
The object of current type.
Exceptions
InvalidArgumentException
RuntimeExceptionif event source type is unknown

References IndexedEventSource::fromGraal().

◆ getData()

const DataType & EventSourceWrapper::getData ( ) const
inlinenoexcept
Returns
The internal data.

◆ isIndexedEventSource()

bool EventSourceWrapper::isIndexedEventSource ( ) const
inlinenoexcept
Returns
true if current EventSourceWrapper holds a IndexedEventSource.

◆ isOrderSource()

bool EventSourceWrapper::isOrderSource ( ) const
inlinenoexcept
Returns
true if current EventSourceWrapper holds a OrderSource.

◆ toGraal()

void * EventSourceWrapper::toGraal ( ) const
inlinenodiscardnoexcept

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

◆ toGraalUnique()

std::unique_ptr< void, decltype(&EventSourceWrapper::freeGraal)> EventSourceWrapper::toGraalUnique ( ) 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 smart unique pointer to the filled dxFeed Graal SDK structure

◆ toString()

std::string EventSourceWrapper::toString ( ) const
inline

Returns a string representation of the current object.

Returns
a string representation

◆ toStringUnderlying()

std::string EventSourceWrapper::toStringUnderlying ( ) const
inline

Returns a string representation of the underlying object.

Returns
a string representation of the underlying object.