PureMVC PureMVC
|
00001 // SimpleCommand.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_SIMPLE_COMMAND_HPP__) 00010 #define __PUREMVC_PATTERNS_COMMAND_SIMPLE_COMMAND_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/ICommand.hpp" 00021 #include "../Observer/Notifier.hpp" 00022 00023 namespace PureMVC 00024 { 00025 namespace Patterns 00026 { 00027 using Interfaces::ICommand; 00028 using Interfaces::INotifier; 00029 00030 class PUREMVC_API SimpleCommand 00031 : public virtual ICommand 00032 , public virtual INotifier 00033 , public Notifier 00034 { 00035 public: 00039 explicit SimpleCommand(void); 00040 00044 explicit SimpleCommand(SimpleCommand const& arg); 00045 00046 public: 00047 /* 00048 * Fulfill the use-case initiated by the given <code>INotification</code>. 00049 * 00050 * <P> 00051 * In the Command Pattern, an application use-case typically 00052 * begins with some user action, which results in an <code>INotification</code> being broadcast, which 00053 * is handled by business logic in the <code>execute</code> method of an 00054 * <code>ICommand</code>.</P> 00055 * 00056 * @param notification the <code>INotification</code> to handle. 00057 */ 00058 virtual void execute(INotification const& notification); 00059 00063 SimpleCommand& operator=(SimpleCommand const& arg); 00064 00068 virtual ~SimpleCommand(void); 00069 00070 }; 00071 } 00072 } 00073 00074 #endif /* __PUREMVC_PATTERNS_COMMAND_SIMPLE_COMMAND_HPP__ */