|
std::shared_ptr< Builder > | withBatchProcessing (bool isBatchProcessing) const |
| Enables or disables batch processing.
|
|
std::shared_ptr< Builder > | withSnapshotProcessing (bool isSnapshotProcessing) const |
| Enables or disables snapshot processing.
|
|
std::shared_ptr< Builder > | withFeed (const std::shared_ptr< DXFeed > &feed) const |
| Sets the feed for the model being created.
|
|
std::shared_ptr< Builder > | withSymbol (const SymbolWrapper &symbol) const |
| Sets the subscription symbol for the model being created.
|
|
std::shared_ptr< Builder > | withListener (std::shared_ptr< IndexedTxModelListener< E > > listener) const |
| Sets the listener for transaction notifications.
|
|
std::shared_ptr< Builder > | withListener (std::function< void(const IndexedEventSource &, const std::vector< std::shared_ptr< E > > &, bool)> onEventsReceived) const |
| Sets the listener for transaction notifications.
|
|
template<typename EventSourceIt > |
std::shared_ptr< Builder > | withSources (EventSourceIt begin, EventSourceIt end) const |
| Sets the sources from which to subscribe for indexed events.
|
|
template<ConvertibleToEventSourceWrapperCollection EventSourceCollection> |
std::shared_ptr< Builder > | withSources (EventSourceCollection &&sources) const |
| Sets the sources from which to subscribe for indexed events.
|
|
std::shared_ptr< Builder > | withSources (std::initializer_list< EventSourceWrapper > sources) const |
| Sets the sources from which to subscribe for indexed events.
|
|
std::shared_ptr< IndexedTxModel > | build () const |
| Builds an instance of IndexedTxModel based on the provided parameters.
|
|
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 std::string | toString () const |
| Returns a string representation of the current object.
|
|
virtual | ~Entity () noexcept=default |
| The default virtual d-tor.
|
|
template<Derived<
IndexedEvent > E>
struct IndexedTxModel< E >::Builder
A builder class for creating an instance of IndexedTxModel.
std::shared_ptr< Builder > IndexedTxModel< E >::Builder::withBatchProcessing |
( |
bool | isBatchProcessing | ) |
const |
|
inline |
Enables or disables batch processing.
This is enabled by default.
If batch processing is disabled, the model will notify listener separately for each transaction (even if it is represented by a single event); otherwise, transactions can be combined in a single listener call.
A transaction may represent either a snapshot or update events that are received after a snapshot. Whether this flag is set or not, the model will always notify listeners that a snapshot has been received and will not combine multiple snapshots or a snapshot with another transaction into a single listener notification.
- Parameters
-
isBatchProcessing | true to enable batch processing; false otherwise. |
- Returns
- The builder instance.
std::shared_ptr< Builder > IndexedTxModel< E >::Builder::withSnapshotProcessing |
( |
bool | isSnapshotProcessing | ) |
const |
|
inline |
Enables or disables snapshot processing.
This is disabled by default.
If snapshot processing is enabled, transactions representing a snapshot will be processed as follows: events that are marked for removal will be removed, repeated indexes will be merged, and eventFlags of events are set to zero; otherwise, the user will see the snapshot in raw form, with possible repeated indexes, events marked for removal, and eventFlags unchanged.
Whether this flag is set or not, in transactions that are not a snapshot, events that are marked for removal will not be removed, repeated indexes will not be merged, and eventFlags of events will not be changed. This flag only affects the processing of transactions that are a snapshot.
- Parameters
-
isSnapshotProcessing | true to enable snapshot processing; false otherwise. |
- Returns
- The builder instance.
template<typename EventSourceIt >
std::shared_ptr< Builder > IndexedTxModel< E >::Builder::withSources |
( |
EventSourceIt | begin, |
|
|
EventSourceIt | end ) const |
|
inline |
Sets the sources from which to subscribe for indexed events.
If no sources have been set, subscriptions will default to all possible sources.
The default value for this source is empty
, which means that this model subscribes to all available sources. These sources can be changed later, after the model has been created, by calling setSources.
builder->withSources(sources.begin(), sources.end());
- Template Parameters
-
EventSourceIt | The source collection iterator type. |
- Parameters
-
begin | The beginning of the collection of sources. |
end | The end of the collection of sources. |
- Returns
- The builder instance.