PetaVision  Alpha
Observer.hpp
1 /*
2  * Observer.hpp
3  *
4  * Created on: Jul 30, 2016
5  * Author: pschultz
6  */
7 
8 #ifndef OBSERVER_HPP_
9 #define OBSERVER_HPP_
10 
11 #include "include/pv_common.h"
12 #include "observerpattern/BaseMessage.hpp"
13 #include "observerpattern/Response.hpp"
14 #include <memory>
15 
16 namespace PV {
17 
18 class Observer {
19  public:
20  Observer() {}
21  virtual ~Observer() {}
22  virtual Response::Status respond(std::shared_ptr<BaseMessage const> message) {
23  return Response::NO_ACTION;
24  }
25  inline std::string const &getDescription() const { return description; }
26  inline char const *getDescription_c() const { return description.c_str(); }
27 
28  // Data members
29  protected:
30  std::string description;
31 };
32 
33 } /* namespace PV */
34 
35 #endif /* OBSERVER_HPP_ */