|
dxFeed Graal CXX API v5.0.0
|
Message event with text payload. More...
#include <TextMessage.hpp>
Inheritance diagram for TextMessage: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. | |
Public Types inherited from EventTypeWithSymbol< std::string > | |
| using | Ptr = std::shared_ptr<EventTypeWithSymbol<std::string>> |
| The alias to a type of shared pointer to the EventTypeWithSymbol's child object. | |
| 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). | |
| void | assign (std::shared_ptr< EventType > event) override |
| Replaces the contents of the event. | |
| TextMessage () noexcept=default | |
| Creates a new message with default values. | |
| TextMessage (const StringLike &eventSymbol) noexcept | |
| Creates a new message with the specified event symbol. | |
| TextMessage (const StringLike &eventSymbol, const StringLike &text) noexcept | |
| Creates a new message with the specified event symbol and text. | |
| TextMessage (const StringLike &eventSymbol, std::int64_t time, const StringLike &text) noexcept | |
| Creates a new message with the specified event symbol, time and text. | |
| const std::string & | getEventSymbol () const &noexcept override |
| Returns a symbol of this event. | |
| const std::optional< std::string > & | getEventSymbolOpt () const &noexcept override |
| Returns a symbol of this event. | |
| void | setEventSymbol (const StringLike &eventSymbol) noexcept override |
| Changes symbol of this event. | |
| TextMessage & | withEventSymbol (const StringLike &eventSymbol) noexcept |
| Changes an event's symbol and returns the current message. | |
| std::int64_t | getEventTime () const noexcept override |
| Returns time when an 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 a text message packaged into a single long value. | |
| void | setTimeSequence (std::int64_t timeSequence) noexcept |
| Changes time and sequence of a 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 the 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 an event's sequence number and returns the current message. | |
| const std::string & | getText () const & |
| Returns text. | |
| void | setText (const StringLike &text) |
| Changes text. | |
| TextMessage & | withText (const StringLike &text) noexcept |
| Changes text and returns the current message. | |
| std::string | toString () const override |
| Returns a string representation of the current object. | |
Public Member Functions inherited from EventTypeWithSymbol< std::string > | |
| virtual void | setEventSymbol (const std::string &eventSymbol) noexcept=0 |
| Changes the event symbol that identifies this event type in subscription. | |
Public Member Functions inherited from SharedEntity | |
| template<typename T> | |
| bool | is () const noexcept |
| Checks that the 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 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 a persistence mechanism.
This event is implemented on top of QDS record TextMessage.
|
inlineexplicitnoexcept |
Creates a new message with the specified event symbol.
| eventSymbol | event symbol. |
|
inlinenoexcept |
Creates a new message with the specified event symbol and text.
| eventSymbol | event symbol. |
| text | text. |
References TextMessage().
Referenced by TextMessage().
|
inlinenoexcept |
Creates a 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 a 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 dxFeed Graal SDK structure.
| graalNative | The pointer to the dxFeed Graal SDK structure. |
| InvalidArgumentException |
|
inlineoverridevirtualnoexcept |
Returns a symbol of this event.
std::string{"<null>"}) Implements EventTypeWithSymbol< std::string >.
|
inlineoverridevirtualnoexcept |
Returns a symbol of this event.
std::nullopt. Implements EventTypeWithSymbol< std::string >.
|
inlineoverridevirtualnoexcept |
Returns time when an 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 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.
The default implementation returns 0.
Reimplemented from EventType.
|
inlinenoexcept |
Returns the 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 a text message packaged into a 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.
The 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 a 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 a 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 an 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 an event's sequence number and returns the current message.
| sequence | the sequence. |
| InvalidArgumentException | if a 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().