/[H6]/CommonStorage.h
ViewVC logotype

Contents of /CommonStorage.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 60 - (show annotations) (download)
Mon Oct 22 13:00:14 2007 UTC (16 years, 6 months ago) by torben
File MIME type: text/plain
File size: 1082 byte(s)
Refactored the database layer classes. Pushed most of the functions to the parent class.
1 /*
2 * Developed by Torben H. Nielsen
3 */
4
5 #pragma once
6
7 //Forward declaration
8 class CMyTabCtrl;
9
10
11 #include <vector>
12 #include "Containers.h"
13 #include "DatabaseLayer.h"
14
15 using namespace std;
16
17
18 //CommonStorage er en implementation af singleton "mønstret"
19 class CommonStorage
20 {
21 public:
22 static CommonStorage *Instance();
23 ~CommonStorage(void);
24
25 //setters and getters er inline funktioner
26 void setDBLayer(DatabaseLayer *d) {dbl = d;}
27 DatabaseLayer *getDBLayer() {return dbl;}
28
29 void setTabCtrl(CMyTabCtrl *newtab) {tab = newtab;}
30 CMyTabCtrl *getTabCtrl() {return tab;}
31
32 void setAdmin(bool admin) {isAdmin = admin;}
33 bool getAdmin() {return isAdmin;}
34
35 void setSearchResult(vector<Equipment> &ev) {equipments = ev;}
36 vector<Equipment>& getSearchResult() {return equipments;}
37
38
39 protected:
40 CommonStorage(void);
41 CommonStorage(const CommonStorage&);
42 CommonStorage& operator=(const CommonStorage&);
43
44 private:
45 //static CommonStorage *pinstance;
46
47 vector<Equipment> equipments;
48 DatabaseLayer *dbl;
49 CMyTabCtrl *tab;
50 bool isAdmin;
51 };

  ViewVC Help
Powered by ViewVC 1.1.20