PureMVC PureMVC

include/PureMVC/Patterns/Observer/Notification.hpp

Go to the documentation of this file.
00001 //  Notification.hpp
00002 //  PureMVC_C++
00003 //
00004 //  PureMVC Port to C++ by Tang Khai Phuong <phuong.tang@puremvc.org>
00005 //  PureMVC - Copyright(c) 2006-2011 Futurescale, Inc., Some rights reserved.
00006 //  Your reuse is governed by the Creative Commons Attribution 3.0 License
00007 //
00008 
00009 #if !defined(__PUREMVC_PATTERNS_OBSERVER_NOTIFICATION_HPP__)
00010 #define __PUREMVC_PATTERNS_OBSERVER_NOTIFICATION_HPP__
00011 
00012 // STL include
00013 #include <string>
00014 // PureMVC include
00015 #if !defined(__PUREMVC_HPP__)
00016 #define __PUREMVC_INCLUDE__
00017 #include "../PureMVC.hpp"
00018 #endif /* __PUREMVC_HPP__ */
00019 
00020 #include "../../Interfaces/INotification.hpp"
00021 
00022 namespace PureMVC
00023 {
00024     namespace Patterns
00025     {
00026         using Interfaces::INotification;
00027 
00063         class PUREMVC_API Notification : public virtual INotification
00064         {
00065         public:
00069             explicit Notification(Notification const& arg);
00070 
00078             Notification(std::string const& name, void const* body = NULL, std::string const& type = "");
00079             
00085             virtual std::string const& getName(void) const;
00086 
00090             virtual void setBody(void const* body);
00091 
00097             virtual void const* getBody(void) const;
00098 
00102             virtual void setType(std::string const& type);
00103 
00109             virtual std::string const& getType(void) const;
00110 
00116             virtual std::string toString(void) const;
00117               
00121             virtual void toString(std::string& arg) const;
00122 
00126             Notification& operator=(Notification const& arg);
00127 
00131             virtual ~Notification(void);
00132         private:
00133             // the name of the notification instance
00134             std::string _name;
00135             // the body of the notification instance
00136             void const* _body;
00137             // the type of the notification instance
00138             std::string _type;
00139         };
00140     }
00141 }
00142 
00143 #endif /* __PUREMVC_PATTERNS_OBSERVER_NOTIFICATION_HPP__ */