dxFeed Graal CXX API
Loading...
Searching...
No Matches
dxfcpp::EventType Struct Referenceabstract

Marks all event types that can be received via dxFeed API. More...

#include <EventType.hpp>

+ Inheritance diagram for dxfcpp::EventType:

Public Types

using Ptr = std::shared_ptr<EventType>
 The alias to a type of shared pointer to the EventType object.
 
- Public Types inherited from dxfcpp::SharedEntity
using Ptr = std::shared_ptr<SharedEntity>
 The alias to a type of shared pointer to the SharedEntity object.
 

Public Member Functions

virtual std::int64_t getEventTime () const noexcept
 Returns time when event was created or zero when time is not available.
 
virtual void setEventTime (std::int64_t) noexcept
 Changes event creation time.
 
virtual voidtoGraal () const noexcept=0
 Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
 
std::string toString () const noexcept override
 Returns a string representation of the current object.
 
- Public Member Functions inherited from dxfcpp::SharedEntity
template<typename T >
bool is () const noexcept
 Checks that pointer to the current type could be converted to type T* In other words: whether type T belongs to the type hierarchy in which the current type resides.
 
template<typename T >
std::shared_ptr< T > sharedAs () noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T.
 
template<typename T >
std::shared_ptr< T > sharedAs () const noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T.
 
- Public Member Functions inherited from dxfcpp::Entity
virtual ~Entity () noexcept=default
 The default virtual d-tor.
 

Detailed Description

Marks all event types that can be received via dxFeed API.

Events are considered instantaneous, non-persistent, and unconflateable (each event is individually delivered) unless they implement one of interfaces defined in this package to further refine their meaning.

Event types are POCO (plain old cpp objects, not POD) that follow bean naming convention with getters and setters for their properties. All event types are serializable, because they are transferred over network from publishers to data feed consumers. However, they are using custom serialization format for this purpose.

See also
DXFeed

Member Function Documentation

◆ getEventTime()

virtual std::int64_t dxfcpp::EventType::getEventTime ( ) const
inlinevirtualnoexcept

Returns time when event was created or zero when time is not available.

This event time is available only when the corresponding DXEndpoint is created with DXENDPOINT_EVENT_TIME_PROPERTY and the data source has embedded event times. This is typically true only for data events that are read from historical tape files and from OnDemandService. Events that are coming from a network connections do not have an embedded event time information and this method will return zero for them, meaning that event was received just now.

Default implementation returns 0.

Returns
The difference, measured in milliseconds, between the event creation time and midnight, January 1, 1970 UTC or zero when time is not available.

Reimplemented in dxfcpp::Candle, and dxfcpp::MarketEvent.

◆ setEventTime()

virtual void dxfcpp::EventType::setEventTime ( std::int64_t )
inlinevirtualnoexcept

Changes event creation time.

Default implementation does nothing.

Parameters
eventTimethe difference, measured in milliseconds, between the event creation time and midnight, January 1, 1970 UTC.

Reimplemented in dxfcpp::Candle, and dxfcpp::MarketEvent.

◆ toGraal()

virtual void * dxfcpp::EventType::toGraal ( ) const
pure virtualnoexcept

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

Implemented in dxfcpp::Candle, dxfcpp::AnalyticOrder, dxfcpp::OptionSale, dxfcpp::Order, dxfcpp::Profile, dxfcpp::Quote, dxfcpp::SpreadOrder, dxfcpp::Summary, dxfcpp::TimeAndSale, dxfcpp::Trade, dxfcpp::TradeETH, dxfcpp::Greeks, dxfcpp::Series, dxfcpp::TheoPrice, and dxfcpp::Underlying.

◆ toString()

std::string dxfcpp::EventType::toString ( ) const
inlineoverridevirtualnoexcept

Returns a string representation of the current object.

Returns
a string representation

Reimplemented from dxfcpp::SharedEntity.

Reimplemented in dxfcpp::OptionSale, dxfcpp::Order, dxfcpp::Profile, dxfcpp::Quote, dxfcpp::SpreadOrder, dxfcpp::Summary, dxfcpp::TimeAndSale, dxfcpp::Trade, dxfcpp::TradeETH, dxfcpp::Greeks, dxfcpp::Series, dxfcpp::TheoPrice, and dxfcpp::Underlying.