ewol/sources/ewol/object/Message.h
Edouard DUPIN babbf2bcd1 [LICENCE] change BSD v3 to APACHE v2.0
this is for prevent some patent errors
2014-08-08 23:19:08 +02:00

56 lines
1.3 KiB
C++

/**
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license APACHE v2.0 (see license file)
*/
#ifndef __EWOL_OBJECT_MESSAGE_H__
#define __EWOL_OBJECT_MESSAGE_H__
#include <ewol/debug.h>
namespace ewol {
namespace object {
class Message {
private:
std::shared_ptr<ewol::Object> m_callerObject; //!< Caller class.
const char* m_event; //!< Event pointer == > unique Id define by the system ...
std::string m_data; //!< compositing additionnal message Value.
public:
Message(const std::shared_ptr<ewol::Object>& _caller,
const char* _message,
const std::string& _data) :
m_callerObject(_caller),
m_event(_message),
m_data(_data) {
};
void setCaller(const std::shared_ptr<ewol::Object>& _caller) {
m_callerObject = _caller;
};
inline std::shared_ptr<ewol::Object> getCaller() const {
return m_callerObject;
};
void setMessage(const char* _message) {
m_event = _message;
};
inline const char* getMessage() const {
return m_event;
};
void setData(const std::string& _data) {
m_data = _data;
};
inline const std::string& getData() const {
return m_data;
};
};
std::ostream& operator <<(std::ostream& _os, const ewol::object::Message& _obj);
};
};
#endif