The listener for receiving time series events with the specified type from the TimeSeriesTxModel.
More...
#include <TxModelListener.hpp>
|
| std::string | toString () const override |
| | Returns a string representation of the current object.
|
| |
| 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 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 | ~Entity () noexcept |
| | The default virtual d-tor.
|
| |
|
| static std::shared_ptr< TimeSeriesTxModelListener< E > > | create (std::function< void(const std::vector< std::shared_ptr< E > > &, bool)> onEventsReceived) |
| | Creates a listener for receiving time series events (with instantiation by event type E and verification)
|
| |
| static auto | createShared (Args &&...args) |
| | Creates a smart pointer to an object.
|
| |
template<Derived<
TimeSeriesEvent > E>
struct TimeSeriesTxModelListener< E >
The listener for receiving time series events with the specified type from the TimeSeriesTxModel.
◆ create()
Creates a listener for receiving time series events (with instantiation by event type E and verification)
if (isSnapshot) {
std::cout << "Snapshot:" << std::endl;
} else {
std::cout << "Update:" << std::endl;
}
for (const auto &e : events) {
std::cout << "[" << e->getEventFlagsMask().toString() << "]:" << e << std::endl;
}
std::cout << std::endl;
});
builder->withListener(listener);
static std::shared_ptr< TimeSeriesTxModelListener< E > > create(std::function< void(const std::vector< std::shared_ptr< E > > &, bool)> onEventsReceived)
Creates a listener for receiving time series events (with instantiation by event type E and verificat...
Definition TxModelListener.hpp:181
- Template Parameters
-
- Parameters
-
| onEventsReceived | A functional object, lambda, or function to which indexed event data will be passed. |
- Returns
- A smart pointer to the listener.
◆ toString()
Returns a string representation of the current object.
- Returns
- a string representation
Reimplemented from SharedEntity.