DbBase Class ReferenceThis is base object for Database, DbConnection and DbResult classes.
More...
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Public Member Functions | |
| DbBase () | |
| Constructor. | |
| DbBase * | getParentErrorHandler () const |
| Get parent error handler or NULL if not set. | |
| void | handleError (int pErrorType, const char *pMsg) const |
| Handles error from database backend. | |
| void | setErrorHandler (void *pOwner, errorHandlerFunc pFunc) |
| Sets new error handler. | |
| void | setParentErrorHandler (DbBase *pParent) |
| Sets parent error handler. | |
| ~DbBase () | |
| Destructor. | |
Protected Attributes | |
| std::set< DbBase * > | mChildren |
| list of child error handlers | |
| errorHandlerFunc | mErrorHandler |
| Custom error handling function. | |
| void * | mObj |
| pointer to data that is passed to custom error handing function | |
| DbBase * | mParent |
| pointer to parent error handler | |
It contains error handling routines and inherits conversion specification for converting data between database and application.
Database plugins can create multiple DbConnections and those connections can create multiple DbResult objects. When there is an error during data processing and current object cannot handle that error it should propagated up in this tree structure. This class contains pointers that forms tree allowing errors to be propagated from DbResult to DbConnection and up to Database objects. Error is propagated only if current DbBase object don't have error handling callback or calling this callback returned false. In both cases parent DbBase object is tried. If there is no parent handler and callback function is NULL then error message is printer to stderr.
Conversion specification data should copied when child object is created. It is plugin responsibility to copy this data from Database derived class to DbConnection when DbConnection is created and from DbConnection to DbResult.
|
||||||||||||
|
Handles error from database backend. Default implementation prints errors on stderr
|
|
||||||||||||
|
Sets new error handler.
|
|
|
Sets parent error handler. Parent error handler will be tried if this error handler cannot handle error (callback function is NULL or returns false)
|
|
|
Custom error handling function. Called instead of default handleError function |
| Documentation |
|---|
| Quick start |
| Examples |
| Search |
| API Documentation |
|---|
| Class hierarchy |
| Member index |
| API Reference |
| Store filters |
| Store table macros |