PetaVision  Alpha
BaseMessage.hpp
1 /*
2  * BaseMessage.hpp
3  *
4  * Created on: Aug 1, 2016
5  * Author: pschultz
6  *
7  * The base class for messages passed using Subject::notify and
8  * Observer::respond.
9  */
10 
11 #ifndef BASEMESSAGE_HPP_
12 #define BASEMESSAGE_HPP_
13 
14 #include <string>
15 
16 namespace PV {
17 
18 class BaseMessage {
19  public:
20  BaseMessage() {}
21  virtual ~BaseMessage() {}
22  inline std::string const &getMessageType() const { return mMessageType; }
23 
24  protected:
25  inline void setMessageType(std::string const &messageType) { mMessageType = messageType; }
26  inline void setMessageType(char const *messageType) { mMessageType = messageType; }
27 
28  private:
29  std::string mMessageType = "";
30 };
31 
32 } // namespace PV
33 
34 #endif /* BASEMESSAGE_HPP_ */