MantisBase v0.3.4
Loading...
Searching...
No Matches
mb::RealtimeDB Class Reference

#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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RealtimeDB()

mb::RealtimeDB::RealtimeDB ( )

Member Function Documentation

◆ addDbHooks() [1/3]

void mb::RealtimeDB::addDbHooks ( const Entity entity) const

Register change hooks for an entity.

◆ addDbHooks() [2/3]

void mb::RealtimeDB::addDbHooks ( const Entity entity,
const std::shared_ptr< soci::session > &  sess 
)
static

Register change hooks for an entity on a given session (static, for schema creation).

◆ addDbHooks() [3/3]

void mb::RealtimeDB::addDbHooks ( const std::string &  entity_name) const

Register change hooks for an entity by name.

◆ dropDbHooks() [1/2]

void mb::RealtimeDB::dropDbHooks ( const std::string &  entity_name) const

Remove change hooks for an entity by name.

◆ dropDbHooks() [2/2]

void mb::RealtimeDB::dropDbHooks ( const std::string &  entity_name,
const std::shared_ptr< soci::session > &  sess 
)
static

Remove change hooks for an entity on a given session (static).

◆ init()

bool mb::RealtimeDB::init ( ) const

Initialize realtime for the current database backend. Must be called after DB is ready.

◆ runWorker()

void mb::RealtimeDB::runWorker ( const RtCallback callback)

Start the realtime worker; callback receives change events.

◆ stopWorker()

void mb::RealtimeDB::stopWorker ( ) const

Stop the realtime worker.


The documentation for this class was generated from the following files: