00001 #ifndef IGUANA_WEB_FRAMEWORK_IG_BROWSER_MANAGER_H 00002 # define IGUANA_WEB_FRAMEWORK_IG_BROWSER_MANAGER_H 00003 00004 //<<<<<< INCLUDES >>>>>> 00005 00006 # include "Iguana/WebFramework/interface/config.h" 00007 # include "Iguana/Framework/interface/IgStateElement.h" 00008 # include <map> 00009 # include <vector> 00010 # include <string> 00011 00012 //<<<<<< PUBLIC DEFINES >>>>>> 00013 //<<<<<< PUBLIC CONSTANTS >>>>>> 00014 //<<<<<< PUBLIC TYPES >>>>>> 00015 00016 class IgState; 00017 class IgBrowser; 00018 00019 //<<<<<< PUBLIC VARIABLES >>>>>> 00020 //<<<<<< PUBLIC FUNCTIONS >>>>>> 00021 //<<<<<< CLASS DECLARATIONS >>>>>> 00022 00023 class IGUANA_WEB_FRAMEWORK_API IgBrowserManager : public IgStateElement 00024 { 00025 IG_DECLARE_STATE_ELEMENT (IgBrowserManager); 00026 typedef std::map<std::string, IgBrowser *> BrowserMap; 00027 public: 00028 IgBrowserManager (IgState *state); 00029 ~IgBrowserManager (void); 00030 00031 // implicit copy constructor 00032 // implicit assignment operator 00033 // implicit destructor 00034 00035 00039 template <class T> 00040 T* lookup (std::string name = "") 00041 { 00042 BrowserMap::iterator i = m_browsers.find (name); 00043 if (i != m_browsers.end ()) 00044 return dynamic_cast<T *> (i->second); 00045 else 00046 return 0; 00047 } 00048 00049 void add (IgBrowser* browser, std::string name = ""); 00050 private: 00051 typedef std::pair <std::string, IgBrowser *> MapEntry; 00052 00053 IgState * m_state; 00054 BrowserMap m_browsers; 00055 }; 00056 00057 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> 00058 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>> 00059 00060 #endif // IGUANA_WEB_FRAMEWORK_IG_BROWSER_MANAGER_H