PureMVC PureMVC

include/PureMVC/Interfaces/IController.hpp

Go to the documentation of this file.
00001 //  IController.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_INTERFACES_ICONTROLLER_HPP__)
00010 #define __PUREMVC_INTERFACES_ICONTROLLER_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 "INotification.hpp"
00021 #include "ICommand.hpp"
00022 #include "IAggregate.hpp"
00023 
00024 namespace PureMVC
00025 {
00026     namespace Interfaces
00027     {
00052         struct PUREMVC_API IController
00053         {
00054             typedef std::auto_ptr<IAggregate<std::string> > NotificationNames;
00055 
00063             virtual void registerCommand(std::string const& notification_name, ICommand* command) = 0;
00064 
00071             virtual void executeCommand(INotification const& notification) = 0;
00072 
00079             virtual ICommand const& retrieveCommand(std::string const& notification_name) const = 0;
00080 
00087             virtual ICommand& retrieveCommand(std::string const& notification_name) = 0;
00088 
00095             virtual ICommand* removeCommand(std::string const& notification_name) = 0;
00096 
00103             virtual bool hasCommand(std::string const& notification_name) const = 0;
00104 
00110             virtual NotificationNames listNotificationNames(void) const = 0;
00111 
00115             virtual ~IController(void);
00116         };
00117     }
00118 }
00119 
00120 #endif /* __PUREMVC_INTERFACES_ICONTROLLER_HPP__ */