PureMVC PureMVC

include/PureMVC/Patterns/Observer/Notifier.hpp

Go to the documentation of this file.
00001 //  Notifier.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_NOTIFIER_HPP__)
00010 #define __PUREMVC_PATTERNS_OBSERVER_NOTIFIER_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/INotifier.hpp"
00021 #include "../../Interfaces/IFacade.hpp"
00022 
00023 namespace PureMVC
00024 {
00025     namespace Patterns
00026     {
00027         using Interfaces::INotifier;
00028         using Interfaces::IFacade;
00029 
00065         class PUREMVC_API Notifier : public virtual INotifier
00066         {
00067         public:
00071             explicit Notifier(void);
00072 
00076             explicit Notifier(Notifier const& arg);
00077         public:
00088             virtual void sendNotification(std::string const& notification_name, void const* body = NULL, std::string const& type = "");
00089 
00108             virtual void initializeNotifier(std::string const& key);
00109 
00110             /*
00111              * Get multi ton key.
00112              *
00113              * @param key the multitonKey for this INotifier to use
00114              */
00115              virtual std::string const& getMultitonKey(void) const;
00116 
00120             Notifier& operator=(Notifier const& arg);
00121 
00125             virtual ~Notifier(void);
00126         protected:
00127             // Return the Multiton Facade instance
00128             IFacade& getFacade();
00129         protected:
00130             // The Multiton Key for this app
00131             std::string _multiton_key;
00132             // Message Constants
00133             static char const* const MULTITON_MSG;
00134         };
00135     }
00136 }
00137 
00138 #endif /* __PUREMVC_PATTERNS_OBSERVER_NOTIFIER_HPP__ */