|
GnuCash c935c2f+
|
Private interfaces, not meant to be used by applications. More...
Files | |
| file | qofobject-p.h |
| the Core Object Registration/Lookup Private Interface | |
Data Structures | |
| struct | QofBackend |
| struct | QofBook |
| QofBook reference. More... | |
| struct | QofBookTestFunctions |
Functions | |
| QofBackend::QofBackend (const QofBackend &)=delete | |
| QofBackend::QofBackend (const QofBackend &&)=delete | |
| virtual void | QofBackend::session_begin (QofSession *session, const char *new_uri, SessionOpenMode mode)=0 |
| Open the file or connect to the server. | |
| virtual void | QofBackend::session_end ()=0 |
| virtual void | QofBackend::load (QofBook *, QofBackendLoadType)=0 |
| Load the minimal set of application data needed for the application to be operable at initial startup. | |
| virtual void | QofBackend::begin (QofInstance *) |
| Called when the engine is about to make a change to a data structure. | |
| virtual void | QofBackend::commit (QofInstance *) |
| Commits the changes from the engine to the backend data storage. | |
| virtual void | QofBackend::rollback (QofInstance *) |
| Revert changes in the engine and unlock the backend. | |
| virtual void | QofBackend::sync (QofBook *)=0 |
| Synchronizes the engine contents to the backend. | |
| virtual void | QofBackend::safe_sync (QofBook *)=0 |
| Perform a sync in a way that prevents data loss on a DBI backend. | |
| virtual void | QofBackend::export_coa (QofBook *) |
| Extract the chart of accounts from the current database and create a new database with it. | |
| void | QofBackend::set_error (QofBackendError err) |
| Set the error value only if there isn't already an error already. | |
| QofBackendError | QofBackend::get_error () |
| Retrieve the currently-stored error and clear it. | |
| bool | QofBackend::check_error () |
| Report if there is an error. | |
| void | QofBackend::set_message (std::string &&) |
| Set a descriptive message that can be displayed to the user when there's an error. | |
| const std::string && | QofBackend::get_message () |
| Retrieve and clear the stored error message. | |
| void | QofBackend::set_percentage (QofBePercentageFunc pctfn) |
| Store and retrieve a backend-specific function for determining the progress in completing a long operation, for use with a progress meter. | |
| QofBePercentageFunc | QofBackend::get_percentage () |
| const std::string & | QofBackend::get_uri () |
| Retrieve the backend's storage URI. | |
| static bool | QofBackend::register_backend (const char *, const char *) |
| Class methods for dynamically loading the several backends and for freeing them at shutdown. | |
| static void | QofBackend::release_backends () |
Backend_Private | |
Pseudo-object defining how the engine can interact with different back-ends (which may be SQL databases, or network interfaces to remote QOF servers. File-io is just one type of backend). The callbacks will be called at the appropriate times during a book session to allow the backend to store the data as needed. | |
| enum | QofBackendLoadType { LOAD_TYPE_INITIAL_LOAD , LOAD_TYPE_LOAD_ALL } |
| using | GModuleVec = std::vector< GModule * > |
Book_Private | |
| QofBookTestFunctions * | _utest_qofbook_fill_functions (void) |
| void | qof_book_set_backend (QofBook *book, QofBackend *be) |
| gboolean | qof_book_register (void) |
| gchar * | qof_book_normalize_counter_format_internal (const gchar *p, const gchar *gint64_format, gchar **err_msg) |
| Validate a counter format string with a given format specifier. | |
| void | qof_book_print_dirty (const QofBook *book) |
| This debugging function can be used to traverse the book structure and all subsidiary structures, printing out which structures have been marked dirty. | |
Class_Private | |
| void | qof_class_init (void) |
| void | qof_class_shutdown (void) |
| QofSortFunc | qof_class_get_default_sort (QofIdTypeConst obj_name) |
Entity_Private | |
| void | qof_collection_insert_entity (QofCollection *, QofInstance *) |
| Take entity, remove it from whatever collection its currently in, and place it in a new collection. | |
| void | qof_collection_mark_clean (QofCollection *) |
| reset value of dirty flag | |
| void | qof_collection_mark_dirty (QofCollection *) |
| void | qof_collection_print_dirty (const QofCollection *col, gpointer dummy) |
Objects_Private | |
| void | qof_object_book_begin (QofBook *book) |
| To be called from within the book. | |
| void | qof_object_book_end (QofBook *book) |
| gboolean | qof_object_is_dirty (const QofBook *book) |
| void | qof_object_mark_clean (QofBook *book) |
| gboolean | qof_object_compliance (QofIdTypeConst type_name, gboolean warn) |
| check an object can be created and supports iteration | |
Private interfaces, not meant to be used by applications.
| using GModuleVec = std::vector<GModule*> |
Definition at line 169 of file qof-backend.hpp.
| enum QofBackendLoadType |
Definition at line 163 of file qof-backend.hpp.
| QofBookTestFunctions * _utest_qofbook_fill_functions | ( | void | ) |
Definition at line 1444 of file qofbook.cpp.
|
inlinevirtual |
Called when the engine is about to make a change to a data structure.
It could provide an advisory lock on data, but no backend does this.
Reimplemented in GncSqlBackend.
Definition at line 217 of file qof-backend.hpp.
| bool QofBackend::check_error | ( | ) |
Report if there is an error.
Definition at line 73 of file qof-backend.cpp.
|
virtual |
Commits the changes from the engine to the backend data storage.
Reimplemented in GncSqlBackend, and GncXmlBackend.
Definition at line 49 of file qof-backend.cpp.
|
inlinevirtual |
Extract the chart of accounts from the current database and create a new database with it.
Implemented only in the XML backend at present.
Reimplemented in GncXmlBackend.
Definition at line 250 of file qof-backend.hpp.
| QofBackendError QofBackend::get_error | ( | ) |
Retrieve the currently-stored error and clear it.
Definition at line 64 of file qof-backend.cpp.
| const std::string && QofBackend::get_message | ( | ) |
Retrieve and clear the stored error message.
Definition at line 85 of file qof-backend.cpp.
|
inline |
Definition at line 271 of file qof-backend.hpp.
|
inline |
Retrieve the backend's storage URI.
Definition at line 274 of file qof-backend.hpp.
|
pure virtual |
Load the minimal set of application data needed for the application to be operable at initial startup.
It is assumed that the application will perform a 'run_query()' to obtain any additional data that it needs. For file-based backends, it is acceptable for the backend to return all data at load time; for SQL-based backends, it is acceptable for the backend to return no data.
Thus, for example, the old GnuCash postgres backend returned the account tree, all currencies, and the pricedb, as these were needed at startup. It did not have to return any transactions whatsoever, as these were obtained at a later stage when a user opened a register, resulting in a query being sent to the backend. The current DBI backend on the other hand loads the entire database into memory.
(Its OK to send over entities at this point, but one should be careful of the network load; also, its possible that whatever is sent is not what the user wanted anyway, which is why its better to wait for the query).
Implemented in GncDbiBackend< Type >, GncSqlBackend, and GncXmlBackend.
| gchar * qof_book_normalize_counter_format_internal | ( | const gchar * | p, |
| const gchar * | gint64_format, | ||
| gchar ** | err_msg | ||
| ) |
Validate a counter format string with a given format specifier.
If valid, returns a normalized format string, that is whatever long int specifier was used will be replaced with the value of the posix "PRIx64" macro. If not valid returns NULL and optionally set an error message is a non-null err_msg parameter was passed. The caller should free the returned format string and error message with g_free.
Definition at line 785 of file qofbook.cpp.
| void qof_book_print_dirty | ( | const QofBook * | book | ) |
This debugging function can be used to traverse the book structure and all subsidiary structures, printing out which structures have been marked dirty.
Definition at line 411 of file qofbook.cpp.
| gboolean qof_book_register | ( | void | ) |
Definition at line 1415 of file qofbook.cpp.
| void qof_book_set_backend | ( | QofBook * | book, |
| QofBackend * | be | ||
| ) |
Definition at line 457 of file qofbook.cpp.
| QofSortFunc qof_class_get_default_sort | ( | QofIdTypeConst | obj_name | ) |
Definition at line 75 of file qofclass.cpp.
| void qof_class_init | ( | void | ) |
Definition at line 54 of file qofclass.cpp.
| void qof_class_shutdown | ( | void | ) |
Definition at line 64 of file qofclass.cpp.
| void qof_collection_insert_entity | ( | QofCollection * | col, |
| QofInstance * | ent | ||
| ) |
Take entity, remove it from whatever collection its currently in, and place it in a new collection.
To be used only for moving entity from one book to another.
Definition at line 95 of file qofid.cpp.
| void qof_collection_mark_clean | ( | QofCollection * | col | ) |
| void qof_collection_mark_dirty | ( | QofCollection * | col | ) |
| void qof_collection_print_dirty | ( | const QofCollection * | col, |
| gpointer | dummy | ||
| ) |
Definition at line 256 of file qofid.cpp.
| void qof_object_book_begin | ( | QofBook * | book | ) |
To be called from within the book.
Definition at line 80 of file qofobject.cpp.
| void qof_object_book_end | ( | QofBook * | book | ) |
Definition at line 98 of file qofobject.cpp.
| gboolean qof_object_compliance | ( | QofIdTypeConst | type_name, |
| gboolean | warn | ||
| ) |
check an object can be created and supports iteration
| type_name | object to check |
| warn | If called only once per operation, pass TRUE to log objects that fail the compliance check. To prevent repeated log messages when calling more than once, pass FALSE. |
Definition at line 167 of file qofobject.cpp.
| gboolean qof_object_is_dirty | ( | const QofBook * | book | ) |
Definition at line 117 of file qofobject.cpp.
| void qof_object_mark_clean | ( | QofBook * | book | ) |
Definition at line 136 of file qofobject.cpp.
|
inline |
Definition at line 177 of file qof-backend.hpp.
|
static |
Class methods for dynamically loading the several backends and for freeing them at shutdown.
Definition at line 91 of file qof-backend.cpp.
|
static |
Definition at line 132 of file qof-backend.cpp.
|
inlinevirtual |
Revert changes in the engine and unlock the backend.
Reimplemented in GncSqlBackend.
Definition at line 225 of file qof-backend.hpp.
|
pure virtual |
Perform a sync in a way that prevents data loss on a DBI backend.
Implemented in GncDbiBackend< Type >, GncDbiBackend< Type >, and GncXmlBackend.
|
pure virtual |
Open the file or connect to the server.
| session | The QofSession that will control the backend. |
| new_uri | The location of the data store that the backend will use. |
| mode | The session open mode. See qof_session_begin(). |
Implemented in GncDbiBackend< Type >, GncDbiBackend< Type >, and GncXmlBackend.
| void QofBackend::set_error | ( | QofBackendError | err | ) |
Set the error value only if there isn't already an error already.
Definition at line 56 of file qof-backend.cpp.
| void QofBackend::set_message | ( | std::string && | msg | ) |
Set a descriptive message that can be displayed to the user when there's an error.
Definition at line 79 of file qof-backend.cpp.
|
inline |
Store and retrieve a backend-specific function for determining the progress in completing a long operation, for use with a progress meter.
Definition at line 270 of file qof-backend.hpp.
|
pure virtual |
Synchronizes the engine contents to the backend.
This should done by using version numbers (hack alert – the engine does not currently contain version numbers). If the engine contents are newer than what is in the backend, the data is stored to the backend. If the engine contents are older, then the engine contents are updated.
Note that this sync operation is only meant to apply to the current contents of the engine. This routine is not intended to be used to fetch entity data from the backend.
File based backends tend to use sync as if it was called dump. Data is written out into the backend, overwriting the previous data. Database backends should implement a more intelligent solution.
Implemented in GncSqlBackend, and GncXmlBackend.
| QofBackend* QofBook::backend |
Definition at line 113 of file qofbook-p.hpp.
| char QofBook::book_open |
Definition at line 97 of file qofbook-p.hpp.
| gint QofBook::cached_num_days_autoreadonly |
Definition at line 125 of file qofbook-p.hpp.
| gboolean QofBook::cached_num_days_autoreadonly_isvalid |
Definition at line 127 of file qofbook-p.hpp.
| gboolean QofBook::cached_num_field_source |
Definition at line 118 of file qofbook-p.hpp.
| gboolean QofBook::cached_num_field_source_isvalid |
Definition at line 120 of file qofbook-p.hpp.
| GHashTable* QofBook::data_table_finalizers |
Definition at line 85 of file qofbook-p.hpp.
| GHashTable* QofBook::data_tables |
Definition at line 82 of file qofbook-p.hpp.
| QofBookDirtyCB QofBook::dirty_cb |
Definition at line 67 of file qofbook-p.hpp.
| gpointer QofBook::dirty_data |
Definition at line 71 of file qofbook-p.hpp.
| time64 QofBook::dirty_time |
Definition at line 62 of file qofbook-p.hpp.
| char(* QofBookTestFunctions::get_book_open) (const QofBook *) |
Definition at line 142 of file qofbook-p.hpp.
| GHashTable *(* QofBookTestFunctions::get_collections) (const QofBook *) |
Definition at line 139 of file qofbook-p.hpp.
| GHashTable *(* QofBookTestFunctions::get_data_table_finalizers) (const QofBook *) |
Definition at line 141 of file qofbook-p.hpp.
| GHashTable *(* QofBookTestFunctions::get_data_tables) (const QofBook *) |
Definition at line 140 of file qofbook-p.hpp.
| QofBookDirtyCB(* QofBookTestFunctions::get_dirty_cb) (const QofBook *) |
Definition at line 136 of file qofbook-p.hpp.
| gpointer(* QofBookTestFunctions::get_dirty_data) (const QofBook *) |
Definition at line 138 of file qofbook-p.hpp.
| gboolean(* QofBookTestFunctions::get_read_only) (const QofBook *) |
Definition at line 135 of file qofbook-p.hpp.
| gboolean(* QofBookTestFunctions::get_session_dirty) (const QofBook *) |
Definition at line 134 of file qofbook-p.hpp.
| int(* QofBookTestFunctions::get_version) (const QofBook *) |
Definition at line 143 of file qofbook-p.hpp.
| GHashTable* QofBook::hash_of_collections |
Definition at line 77 of file qofbook-p.hpp.
| QofInstance QofBook::inst |
Definition at line 48 of file qofbook-p.hpp.
|
protected |
Each backend resolves a fully-qualified file path.
This holds the filepath and communicates it to the frontends.
Definition at line 286 of file qof-backend.hpp.
|
protected |
Definition at line 282 of file qof-backend.hpp.
| gboolean QofBook::read_only |
Definition at line 91 of file qofbook-p.hpp.
| gboolean QofBook::session_dirty |
Definition at line 58 of file qofbook-p.hpp.
| void(* QofBookTestFunctions::set_shutting_down) (QofBook *, gboolean) |
Definition at line 137 of file qofbook-p.hpp.
| gboolean QofBook::shutting_down |
Definition at line 104 of file qofbook-p.hpp.
| gint32 QofBook::version |
Definition at line 107 of file qofbook-p.hpp.