YATiSh
Yet Another TIme SHeet
yatishDB.h
Go to the documentation of this file.
1 /********************************************************************
2  * Name: yatishDB.h
3  * Purpose: Declares the base class of yatish database controllers
4  * Author: Nicolas PĂ©renne (nicolas.perenne@eif-services.eu)
5  * Created: 2020-04-15
6  * Copyright: EIF-services (https://www.eif-services.eu/yatish)
7  * License: GPLv3
8  ********************************************************************/
9 
10 #ifndef YATISHDB_H
11 #define YATISHDB_H
12 
13 enum tableID {
20 };
21 
22 #define CATCH(returnValue) catch (wxDatabaseException& e) {\
23  wxLogError ( "[%d] %s", e.GetErrorCode(), e.GetErrorMessage() );\
24  return returnValue; }
25 
42 class yatishDB {
43  public:
44  static const char * tableName [];
45  protected:
46  static wxDatabase * masterDB;
47  wxDatabase * GetDatabase (const wxString&);
48  bool TablesOk (wxDatabase *);
49 };
50 
51 #endif // YATISHDB_H
Provides a few basic methods and (static) members to interact with yatish tables.
Definition: yatishDB.h:42
static wxDatabase * masterDB
Definition: yatishDB.h:46
bool TablesOk(wxDatabase *)
Returns false if any of the yatish table is missings.
Definition: yatishDB.cpp:83
static const char * tableName[]
Must be defined in the same order as enum tableID.
Definition: yatishDB.h:44
wxDatabase * GetDatabase(const wxString &)
Sets up a (configuration) flux using its argument then calls wxDatabase::GetDatabase().
Definition: yatishDB.cpp:48
tableID
Definition: yatishDB.h:13
@ tool_tid
Definition: yatishDB.h:16
@ task_tid
Definition: yatishDB.h:15
@ timeslot_tid
Definition: yatishDB.h:19
@ client_tid
Definition: yatishDB.h:14
@ project_tid
Definition: yatishDB.h:17
@ activity_tid
Definition: yatishDB.h:18