dxFeed Graal CXX API v9.0.0
Loading...
Searching...
No Matches
TextConfiguration Class Referencefinal

Configuration event with the text payload. More...

#include <TextConfiguration.hpp>

Inheritance diagram for TextConfiguration:

Public Types

using Ptr = std::shared_ptr<TextConfiguration>
 The alias to a type of shared pointer to the TextConfiguration object.
using Unique = std::unique_ptr<TextConfiguration>
 The alias to a type of unique pointer to the TextConfiguration 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.
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 Types inherited from LastingEvent
using Ptr = std::shared_ptr<LastingEvent>
 The alias to a type of shared pointer to the LastingEvent 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.
 TextConfiguration () noexcept
 Creates a new text configuration event with default values.
 TextConfiguration (StringParam eventSymbol)
 Creates a new text configuration event with the specified event symbol.
 TextConfiguration (StringParam eventSymbol, StringParam text)
 Creates a new text configuration event with the specified event symbol and text.
 TextConfiguration (StringParam eventSymbol, StringParam text, std::int32_t version)
 Creates a new text configuration event with the specified event symbol, text, and version.
const std::string & getEventSymbol () const &noexcept override
 Returns the symbol of this event.
const std::optional< std::string > & getEventSymbolOpt () const &noexcept override
 Returns the symbol of this event.
void setEventSymbol (StringParam eventSymbol) override
 Changes the symbol of this event.
TextConfiguration & withEventSymbol (StringParam eventSymbol)
 Changes the event's symbol and returns the current text configuration event.
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.
TextConfiguration & withEventTime (std::int64_t eventTime) noexcept
 Changes the event's creation time and returns the current text configuration event.
std::int64_t getTimeSequence () const noexcept
 Returns time and sequence of this event packaged into a single long value.
void setTimeSequence (std::int64_t timeSequence) noexcept
 Changes time and sequence of this event.
std::int64_t getTime () const noexcept
 Returns time of this text configuration event.
void setTime (std::int64_t time) noexcept
 Changes time of this text configuration event.
TextConfiguration & withTime (std::int64_t time) noexcept
 Changes time and returns the current text configuration event.
std::int32_t getSequence () const noexcept
 Returns the sequence number of this event to distinguish text configuration events that have the same time.
void setSequence (std::int32_t sequence)
 Changes the sequence number of this text configuration event.
TextConfiguration & withSequence (std::int32_t sequence)
 Changes the event's sequence number and returns the current text configuration event.
std::int32_t getVersion () const noexcept
 Returns the version of this event.
void setVersion (std::int32_t version) noexcept
 Changes the version of this event.
TextConfiguration & withVersion (std::int32_t version) noexcept
 Changes the version and returns the current text configuration event.
const std::string & getText () const &noexcept
 Returns the text.
const std::optional< std::string > & getTextOpt () const &noexcept
 Returns the text.
void setText (StringParam text)
 Changes the text.
template<OptionalString S>
void setText (S &&text) noexcept
 Changes the text, or makes it null with std::nullopt.
TextConfiguration & withText (StringParam text)
 Changes the text and returns the current text configuration event.
template<OptionalString S>
TextConfiguration & withText (S &&text) noexcept
 Changes the text, or makes it null with std::nullopt.
std::string toString () const override
 Returns a string representation of the current object.
Public Member Functions inherited from SharedEntity
template<typename T>
bool is () const noexcept
 Checks that the object is of type T: its dynamic type is T or derived from T.
template<typename T>
std::shared_ptr< T > sharedAs () noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T or std::shared_ptr<T>{nullptr} if the object is not managed by std::shared_ptr.
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 or std::shared_ptr<T>{nullptr} if the object is not managed by std::shared_ptr.
Public Member Functions inherited from Entity
virtual ~Entity () noexcept
 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_CONFIGURATION
 Type identifier and additional information about the current event class.

Detailed Description

Configuration event with the text payload.

Properties

TextConfiguration event has the following properties:

Versioning

The version field is used to track changes to the event data. When the version field is enabled (by default), events with a lower version number than the last received will be dropped. This is useful for conflating events, where only the latest version of an event is processed. This is only true when transferring under a TICKER contract and the version field is enabled.

Implementation details

This event is implemented on top of QDS record TextConfiguration.

Constructor & Destructor Documentation

◆ TextConfiguration() [1/3]

TextConfiguration::TextConfiguration ( StringParam eventSymbol)
explicit

Creates a new text configuration event with the specified event symbol.

Parameters
eventSymbolThe event symbol.

◆ TextConfiguration() [2/3]

TextConfiguration::TextConfiguration ( StringParam eventSymbol,
StringParam text )

Creates a new text configuration event with the specified event symbol and text.

Parameters
eventSymbolThe event symbol.
textThe text.

References TextConfiguration().

Referenced by TextConfiguration().

◆ TextConfiguration() [3/3]

TextConfiguration::TextConfiguration ( StringParam eventSymbol,
StringParam text,
std::int32_t version )

Creates a new text configuration event with the specified event symbol, text, and version.

Parameters
eventSymbolThe event symbol.
textThe text.
versionThe version.

References TextConfiguration().

Referenced by TextConfiguration().

Member Function Documentation

◆ assign()

void TextConfiguration::assign ( std::shared_ptr< EventType > event)
overridevirtual

Replaces the contents of the event.

Parameters
eventthe event to use as a source.

Reimplemented from EventType.

◆ freeGraal()

void TextConfiguration::freeGraal ( void * graalNative)
static

Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.
Exceptions
InvalidArgumentException

◆ fromGraal()

std::shared_ptr< TextConfiguration > TextConfiguration::fromGraal ( void * graalNative)
static

Creates an object of the current type and fills it with data from the dxFeed Graal SDK structure.

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.
Returns
The object of the current type.
Exceptions
InvalidArgumentException

◆ getEventSymbol()

const std::string & TextConfiguration::getEventSymbol ( ) const &
overridevirtualnoexcept

Returns the symbol of this event.

Returns
The symbol of this event or dxfcpp::String::NUL (std::string{"<null>"}).

Implements EventTypeWithSymbol< std::string >.

◆ getEventSymbolOpt()

const std::optional< std::string > & TextConfiguration::getEventSymbolOpt ( ) const &
overridevirtualnoexcept

Returns the symbol of this event.

Returns
The symbol of this event or std::nullopt.

Implements EventTypeWithSymbol< std::string >.

◆ getEventTime()

std::int64_t TextConfiguration::getEventTime ( ) const
overridevirtualnoexcept

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.

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 from EventType.

◆ getSequence()

std::int32_t TextConfiguration::getSequence ( ) const
noexcept

Returns the sequence number of this event to distinguish text configuration events 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 TextConfiguration::MAX_SEQUENCE.

Returns
The sequence of this text configuration event.

References MAX_SEQUENCE.

Referenced by setTime().

◆ getText()

const std::string & TextConfiguration::getText ( ) const &
noexcept

Returns the text.

Returns
The text or dxfcpp::String::NUL (std::string{"<null>"}).

◆ getTextOpt()

const std::optional< std::string > & TextConfiguration::getTextOpt ( ) const &
noexcept

Returns the text.

Returns
The text or std::nullopt.

◆ getTime()

std::int64_t TextConfiguration::getTime ( ) const
noexcept

Returns time of this text configuration event.

Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Returns
The time of this text configuration event.

◆ getTimeSequence()

std::int64_t TextConfiguration::getTimeSequence ( ) const
noexcept

Returns time and sequence of this event packaged into a single long value.

Returns
The time and sequence of this text configuration event.

◆ getVersion()

std::int32_t TextConfiguration::getVersion ( ) const
noexcept

Returns the version of this event.

Returns
The version of this event. A higher value indicates a more recent update.

◆ setEventSymbol()

void TextConfiguration::setEventSymbol ( StringParam eventSymbol)
overridevirtual

Changes the symbol of this event.

Parameters
eventSymbolThe symbol of this event.

Implements EventTypeWithSymbol< std::string >.

◆ setEventTime()

void TextConfiguration::setEventTime ( std::int64_t eventTime)
overridevirtualnoexcept

Changes event creation time.

The default implementation does nothing.

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

Reimplemented from EventType.

Referenced by withEventTime().

◆ setSequence()

void TextConfiguration::setSequence ( std::int32_t sequence)

Changes the sequence number of this text configuration event.

Parameters
sequenceThe sequence.
Exceptions
InvalidArgumentExceptionif the sequence is below zero or above TextConfiguration::MAX_SEQUENCE.
See also
TextConfiguration::getSequence()

References MAX_SEQUENCE.

Referenced by withSequence().

◆ setText() [1/2]

template<OptionalString S>
void TextConfiguration::setText ( S && text)
inlinenoexcept

Changes the text, or makes it null with std::nullopt.

setText(other.getTextOpt()) copies it from another event, null included.

Parameters
textthe text or std::nullopt.

◆ setText() [2/2]

void TextConfiguration::setText ( StringParam text)

Changes the text.

Parameters
textThe text.

◆ setTime()

void TextConfiguration::setTime ( std::int64_t time)
noexcept

Changes time of this text configuration event.

Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Parameters
timeThe time of this text configuration event.

References getSequence().

Referenced by withTime().

◆ setTimeSequence()

void TextConfiguration::setTimeSequence ( std::int64_t timeSequence)
noexcept

Changes time and sequence of this event.

Do not use this method directly. Change time and/or sequence.

Parameters
timeSequenceThe time and sequence.
See also
TextConfiguration::getTimeSequence()

◆ setVersion()

void TextConfiguration::setVersion ( std::int32_t version)
noexcept

Changes the version of this event.

Parameters
versionThe version of this event. A higher value indicates a more recent update.

Referenced by withVersion().

◆ toGraal()

void * TextConfiguration::toGraal ( ) const
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.

Returns
The pointer to the filled dxFeed Graal SDK structure

Implements EventType.

◆ toString()

std::string TextConfiguration::toString ( ) const
overridevirtual

Returns a string representation of the current object.

Returns
a string representation

Reimplemented from EventType.

◆ withEventSymbol()

TextConfiguration & TextConfiguration::withEventSymbol ( StringParam eventSymbol)

Changes the event's symbol and returns the current text configuration event.

Parameters
eventSymbolThe symbol of this event.
Returns
The current text configuration event.

◆ withEventTime()

TextConfiguration & TextConfiguration::withEventTime ( std::int64_t eventTime)
noexcept

Changes the event's creation time and returns the current text configuration event.

Parameters
eventTimeThe difference, measured in milliseconds, between the event creation time and midnight, January 1, 1970 UTC.
Returns
The current text configuration event.

References setEventTime().

◆ withSequence()

TextConfiguration & TextConfiguration::withSequence ( std::int32_t sequence)

Changes the event's sequence number and returns the current text configuration event.

Parameters
sequenceThe sequence.
Returns
The current text configuration event.
Exceptions
InvalidArgumentExceptionif the sequence is below zero or above TextConfiguration::MAX_SEQUENCE.

References setSequence().

◆ withText() [1/2]

template<OptionalString S>
TextConfiguration & TextConfiguration::withText ( S && text)
inlinenoexcept

Changes the text, or makes it null with std::nullopt.

Returns the current text configuration.

Parameters
textthe text or std::nullopt.
Returns
The current text configuration.

◆ withText() [2/2]

TextConfiguration & TextConfiguration::withText ( StringParam text)

Changes the text and returns the current text configuration event.

Parameters
textThe text.
Returns
The current text configuration event.

◆ withTime()

TextConfiguration & TextConfiguration::withTime ( std::int64_t time)
noexcept

Changes time and returns the current text configuration event.

Parameters
timeThe time of this text configuration event.
Returns
The current text configuration event.

References setTime().

◆ withVersion()

TextConfiguration & TextConfiguration::withVersion ( std::int32_t version)
noexcept

Changes the version and returns the current text configuration event.

Parameters
versionThe version of this event. A higher value indicates a more recent update.
Returns
The current text configuration event.

References setVersion().

Member Data Documentation

◆ MAX_SEQUENCE

std::uint32_t TextConfiguration::MAX_SEQUENCE = (1U << 22U) - 1U
staticconstexpr

Maximum allowed sequence value.

See also
TextConfiguration::setSequence()

Referenced by getSequence(), and setSequence().