/[H6]/CommonStorage.h
ViewVC logotype

Contents of /CommonStorage.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15 - (show annotations) (download)
Thu Aug 31 15:59:34 2006 UTC (17 years, 8 months ago) by torben
File MIME type: text/plain
File size: 1070 byte(s)
Make getSearchResult() return a reference to the result vector
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
37 protected:
38 CommonStorage(void);
39 CommonStorage(const CommonStorage&);
40 CommonStorage& operator=(const CommonStorage&);
41
42 private:
43 //static CommonStorage *pinstance;
44
45 EquipmentVector equipments;
46 DatabaseLayer *dbl;
47 CMyTabCtrl *tab;
48 bool isAdmin;
49 };

  ViewVC Help
Powered by ViewVC 1.1.20