/[H6]/CommonStorage.h
ViewVC logotype

Contents of /CommonStorage.h

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20