|
| | ~IndexedEventTxModel () noexcept override |
| | Closes the model and destructs it.
|
| IndexedEventSubscriptionSymbol | getIndexedEventSubscriptionSymbol () const |
| | Returns the symbol of the model with its source.
|
| std::string | getSymbol () const |
| | Returns the symbol of the model.
|
| EventSourceWrapper | getSource () const |
| | Returns the source of the model.
|
| std::shared_ptr< SubscriptionController > | getSubscriptionController () const |
| | Returns the controller of the underlying subscription of the model: it attaches the model to and detaches it from a feed and changes the events batch limit, the aggregation period and the executor.
|
| bool | isClosed () const |
| | Returns whether the model is closed.
|
| void | close () const |
| | Closes the model: it is permanently detached from all feeds.
|
| 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.
|
|
virtual | ~Entity () noexcept |
| | The default virtual d-tor.
|
template<Derived<
IndexedEvent > E>
struct IndexedEventTxModel< E >
An incremental model of the indexed events of one symbol and one source (the IndexedEventTxModel of dxFeed Java API, an experimental API there).
The model delivers the events of complete snapshots and transactions only: it delays the events of an incomplete snapshot or of an ongoing transaction until the snapshot is complete or the transaction has ended.
- IndexedEventTxModel is the model of dxFeed Java API: one source, the events batch limit, the aggregation period and the executor of the underlying subscription, which can be changed later through the subscription controller (it also attaches the model to and detaches it from a feed).
- IndexedTxModel is the model of the Graal SDK: several sources, which can be changed later, batch and snapshot processing flags, attach and detach on the model itself.
Configuration
The model is configured with the builder: the symbol, the source and the listener (required), and the feed to attach to. The symbol and the source cannot be changed after the model is built.
Listener and resource management
The listener receives the events of one or more complete transactions and whether they form a snapshot. It is never called concurrently with itself. By default, it is called by the executor of the endpoint of the feed.
The model is closed by close or by the destructor: a closed model is permanently detached from all feeds. The listener is released with the last of its owners: the models built with it and the builder that holds it. Releasing it waits for its calls in progress on other threads, so do not destroy the last owner while holding a lock that the listener takes. Until then, a call that was already scheduled may still run after the model is closed. A listener must not own its model (for example, capture its std::shared_ptr): such a model is never destroyed.
->withSymbol("AAPL")
->withListener([](const auto &orders, bool isSnapshot) {
std::cout << (isSnapshot ? "Snapshot: " : "Update: ") << orders.size() << std::endl;
})
->build();
static const OrderSource NTV
NASDAQ Total View.
Definition OrderSource.hpp:235
static std::shared_ptr< DXFeed > getInstance()
Returns a default application-wide singleton instance of feed.
Definition DXFeed.cpp:25
static std::shared_ptr< Builder > newBuilder()
Creates a new builder of the model.
Definition IndexedEventTxModel.hpp:343
- Template Parameters
-