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