TrinityCore
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 "Define.h"
22#include <memory>
23#include <string>
24
25namespace boost::filesystem
26{
27class path;
28}
29
39{
40public:
41 virtual ~ModuleReference() { }
42
44 virtual char const* GetScriptModuleRevisionHash() const = 0;
46 virtual char const* GetScriptModule() const = 0;
48 virtual boost::filesystem::path const& GetModulePath() const = 0;
49};
50
57{
58protected:
60
61public:
62 virtual ~ScriptReloadMgr() { }
63
65 virtual void Initialize() { }
66
70 virtual void Update() { }
71
73 virtual void Unload() { }
74
76 static std::shared_ptr<ModuleReference> AcquireModuleReferenceOfContext(
77 std::string const& context);
78
80 static ScriptReloadMgr* instance();
81};
82
83#define sScriptReloadMgr ScriptReloadMgr::instance()
84
85#endif // SCRIPT_RELOADER_H
#define TC_GAME_API
Definition: Define.h:123
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()