TrinityCore
DatabaseLoader Class Reference

#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 >
DatabaseLoaderAddDatabase (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
 

Detailed Description

Definition at line 33 of file DatabaseLoader.h.

Member Typedef Documentation

◆ Closer

using DatabaseLoader::Closer = std::function<void()>
private

Definition at line 64 of file DatabaseLoader.h.

◆ Predicate

using DatabaseLoader::Predicate = std::function<bool()>
private

Definition at line 63 of file DatabaseLoader.h.

Member Enumeration Documentation

◆ DatabaseTypeFlags

Enumerator
DATABASE_NONE 
DATABASE_LOGIN 
DATABASE_CHARACTER 
DATABASE_WORLD 
DATABASE_HOTFIX 
DATABASE_MASK_ALL 

Definition at line 45 of file DatabaseLoader.h.

Constructor & Destructor Documentation

◆ DatabaseLoader()

DatabaseLoader::DatabaseLoader ( std::string const &  logger,
uint32 const  defaultUpdateMask 
)

Definition at line 26 of file DatabaseLoader.cpp.

Member Function Documentation

◆ AddDatabase()

template<class T >
template TC_DATABASE_API DatabaseLoader & DatabaseLoader::AddDatabase< HotfixDatabaseConnection > ( DatabaseWorkerPool< T > &  pool,
std::string const &  name 
)

Definition at line 33 of file DatabaseLoader.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Load()

bool DatabaseLoader::Load ( )

Definition at line 121 of file DatabaseLoader.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OpenDatabases()

bool DatabaseLoader::OpenDatabases ( )
private

Definition at line 141 of file DatabaseLoader.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PopulateDatabases()

bool DatabaseLoader::PopulateDatabases ( )
private

Definition at line 146 of file DatabaseLoader.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrepareStatements()

bool DatabaseLoader::PrepareStatements ( )
private

Definition at line 156 of file DatabaseLoader.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Process()

bool DatabaseLoader::Process ( std::queue< Predicate > &  queue)
private

Definition at line 161 of file DatabaseLoader.cpp.

+ Here is the caller graph for this function:

◆ UpdateDatabases()

bool DatabaseLoader::UpdateDatabases ( )
private

Definition at line 151 of file DatabaseLoader.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _autoSetup

bool const DatabaseLoader::_autoSetup
private

Definition at line 71 of file DatabaseLoader.h.

◆ _close

std::stack<Closer> DatabaseLoader::_close
private

Definition at line 75 of file DatabaseLoader.h.

◆ _logger

std::string const DatabaseLoader::_logger
private

Definition at line 70 of file DatabaseLoader.h.

◆ _open

std::queue<Predicate> DatabaseLoader::_open
private

Definition at line 74 of file DatabaseLoader.h.

◆ _populate

std::queue<Predicate> DatabaseLoader::_populate
private

Definition at line 74 of file DatabaseLoader.h.

◆ _prepare

std::queue<Predicate> DatabaseLoader::_prepare
private

Definition at line 74 of file DatabaseLoader.h.

◆ _update

std::queue<Predicate> DatabaseLoader::_update
private

Definition at line 74 of file DatabaseLoader.h.

◆ _updateFlags

uint32 const DatabaseLoader::_updateFlags
private

Definition at line 72 of file DatabaseLoader.h.


The documentation for this class was generated from the following files: