![]() |
TrinityCore
|
#include <DatabaseLoader.h>
Public Types | |
| enum | DatabaseTypeFlags { DATABASE_NONE = 0 , DATABASE_LOGIN = 1 , DATABASE_CHARACTER = 2 , DATABASE_WORLD = 4 , DATABASE_HOTFIX = 8 , DATABASE_MASK_ALL = DATABASE_LOGIN | DATABASE_CHARACTER | DATABASE_WORLD | DATABASE_HOTFIX } |
Public Member Functions | |
| DatabaseLoader (std::string const &logger, uint32 const defaultUpdateMask) | |
| template<class T > | |
| DatabaseLoader & | AddDatabase (DatabaseWorkerPool< T > &pool, std::string const &name) |
| bool | Load () |
Private Types | |
| using | Predicate = std::function< bool()> |
| using | Closer = std::function< void()> |
Private Member Functions | |
| bool | OpenDatabases () |
| bool | PopulateDatabases () |
| bool | UpdateDatabases () |
| bool | PrepareStatements () |
| bool | Process (std::queue< Predicate > &queue) |
Private Attributes | |
| std::string const | _logger |
| bool const | _autoSetup |
| uint32 const | _updateFlags |
| std::queue< Predicate > | _open |
| std::queue< Predicate > | _populate |
| std::queue< Predicate > | _update |
| std::queue< Predicate > | _prepare |
| std::stack< Closer > | _close |
Definition at line 33 of file DatabaseLoader.h.
|
private |
Definition at line 64 of file DatabaseLoader.h.
|
private |
Definition at line 63 of file DatabaseLoader.h.
| Enumerator | |
|---|---|
| DATABASE_NONE | |
| DATABASE_LOGIN | |
| DATABASE_CHARACTER | |
| DATABASE_WORLD | |
| DATABASE_HOTFIX | |
| DATABASE_MASK_ALL | |
Definition at line 45 of file DatabaseLoader.h.
| DatabaseLoader::DatabaseLoader | ( | std::string const & | logger, |
| uint32 const | defaultUpdateMask | ||
| ) |
Definition at line 26 of file DatabaseLoader.cpp.
| template TC_DATABASE_API DatabaseLoader & DatabaseLoader::AddDatabase< HotfixDatabaseConnection > | ( | DatabaseWorkerPool< T > & | pool, |
| std::string const & | name | ||
| ) |
Definition at line 33 of file DatabaseLoader.cpp.
References _autoSetup, _close, _logger, _open, _populate, _prepare, _update, _updateFlags, DatabaseWorkerPool< T >::Close(), DBUpdater< T >::IsEnabled(), DatabaseWorkerPool< T >::Open(), DatabaseWorkerPool< T >::PrepareStatements(), sConfigMgr, DatabaseWorkerPool< T >::SetConnectionInfo(), and TC_LOG_ERROR.
Referenced by StartDB().
| bool DatabaseLoader::Load | ( | ) |
Definition at line 121 of file DatabaseLoader.cpp.
References _updateFlags, OpenDatabases(), PopulateDatabases(), PrepareStatements(), TC_LOG_INFO, and UpdateDatabases().
Referenced by StartDB().
|
private |
Definition at line 141 of file DatabaseLoader.cpp.
References _open, and Process.
Referenced by Load().
|
private |
Definition at line 146 of file DatabaseLoader.cpp.
References _populate, and Process.
Referenced by Load().
|
private |
Definition at line 156 of file DatabaseLoader.cpp.
References _prepare, and Process.
Referenced by Load().
|
private |
Definition at line 161 of file DatabaseLoader.cpp.
References _close.
|
private |
Definition at line 151 of file DatabaseLoader.cpp.
References _update, and Process.
Referenced by Load().
|
private |
Definition at line 71 of file DatabaseLoader.h.
Referenced by AddDatabase().
|
private |
Definition at line 75 of file DatabaseLoader.h.
Referenced by AddDatabase(), and Process().
|
private |
Definition at line 70 of file DatabaseLoader.h.
Referenced by AddDatabase().
|
private |
Definition at line 74 of file DatabaseLoader.h.
Referenced by AddDatabase(), and OpenDatabases().
|
private |
Definition at line 74 of file DatabaseLoader.h.
Referenced by AddDatabase(), and PopulateDatabases().
|
private |
Definition at line 74 of file DatabaseLoader.h.
Referenced by AddDatabase(), and PrepareStatements().
|
private |
Definition at line 74 of file DatabaseLoader.h.
Referenced by AddDatabase(), and UpdateDatabases().
|
private |
Definition at line 72 of file DatabaseLoader.h.
Referenced by AddDatabase(), and Load().