dxFeed Graal CXX API
|
Message event with application-specific attachment. More...
#include <Message.hpp>
Public Types | |
using | Ptr = std::shared_ptr<Message> |
The alias to a type of shared pointer to the Message object. | |
using | Unique = std::unique_ptr<Message> |
The alias to a type of unique pointer to the Message object. | |
Public Types inherited from EventTypeWithSymbol< std::string > | |
using | Ptr |
The alias to a type of shared pointer to the EventTypeWithSymbol's child object. | |
Public Types inherited from EventType | |
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 | |
void * | toGraal () const override |
Allocates memory for the dxFeed Graal SDK structure (recursively if necessary). | |
Message () noexcept=default | |
Creates new message with default values. | |
Message (std::string eventSymbol) noexcept | |
Creates new message with the specified event symbol. | |
Message (std::string eventSymbol, std::string attachment) noexcept | |
Creates new message with the specified event symbol and attachment. | |
const std::string & | getEventSymbol () const &noexcept override |
Returns symbol of this event. | |
const std::optional< std::string > & | getEventSymbolOpt () const &noexcept override |
Returns symbol of this event. | |
void | setEventSymbol (const std::string &eventSymbol) noexcept override |
Changes symbol of this event. | |
Message & | withEventSymbol (const std::string &eventSymbol) noexcept |
Changes event's symbol and returns the current message. | |
std::int64_t | getEventTime () const noexcept override |
Returns time when event was created or zero when time is not available. | |
void | setEventTime (std::int64_t eventTime) noexcept override |
Changes event creation time. | |
Message & | withEventTime (std::int64_t eventTime) noexcept |
Changes event's creation time and returns the current message. | |
const std::string & | getAttachment () const & |
Returns attachment. | |
const std::optional< std::string > & | getAttachmentOpt () const &noexcept |
Returns attachment of this event. | |
void | setAttachment (std::string attachment) |
Changes attachment. | |
Message & | withAttachment (std::string attachment) noexcept |
Changes attachment. | |
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. | |
Static Public Member Functions | |
static Ptr | fromGraal (void *graalNative) |
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure. | |
static void | freeGraal (void *graalNative) |
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary). | |
Static Public Attributes | |
static const EventTypeEnum & | TYPE = EventTypeEnum::MESSAGE |
Type identifier and additional information about the current event class. | |
Message event with application-specific attachment.
Messages are never conflated and are delivered to all connected subscribers. There is no built-in persistence for messages. They are lost when subscribers are not connected to the message publisher, so they shall be only used for notification purposes in addition to persistence mechanism.
This event is implemented on top of QDS record Message
.
|
inlineexplicitnoexcept |
Creates new message with the specified event symbol.
eventSymbol | event symbol. |
|
inlinenoexcept |
|
static |
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
graalNative | The pointer to the dxFeed Graal SDK structure. |
|
static |
Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
graalNative | The pointer to the dxFeed Graal SDK structure. |
std::invalid_argument |
|
inline |
Returns attachment.
|
inlinenoexcept |
Returns attachment of this event.
std::nullopt
.
|
inlineoverridevirtualnoexcept |
Returns symbol of this event.
std::string{"<null>"}
) Implements EventTypeWithSymbol< std::string >.
|
inlineoverridevirtualnoexcept |
Returns symbol of this event.
std::nullopt
. Implements EventTypeWithSymbol< std::string >.
|
inlineoverridevirtualnoexcept |
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.
Reimplemented from EventType.
|
inline |
Changes attachment.
attachment | attachment. |
|
inlineoverridevirtualnoexcept |
Changes symbol of this event.
eventSymbol | The symbol of this event. |
Implements EventTypeWithSymbol< std::string >.
Referenced by withEventSymbol().
|
inlineoverridevirtualnoexcept |
Changes event creation time.
Default implementation does nothing.
eventTime | the difference, measured in milliseconds, between the event creation time and midnight, January 1, 1970 UTC. |
Reimplemented from EventType.
Referenced by withEventTime().
|
overridevirtual |
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.
Implements EventType.
References toString().
|
overridevirtualnoexcept |
|
inlinenoexcept |
Changes attachment.
and returns the current message.
attachment | attachment. |
|
inlinenoexcept |
Changes event's symbol and returns the current message.
eventSymbol | The symbol of this event. |
References setEventSymbol().
|
inlinenoexcept |
Changes event's creation time and returns the current message.
eventTime | the difference, measured in milliseconds, between the event creation time and midnight, January 1, 1970 UTC. |
References setEventTime().