|
fb-cpp 0.0.1
A modern C++ wrapper for the Firebird database API
|
Observes Firebird events and forwards aggregated counts to a callback on a background thread. More...
#include <EventListener.h>
Public Types | |
| using | Callback = std::function< void(const std::vector< EventCount > &counts)> |
| Function invoked when new event counts are available. | |
Public Member Functions | |
| EventListener (Attachment &attachment, const std::vector< std::string > &eventNames, Callback callback) | |
| Creates an event listener for the specified attachment and event names using the provided callback. | |
| ~EventListener () noexcept | |
| Stops the listener and waits for any background work to finish. | |
| EventListener (const EventListener &)=delete | |
| EventListener & | operator= (const EventListener &)=delete |
| EventListener (EventListener &&)=delete | |
| EventListener & | operator= (EventListener &&)=delete |
| bool | isListening () noexcept |
| Returns true if the listener is currently registered for event notifications. | |
| void | stop () |
| Cancels event notifications and releases related resources. | |
Observes Firebird events and forwards aggregated counts to a callback on a background thread.
Definition at line 66 of file EventListener.h.
| using fbcpp::EventListener::Callback = std::function<void(const std::vector<EventCount>& counts)> |
Function invoked when new event counts are available.
Definition at line 72 of file EventListener.h.
|
explicit |
Creates an event listener for the specified attachment and event names using the provided callback.
Definition at line 52 of file EventListener.cpp.
|
inlinenoexcept |
Stops the listener and waits for any background work to finish.
Definition at line 118 of file EventListener.h.
|
noexcept |
Returns true if the listener is currently registered for event notifications.
Definition at line 116 of file EventListener.cpp.
| void EventListener::stop | ( | ) |
Cancels event notifications and releases related resources.
Definition at line 122 of file EventListener.cpp.