| 47 |  | */ | 
| 48 |  | class SnapshotManager { | 
| 49 |  | public: | 
| 50 | < |  | 
| 50 | > | SnapshotManager() : currentSnapshot_(NULL), previousSnapshot_(NULL) { | 
| 51 | > | } | 
| 52 | > | virtual ~SnapshotManager(); | 
| 53 |  | virtual bool advance() = 0; | 
| 54 |  |  | 
| 55 | < | Snapshot* getSnapshot(int id); | 
| 54 | < |  | 
| 55 | < | Snapshot* getPrevSnapshot(); | 
| 55 | > | virtual Snapshot* getSnapshot(int id) = 0; | 
| 56 |  |  | 
| 57 | < | void setCurrentSnapshot(); | 
| 58 | < |  | 
| 59 | < | Snapshot* getCurrentSnapshot(); | 
| 57 | > | /** | 
| 58 | > | * Returns the pointer of previous snapshot | 
| 59 | > | * @return the pointer of previous snapshot | 
| 60 | > | */ | 
| 61 | > | Snapshot* getPrevSnapshot() { | 
| 62 | > | return previousSnapshot_; | 
| 63 | > | } | 
| 64 |  |  | 
| 65 | < | void setCurrentSnapshot(); | 
| 65 | > | /** | 
| 66 | > | * Returns the pointer of current snapshot | 
| 67 | > | * @return the pointer of current snapshot | 
| 68 | > | */ | 
| 69 | > | Snapshot* getCurrentSnapshot() { | 
| 70 | > | return currentSnapshot_; | 
| 71 | > | } | 
| 72 |  |  | 
| 73 |  | int getCapacity(); | 
| 74 |  |  | 
| 75 | < | void setCapacity(); | 
| 75 | > | virtual void setCapacity(int capacity); | 
| 76 |  |  | 
| 77 | < | void getNotifyStatus(); | 
| 77 | > | bool getNotifyStatus(); | 
| 78 |  |  | 
| 79 | < | void setNotifyStatus(); | 
| 79 | > | void setNotifyStatus(bool status); | 
| 80 |  |  | 
| 81 |  | void attach(SnapshotObserver*); | 
| 82 |  |  | 
| 83 |  | void detach(SnapshotObserver*); | 
| 84 |  |  | 
| 85 |  | void notify(); | 
| 86 | + |  | 
| 87 | + | protected: | 
| 88 | + | Snapshot* currentSnapshot_; | 
| 89 | + | Snapshot* previousSnapshot_; | 
| 90 |  |  | 
| 91 |  | private: | 
| 78 | – | vector<Snapshot*> snapshots_; | 
| 92 |  | vector<SnapshotObserver*> observers_; | 
| 93 | + |  | 
| 94 |  | }; | 
| 95 |  |  | 
| 96 |  | } |