42#ifndef __QOF_BACKEND_HPP__
43#define __QOF_BACKEND_HPP__
51#include "qofinstance-p.h"
165 LOAD_TYPE_INITIAL_LOAD,
169using GModuleVec = std::vector<GModule*>;
178 m_percentage{
nullptr},
m_fullpath{}, m_last_err{ERR_BACKEND_NO_ERR},
191 virtual void session_end() = 0;
280 static void release_backends();
288 static GModuleVec c_be_registry;
290 std::string m_error_msg;
QofBackendError
The errors that can be reported to the GUI & other front-end users.
void(* QofBePercentageFunc)(const char *message, double percent)
DOCUMENT ME!
SessionOpenMode
Mode for opening sessions.
virtual void commit(QofInstance *)
Commits the changes from the engine to the backend data storage.
void set_message(std::string &&)
Set a descriptive message that can be displayed to the user when there's an error.
static bool register_backend(const char *, const char *)
Class methods for dynamically loading the several backends and for freeing them at shutdown.
virtual void load(QofBook *, QofBackendLoadType)=0
Load the minimal set of application data needed for the application to be operable at initial startup...
void set_percentage(QofBePercentageFunc pctfn)
Store and retrieve a backend-specific function for determining the progress in completing a long oper...
virtual void session_begin(QofSession *session, const char *new_uri, SessionOpenMode mode)=0
Open the file or connect to the server.
const std::string & get_uri()
Retrieve the backend's storage URI.
virtual void export_coa(QofBook *)
Extract the chart of accounts from the current database and create a new database with it.
bool check_error()
Report if there is an error.
virtual void rollback(QofInstance *)
Revert changes in the engine and unlock the backend.
std::string m_fullpath
Each backend resolves a fully-qualified file path.
virtual void begin(QofInstance *)
Called when the engine is about to make a change to a data structure.
const std::string && get_message()
Retrieve and clear the stored error message.
virtual void safe_sync(QofBook *)=0
Perform a sync in a way that prevents data loss on a DBI backend.
virtual void sync(QofBook *)=0
Synchronizes the engine contents to the backend.
QofBackendError get_error()
Retrieve the currently-stored error and clear it.
void set_error(QofBackendError err)
Set the error value only if there isn't already an error already.
API for data storage Backend.
Encapsulate all the information about a dataset.
find objects that match a certain expression.
Encapsulates a connection to a backend (persistent store)