dxFeed Graal CXX API v4.2.0
|
Message event with text payload. More...
#include <TextMessage.hpp>
Public Types | |
using | Ptr = std::shared_ptr<TextMessage> |
The alias to a type of shared pointer to the TextMessage object. | |
using | Unique = std::unique_ptr<TextMessage> |
The alias to a type of unique pointer to the TextMessage object. | |
![]() | |
using | Ptr |
The alias to a type of shared pointer to the EventTypeWithSymbol's child object. | |
![]() | |
using | Ptr = std::shared_ptr<EventType> |
The alias to a type of shared pointer to the EventType object. | |
![]() | |
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). | |
void | assign (std::shared_ptr< EventType > event) override |
Replaces the contents of the event. | |
TextMessage () noexcept=default | |
Creates new message with default values. | |
TextMessage (std::string eventSymbol) noexcept | |
Creates new message with the specified event symbol. | |
TextMessage (std::string eventSymbol, std::string text) noexcept | |
Creates new message with the specified event symbol and text. | |
TextMessage (std::string eventSymbol, std::int64_t time, std::string text) noexcept | |
Creates new message with the specified event symbol, time and text. | |
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. | |
TextMessage & | 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. | |
TextMessage & | withEventTime (std::int64_t eventTime) noexcept |
Changes event's creation time and returns the current message. | |
std::int64_t | getTimeSequence () const noexcept |
Returns time and sequence of text message packaged into single long value. | |
void | setTimeSequence (std::int64_t timeSequence) noexcept |
Changes time and sequence of text message. | |
std::int64_t | getTime () const noexcept |
Returns time of the text message. | |
void | setTime (std::int64_t time) noexcept |
Changes time of the text message. | |
TextMessage & | withTime (std::int64_t time) noexcept |
Changes time and returns the current message. | |
std::int32_t | getSequence () const noexcept |
Returns sequence number of the text message to distinguish messages that have the same time. | |
void | setSequence (std::int32_t sequence) |
Changes getSequence() sequence number of the text message. | |
TextMessage & | withSequence (std::int32_t sequence) noexcept |
Changes event's sequence number and returns the current message. | |
const std::string & | getText () const & |
Returns text. | |
void | setText (std::string text) |
Changes text. | |
TextMessage & | withText (std::string text) noexcept |
Changes text and returns the current message. | |
std::string | toString () const override |
Returns a string representation of the current object. | |
![]() | |
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. | |
![]() | |
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 constexpr std::uint32_t | MAX_SEQUENCE = (1U << 22U) - 1U |
Maximum allowed sequence value. | |
static const EventTypeEnum & | TYPE = EventTypeEnum::TEXT_MESSAGE |
Type identifier and additional information about the current event class. | |
Message event with text payload.
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 TextMessage
.
|
inlineexplicitnoexcept |
Creates new message with the specified event symbol.
eventSymbol | event symbol. |
|
inlinenoexcept |
Creates new message with the specified event symbol and text.
eventSymbol | event symbol. |
text | text. |
References TextMessage().
Referenced by TextMessage().
|
inlinenoexcept |
Creates new message with the specified event symbol, time and text.
eventSymbol | event symbol. |
time | time. |
text | text. |
References TextMessage().
Referenced by TextMessage().
|
overridevirtual |
Replaces the contents of the event.
event | the event to use as source. |
Reimplemented from EventType.
|
static |
Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
graalNative | The pointer to the dxFeed Graal SDK structure. |
InvalidArgumentException |
|
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. |
InvalidArgumentException |
|
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.
|
inlinenoexcept |
Returns sequence number of the text message to distinguish messages that have the same time.
This sequence number does not have to be unique and does not need to be sequential. Sequence can range from 0 to MAX_SEQUENCE.
References MAX_SEQUENCE.
Referenced by setTime().
|
inline |
Returns text.
|
inlinenoexcept |
Returns time of the text message.
Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.
|
inlinenoexcept |
Returns time and sequence of text message packaged into single long value.
|
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().
|
inline |
Changes getSequence() sequence number of the text message.
sequence | the sequence. |
InvalidArgumentException | if sequence is below zero or above MAX_SEQUENCE. |
References MAX_SEQUENCE.
Referenced by withSequence().
|
inline |
|
inlinenoexcept |
Changes time of the text message.
Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.
time | time of the text message. |
References getSequence().
Referenced by withTime().
|
inlinenoexcept |
Changes time and sequence of text message.
Do not use this method directly. Change time and/or sequence.
timeSequence | the time and sequence. |
|
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().
|
overridevirtual |
|
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().
|
inlinenoexcept |
Changes event's sequence number and returns the current message.
sequence | the sequence. |
InvalidArgumentException | if sequence is below zero or above MAX_SEQUENCE. |
References setSequence().
|
inlinenoexcept |
Changes text and returns the current message.
text | text. |
References setText().
|
inlinenoexcept |
Changes time and returns the current message.
time | time of the text message. |
References setTime().
|
staticconstexpr |
Maximum allowed sequence value.
Referenced by getSequence(), and setSequence().