PureMVC PureMVC
|
00001 // MacroCommand.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_COMMAND_MACRO_COMMAND_HPP__) 00010 #define __PUREMVC_PATTERNS_COMMAND_MACRO_COMMAND_HPP__ 00011 00012 // STL include 00013 #include <string> 00014 #include <list> 00015 // PureMVC include 00016 #if !defined(__PUREMVC_HPP__) 00017 #define __PUREMVC_INCLUDE__ 00018 #include "../PureMVC.hpp" 00019 #endif /* __PUREMVC_HPP__ */ 00020 00021 #include "../../Interfaces/ICommand.hpp" 00022 #include "../Observer/Notifier.hpp" 00023 00024 namespace PureMVC 00025 { 00026 namespace Patterns 00027 { 00028 using Interfaces::ICommand; 00029 using Interfaces::INotification; 00030 00058 class PUREMVC_API MacroCommand 00059 : public virtual ICommand 00060 , public virtual INotifier 00061 , public Notifier 00062 { 00063 public: 00076 explicit MacroCommand(void); 00077 00081 explicit MacroCommand(MacroCommand const& arg); 00082 00083 protected: 00096 virtual void initializeMacroCommand(void); 00097 00107 virtual void addSubCommand(ICommand* command); 00108 00109 public: 00119 virtual void execute(INotification const& notification); 00120 00124 MacroCommand& operator=(MacroCommand const& arg); 00125 00129 virtual ~MacroCommand(void); 00130 private: 00131 typedef std::list<ICommand*> CommandList; 00132 CommandList _sub_commands; 00133 }; 00134 } 00135 } 00136 00137 #endif /* __PUREMVC_PATTERNS_COMMAND_MACRO_COMMAND_HPP__ */