|
MantisBase v0.3.4
|
#include <realtime.h>
Public Member Functions | |
| RealtimeDB () | |
| bool | init () const |
| void | addDbHooks (const std::string &entity_name) const |
| void | addDbHooks (const Entity &entity) const |
| void | dropDbHooks (const std::string &entity_name) const |
| void | runWorker (const RtCallback &callback) |
| void | stopWorker () const |
Static Public Member Functions | |
| static void | addDbHooks (const Entity &entity, const std::shared_ptr< soci::session > &sess) |
| static void | dropDbHooks (const std::string &entity_name, const std::shared_ptr< soci::session > &sess) |
Realtime database change detection and notification. Initializes DB-specific hooks (triggers for PostgreSQL, polling for SQLite) and runs a worker that invokes the registered callback with change events.
| mb::RealtimeDB::RealtimeDB | ( | ) |
| void mb::RealtimeDB::addDbHooks | ( | const Entity & | entity | ) | const |
Register change hooks for an entity.
|
static |
Register change hooks for an entity on a given session (static, for schema creation).
| void mb::RealtimeDB::addDbHooks | ( | const std::string & | entity_name | ) | const |
Register change hooks for an entity by name.
| void mb::RealtimeDB::dropDbHooks | ( | const std::string & | entity_name | ) | const |
Remove change hooks for an entity by name.
|
static |
Remove change hooks for an entity on a given session (static).
| bool mb::RealtimeDB::init | ( | ) | const |
Initialize realtime for the current database backend. Must be called after DB is ready.
| void mb::RealtimeDB::runWorker | ( | const RtCallback & | callback | ) |
Start the realtime worker; callback receives change events.
| void mb::RealtimeDB::stopWorker | ( | ) | const |
Stop the realtime worker.