Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / server / src / gameplay_module_lib / module_proxy.h
blob659b91334506a8b7bde09b0549fc9bb8b501458b
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef RY_MODULE_PROXY_H
18 #define RY_MODULE_PROXY_H
20 #include "nel/misc/types_nl.h"
21 #include "nel/misc/smart_ptr.h"
24 class IModuleCore;
26 /**
27 * A proxy to a module core. Usulful to abstract the core completly
28 * If you dont have a module but need a proxy ( e.g. : just before creating the module), build it with IModuleProxy( IModuleCore * core)
29 * Otherwise, use the getProxy method of your module, and inside a module method
30 * \author Nicolas Brigand
31 * \author Nevrax France
32 * \date 2004
34 template <class T>
35 class IModuleProxy
37 public:
38 /// ctor ( needed by the module class )
39 IModuleProxy(){}
40 /// ctor to use if you are not in a module ( CAUTION : the only real case is when you have to interact with a core before creating the module )
41 IModuleProxy( IModuleCore * core)
43 _ModuleCore = dynamic_cast<T*>(core);
44 MODULE_AST(_ModuleCore);
47 protected:
48 NLMISC::CRefPtr<T> _ModuleCore;
52 #endif // RY_MODULE_PROXY_H
54 /* End of module_proxy.h */