dxFeed Graal CXX API v9.0.0
Loading...
Searching...
No Matches
IndexedEventTxModel< E >::Builder Struct Referencefinal

The builder of IndexedEventTxModel. More...

#include <IndexedEventTxModel.hpp>

Inheritance diagram for IndexedEventTxModel< E >::Builder:

Public Member Functions

std::shared_ptr< Builder > withFeed (const std::shared_ptr< DXFeed > &feed)
 Sets the feed to attach the model to.
std::shared_ptr< Builder > withSymbol (const IndexedEventSubscriptionSymbol &symbol)
 Sets the symbol and the source of the model.
std::shared_ptr< Builder > withSymbol (StringParam symbol)
 Sets the symbol of the model.
std::shared_ptr< Builder > withSource (const EventSourceWrapper &source)
 Sets the source of the model (required, unless it is set with the symbol).
std::shared_ptr< Builder > withListener (EventsListener listener)
 Sets the listener of the model (required).
std::shared_ptr< Builder > withEventsBatchLimit (std::int32_t eventsBatchLimit)
 Sets the maximum number of events in a single notification of the listener (DXFeedSubscription::OPTIMAL_BATCH_LIMIT by default).
std::shared_ptr< Builder > withAggregationPeriod (const TimePeriod &aggregationPeriod)
 Sets the aggregation period of the events (no aggregation by default).
std::shared_ptr< Builder > withAggregationPeriod (std::chrono::milliseconds aggregationPeriod)
 Sets the aggregation period of the events (no aggregation by default).
std::shared_ptr< Builder > withAggregationPeriod (std::int64_t aggregationPeriod)
 Sets the aggregation period of the events (no aggregation by default).
template<typename Executor>
std::shared_ptr< Builder > withExecutor (const std::shared_ptr< Executor > &executor)
 Sets the executor that notifies the listener (for example, InPlaceExecutor).
std::shared_ptr< IndexedEventTxModel > build () const
 Builds the model and attaches it to the feed, if it is set.
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.
virtual std::string toString () const
 Returns a string representation of the current object.
Public Member Functions inherited from Entity
virtual ~Entity () noexcept
 The default virtual d-tor.

Additional Inherited Members

Public Types inherited from SharedEntity
using Ptr = std::shared_ptr<SharedEntity>
 The alias to a type of shared pointer to the SharedEntity object.
Static Public Member Functions inherited from RequireMakeShared< Builder >
static auto createShared (Args &&...args)
 Creates a smart pointer to an object.

Detailed Description

template<Derived< IndexedEvent > E>
struct IndexedEventTxModel< E >::Builder

The builder of IndexedEventTxModel.

Each with* method changes this builder and returns it.

Member Function Documentation

◆ build()

template<Derived< IndexedEvent > E>
std::shared_ptr< IndexedEventTxModel > IndexedEventTxModel< E >::Builder::build ( ) const
inline

Builds the model and attaches it to the feed, if it is set.

The models built by one builder share its listener.

Returns
a new model.

◆ withAggregationPeriod() [1/3]

template<Derived< IndexedEvent > E>
std::shared_ptr< Builder > IndexedEventTxModel< E >::Builder::withAggregationPeriod ( const TimePeriod & aggregationPeriod)
inline

Sets the aggregation period of the events (no aggregation by default).

Parameters
aggregationPeriodThe aggregation period.
Returns
this builder.
See also
SubscriptionController::getAggregationPeriod()

◆ withAggregationPeriod() [2/3]

template<Derived< IndexedEvent > E>
std::shared_ptr< Builder > IndexedEventTxModel< E >::Builder::withAggregationPeriod ( std::chrono::milliseconds aggregationPeriod)
inline

Sets the aggregation period of the events (no aggregation by default).

Parameters
aggregationPeriodThe aggregation period.
Returns
this builder.
See also
SubscriptionController::getAggregationPeriod()

◆ withAggregationPeriod() [3/3]

template<Derived< IndexedEvent > E>
std::shared_ptr< Builder > IndexedEventTxModel< E >::Builder::withAggregationPeriod ( std::int64_t aggregationPeriod)
inline

Sets the aggregation period of the events (no aggregation by default).

Parameters
aggregationPeriodThe aggregation period in milliseconds.
Returns
this builder.
See also
SubscriptionController::getAggregationPeriod()

◆ withEventsBatchLimit()

template<Derived< IndexedEvent > E>
std::shared_ptr< Builder > IndexedEventTxModel< E >::Builder::withEventsBatchLimit ( std::int32_t eventsBatchLimit)
inline

Sets the maximum number of events in a single notification of the listener (DXFeedSubscription::OPTIMAL_BATCH_LIMIT by default).

Parameters
eventsBatchLimitThe events batch limit.
Returns
this builder.

◆ withExecutor()

template<Derived< IndexedEvent > E>
template<typename Executor>
std::shared_ptr< Builder > IndexedEventTxModel< E >::Builder::withExecutor ( const std::shared_ptr< Executor > & executor)
inline

Sets the executor that notifies the listener (for example, InPlaceExecutor).

By default, it is the executor of the endpoint of the feed.

Template Parameters
ExecutorThe type of the executor.
Parameters
executorThe executor.
Returns
this builder.

◆ withFeed()

template<Derived< IndexedEvent > E>
std::shared_ptr< Builder > IndexedEventTxModel< E >::Builder::withFeed ( const std::shared_ptr< DXFeed > & feed)
inline

Sets the feed to attach the model to.

By default, the model is not attached to any feed.

Parameters
feedThe feed.
Returns
this builder.

◆ withListener()

template<Derived< IndexedEvent > E>
std::shared_ptr< Builder > IndexedEventTxModel< E >::Builder::withListener ( EventsListener listener)
inline

Sets the listener of the model (required).

The listener cannot be changed after the model is built.

Parameters
listenerThe function that receives the events of one or more complete transactions and whether they form a snapshot.
Returns
this builder.

◆ withSource()

template<Derived< IndexedEvent > E>
std::shared_ptr< Builder > IndexedEventTxModel< E >::Builder::withSource ( const EventSourceWrapper & source)
inline

Sets the source of the model (required, unless it is set with the symbol).

Use IndexedEventSource::DEFAULT for the events that have no sources (for example, Series) and the source of the type of events for the others (for example, OrderSource::NTV or OrderSource::DEFAULT for Order).

Parameters
sourceThe source.
Returns
this builder.

◆ withSymbol() [1/2]

template<Derived< IndexedEvent > E>
std::shared_ptr< Builder > IndexedEventTxModel< E >::Builder::withSymbol ( const IndexedEventSubscriptionSymbol & symbol)
inline

Sets the symbol and the source of the model.

Parameters
symbolThe symbol with the source.
Returns
this builder.

◆ withSymbol() [2/2]

template<Derived< IndexedEvent > E>
std::shared_ptr< Builder > IndexedEventTxModel< E >::Builder::withSymbol ( StringParam symbol)
inline

Sets the symbol of the model.

Parameters
symbolThe symbol.
Returns
this builder.