/[H6]/CommonStorage.h
ViewVC logotype

Contents of /CommonStorage.h

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20