PureMVC PureMVC

include/PureMVC/Patterns/Proxy/Proxy.hpp

Go to the documentation of this file.
00001 //  Proxy.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_PROXY_PROXY_HPP__)
00010 #define __PUREMVC_PATTERNS_PROXY_PROXY_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/IProxy.hpp"
00021 #include "../Observer/Notifier.hpp"
00022 
00023 namespace PureMVC
00024 {
00025     namespace Patterns
00026     {
00027         using Interfaces::IProxy;
00028         using Interfaces::INotifier;
00029 
00051          class PUREMVC_API Proxy
00052              : public virtual IProxy
00053              , public virtual INotifier
00054              , public Notifier
00055          {
00056          public:
00060             explicit Proxy(Proxy const& arg);
00061 
00062          public:
00066              explicit Proxy(std::string const& proxy_name = Proxy::NAME, void const* data = NULL);
00067 
00071             virtual std::string const& getProxyName(void) const;
00072 
00076             virtual void setData(void const* data);
00077 
00081             virtual void const* getData(void) const;
00082 
00086             virtual void onRegister(void);
00087 
00091             virtual void onRemove(void);
00092 
00096             Proxy& operator=(Proxy const& arg);
00097 
00101             virtual ~Proxy(void);
00102         protected:
00103             // the proxy name
00104             std::string _proxy_name;
00105             // the data object
00106             void const* _data;
00107         public:
00108             static char const* const NAME;
00109         };
00110     }
00111 }
00112 
00113 #endif /* __PUREMVC_PATTERNS_PROXY_PROXY_HPP__ */