LoveBrains  1.0.0
a_observable.h
1 /*
2 ** a_observable.h for GAEngine in /home/robin_f/Programming/Git/CPP/GAEngine
3 **
4 ** Made by Guillaume ROBIN
5 ** Login <robin_f@epitech.eu>
6 **
7 ** Started on Mon Jul 20 18:33:16 2015 Guillaume ROBIN
8 ** Last update Fri Aug 21 16:09:47 2015 Guillaume ROBIN
9 */
10 
11 #ifndef A_OBSERVABLE_H_
12 # define A_OBSERVABLE_H_
13 
14 # include <list>
15 
16 # include "GA/a_observer.h"
17 
22 namespace GA
23 {
29  {
30  public:
34  virtual ~AObservable(void);
35 
40  void addObserver(AObserver *obs);
45  void delObserver(AObserver *obs);
46  protected:
47  std::list<AObserver *> _obs;
53  void Notify(AObserver::States state);
54  };
55 }
56 
57 #endif /* !A_OBSERVABLE_H_ */
Define the abstract class that allow to be observable.
Definition: a_observable.h:28
Contains the objects that define the GAEngine.
void Notify(AObserver::States state)
Notify to the observers that something has changed.
Definition: a_observable.cc:34
virtual ~AObservable(void)
Destructor.
Definition: a_observable.cc:15
void delObserver(AObserver *obs)
Delete an observer.
Definition: a_observable.cc:24
Define the abstract class that allow to be an observer.
Definition: a_observer.h:20
void addObserver(AObserver *obs)
Add a new observer to the list.
Definition: a_observable.cc:19
std::list< AObserver * > _obs
Definition: a_observable.h:47