/[H6]/CommonStorage.h
ViewVC logotype

Annotation of /CommonStorage.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (hide 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 torben 6 #pragma once
2    
3     //Forward declaration
4     class DatabaseLayer;
5 torben 12 class CMyTabCtrl;
6 torben 6
7    
8 torben 12 #include <vector>
9     #include "Containers.h"
10    
11     using namespace std;
12    
13    
14     typedef vector<Equipment> EquipmentVector;
15    
16 torben 6 //CommonStorage er en implementation af singleton "mønstret"
17     class CommonStorage
18     {
19     public:
20     static CommonStorage *Instance();
21 torben 9 ~CommonStorage(void);
22 torben 6
23     //setters and getters er inline funktioner
24     void setDBLayer(DatabaseLayer *d) {dbl = d;}
25     DatabaseLayer *getDBLayer() {return dbl;}
26    
27 torben 12 void setTabCtrl(CMyTabCtrl *newtab) {tab = newtab;}
28     CMyTabCtrl *getTabCtrl() {return tab;}
29    
30 torben 6 void setAdmin(bool admin) {isAdmin = admin;}
31     bool getAdmin() {return isAdmin;}
32    
33 torben 12 void setSearchResult(EquipmentVector &ev) {equipments = ev;}
34     EquipmentVector getSearchResult() {return equipments;}
35    
36 torben 6 protected:
37     CommonStorage(void);
38     CommonStorage(const CommonStorage&);
39     CommonStorage& operator=(const CommonStorage&);
40    
41     private:
42     //static CommonStorage *pinstance;
43    
44 torben 12 EquipmentVector equipments;
45 torben 6 DatabaseLayer *dbl;
46 torben 12 CMyTabCtrl *tab;
47 torben 6 bool isAdmin;
48     };

  ViewVC Help
Powered by ViewVC 1.1.20