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

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

#include <EventType.hpp>

+ Inheritance diagram for 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 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 void * toGraal () const =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 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 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 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 Candle, MarketEvent, and Message.

◆ setEventTime()

virtual void 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 Candle, MarketEvent, and Message.

◆ toGraal()

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

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 AnalyticOrder, Candle, Greeks, Message, OptionSale, Order, OtcMarketsOrder, Profile, Quote, Series, SpreadOrder, Summary, TheoPrice, TimeAndSale, Trade, TradeETH, and Underlying.

◆ toString()

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

Returns a string representation of the current object.

Returns
a string representation

Reimplemented from SharedEntity.

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