]> git.donarmstrong.com Git - mothur.git/blob - summarydata.h
fixed some bugs
[mothur.git] / summarydata.h
1 #ifndef SUMMARYDATA_H
2 #define SUMMARYDATA_H
3
4 #include "mothur.h"
5 #include "sabundvector.hpp"
6 #include "display.h"
7 #include "observable.h"
8
9 /***********************************************************************/
10
11 class SummaryData : public Observable {
12         
13 public:
14         SummaryData() : sabund(0) {};
15         
16         void registerDisplay(Display* o)        {       displays.insert(o);                             };
17         void removeDisplay(Display* o)          {       displays.erase(o);      delete o;       };
18         SAbundVector* getSabundData()                   {       return sabund;                                  };
19         void sabundDataChanged()                                {       notifyDisplays();                               };
20         void updatesabundData(SAbundVector* rv) {       sabund = rv; sabundDataChanged();       };
21         
22         void notifyDisplays(){  
23                 for(set<Display*>::iterator pos=displays.begin();pos!=displays.end();pos++){
24                         (*pos)->update(sabund);
25                 }       
26         };
27         
28 private:
29         set<Display*> displays;
30         SAbundVector* sabund;
31         
32 };
33
34 /***********************************************************************/
35
36 #endif