/[H6]/CommonStorage.h
ViewVC logotype

Annotation of /CommonStorage.h

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20