/[H6]/CommonStorage.h
ViewVC logotype

Diff of /CommonStorage.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6 by torben, Wed Aug 30 12:00:21 2006 UTC revision 31 by torben, Sun Sep 3 10:10:19 2006 UTC
# Line 1  Line 1 
1    /*
2     * Developed by Torben H. Nielsen
3     */
4    
5  #pragma once  #pragma once
6    
7  //Forward declaration  //Forward declaration
8  class DatabaseLayer;  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"  //CommonStorage er en implementation af singleton "mønstret"
21  class CommonStorage  class CommonStorage
22  {  {
23  public:  public:
24          static CommonStorage *Instance();          static CommonStorage *Instance();
25            ~CommonStorage(void);
26    
27          //setters and getters er inline funktioner          //setters and getters er inline funktioner
28          void setDBLayer(DatabaseLayer *d) {dbl = d;}          void setDBLayer(DatabaseLayer *d) {dbl = d;}
29          DatabaseLayer *getDBLayer() {return dbl;}          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;}          void setAdmin(bool admin) {isAdmin = admin;}
35          bool getAdmin() {return isAdmin;}          bool getAdmin() {return isAdmin;}
36    
37            void setSearchResult(EquipmentVector &ev) {equipments = ev;}
38            EquipmentVector& getSearchResult() {return equipments;}
39    
40    
41  protected:  protected:
42          CommonStorage(void);          CommonStorage(void);
43          CommonStorage(const CommonStorage&);          CommonStorage(const CommonStorage&);
# Line 25  protected: Line 46  protected:
46  private:  private:
47          //static CommonStorage *pinstance;          //static CommonStorage *pinstance;
48    
49            EquipmentVector equipments;
50          DatabaseLayer *dbl;          DatabaseLayer *dbl;
51            CMyTabCtrl *tab;
52          bool isAdmin;          bool isAdmin;
53  };  };

Legend:
Removed from v.6  
changed lines
  Added in v.31

  ViewVC Help
Powered by ViewVC 1.1.20