00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : SystemManager 00006 * Package : Zeus.ZeusBase.MOM 00007 * Author : Benjamin Hadorn 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 #ifndef SystemManagerH 00033 #define SystemManagerH 00034 00035 #include <zeusbase/MOM/Interfaces/IModule.hpp> 00036 #include <zeusbase/System/XObjectFactory.h> 00037 #include <zeusbase/System/XRootObject.h> 00038 00039 BEGIN_NAMESPACE_Zeus 00040 00041 class TZeusAPI; 00042 00043 /***************************************************************************/ 00048 /***************************************************************************/ 00049 zeusbase_class TSystemManager : public TXRootObject, public IModule 00050 { 00051 public: 00052 TSystemManager(IXMLNode& rNode, NAMESPACE_Zeus::IXMLDocument& rDocu); 00053 00054 //Methods of IModule 00055 virtual Uint MQUALIFIER getMode() const; 00056 virtual void MQUALIFIER activate(); 00057 virtual void MQUALIFIER deactivate(); 00058 virtual bool MQUALIFIER isActive(bool bGlobaly = false) const; 00059 virtual Retval MQUALIFIER getZeusAPI(IZeusAPI*& rpApi); 00060 virtual Retval MQUALIFIER getModule(const IString& rName, IModule*& rpModule); 00061 virtual void MQUALIFIER getName(IString& rName) const; 00062 virtual Retval MQUALIFIER registerActiveModule(IModule& rModule); 00063 virtual Retval MQUALIFIER unregisterActiveModule(IModule& rModule); 00064 virtual Retval MQUALIFIER getActiveModule(IModule*& rpModule); 00065 virtual Retval MQUALIFIER getModuleSession(IModuleSession*& rpSession); 00066 virtual void MQUALIFIER getModuleSessionLibrary(IString& rName)const { rName.assign(L""); } 00067 00068 //Methods of IXObject 00069 virtual bool MQUALIFIER freeze(); 00070 virtual bool MQUALIFIER unfreeze(); 00071 00072 //Methods of IZUnknown 00073 MEMORY_MANAGER_DECL 00074 00075 protected: 00076 REG_ROOT_BEGIN(TSystemManager) 00077 REG_ROOT_ADD(TSystemManager, L"TSystemManager"); 00078 REG_ROOT_END 00079 00080 virtual ~TSystemManager(); 00081 00082 private: 00084 IModule* m_pActiveModule; 00085 00086 void activateFirstChild(); 00087 }; 00088 00089 //INLINE METHODS 00090 /***************************************************************************/ 00093 /***************************************************************************/ 00094 inline void MQUALIFIER TSystemManager::deactivate() 00095 {} 00096 00097 00098 /***************************************************************************/ 00101 /***************************************************************************/ 00102 inline bool MQUALIFIER TSystemManager::isActive(bool /*bGlobaly = false*/) const 00103 { 00104 return true; 00105 } 00106 00107 /***************************************************************************/ 00110 /***************************************************************************/ 00111 inline Retval MQUALIFIER TSystemManager::getZeusAPI(IZeusAPI*& /*rpApi*/) 00112 { 00113 return RET_REQUEST_FAILED; 00114 } 00115 00116 00117 /***************************************************************************/ 00120 /***************************************************************************/ 00121 inline void MQUALIFIER TSystemManager::getName(IString& rName) const 00122 { 00123 TXObject::getName(rName); 00124 } 00125 00126 /***************************************************************************/ 00129 /***************************************************************************/ 00130 inline Retval MQUALIFIER TSystemManager::getModuleSession(IModuleSession*& /*rpSession*/) 00131 { 00132 return RET_REQUEST_FAILED; 00133 } 00134 00135 00136 END_NAMESPACE_Zeus 00137 #endif 00138