TrinityCore
Loading...
Searching...
No Matches
ScriptReloadMgr.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef SCRIPT_RELOADER_H
19#define SCRIPT_RELOADER_H
20
21#include <memory>
22#include <string>
23#include "Define.h"
24#include <boost/filesystem/path.hpp>
25
35{
36public:
37 virtual ~ModuleReference() { }
38
40 virtual char const* GetScriptModuleRevisionHash() const = 0;
42 virtual char const* GetScriptModule() const = 0;
44 virtual boost::filesystem::path const& GetModulePath() const = 0;
45};
46
53{
54protected:
56
57public:
58 virtual ~ScriptReloadMgr() { }
59
61 virtual void Initialize() { }
62
66 virtual void Update() { }
67
69 virtual void Unload() { }
70
72 static std::shared_ptr<ModuleReference> AcquireModuleReferenceOfContext(
73 std::string const& context);
74
76 static ScriptReloadMgr* instance();
77};
78
79#define sScriptReloadMgr ScriptReloadMgr::instance()
80
81#endif // SCRIPT_RELOADER_H
#define TC_GAME_API
Definition Define.h:114
virtual char const * GetScriptModule() const =0
Returns the name of the referenced script module.
virtual ~ModuleReference()
virtual boost::filesystem::path const & GetModulePath() const =0
Returns the path to the script module.
virtual char const * GetScriptModuleRevisionHash() const =0
Returns the git revision hash of the referenced script module.
virtual void Unload()
Unloads the ScriptReloadMgr.
virtual void Initialize()
Initializes the ScriptReloadMgr.
virtual void Update()
virtual ~ScriptReloadMgr()