![]() |
TrinityCore
|
#include <MapUpdater.h>
Public Member Functions | |
| MapUpdater () | |
| ~MapUpdater () | |
| void | schedule_update (Map &map, uint32 diff) |
| void | wait () |
| void | activate (size_t num_threads) |
| void | deactivate () |
| bool | activated () const |
Private Member Functions | |
| void | update_finished () |
| void | WorkerThread () |
Private Attributes | |
| ProducerConsumerQueue< MapUpdateRequest * > | _queue |
| std::vector< std::thread > | _workerThreads |
| std::atomic< bool > | _cancelationToken |
| std::mutex | _lock |
| std::condition_variable | _condition |
| size_t | pending_requests |
Friends | |
| class | MapUpdateRequest |
Definition at line 31 of file MapUpdater.h.
|
inline |
Definition at line 35 of file MapUpdater.h.
|
inline |
Definition at line 36 of file MapUpdater.h.
| void MapUpdater::activate | ( | size_t | num_threads | ) |
Definition at line 46 of file MapUpdater.cpp.
References _workerThreads, and WorkerThread().
Referenced by MapManager::Initialize().
| bool MapUpdater::activated | ( | ) | const |
Definition at line 80 of file MapUpdater.cpp.
References _workerThreads.
Referenced by MapManager::UnloadAll(), and MapManager::Update().
| void MapUpdater::deactivate | ( | ) |
Definition at line 52 of file MapUpdater.cpp.
References _cancelationToken, _queue, _workerThreads, ProducerConsumerQueue< T >::Cancel(), and wait().
Referenced by MapManager::UnloadAll().
Definition at line 71 of file MapUpdater.cpp.
References _lock, _queue, MapUpdateRequest, pending_requests, and ProducerConsumerQueue< T >::Push().
Referenced by MapManager::Update().
|
private |
Definition at line 85 of file MapUpdater.cpp.
References _condition, _lock, and pending_requests.
Referenced by MapUpdateRequest::call().
| void MapUpdater::wait | ( | ) |
Definition at line 64 of file MapUpdater.cpp.
References _condition, _lock, and pending_requests.
Referenced by deactivate(), and MapManager::Update().
|
private |
Definition at line 94 of file MapUpdater.cpp.
References _cancelationToken, _queue, MapUpdateRequest::call(), CharacterDatabase, HotfixDatabase, LoginDatabase, ProducerConsumerQueue< T >::WaitAndPop(), and WorldDatabase.
Referenced by activate().
|
friend |
Definition at line 38 of file MapUpdater.h.
Referenced by schedule_update().
|
private |
Definition at line 55 of file MapUpdater.h.
Referenced by deactivate(), and WorkerThread().
|
private |
Definition at line 58 of file MapUpdater.h.
Referenced by update_finished(), and wait().
|
private |
Definition at line 57 of file MapUpdater.h.
Referenced by schedule_update(), update_finished(), and wait().
|
private |
Definition at line 52 of file MapUpdater.h.
Referenced by deactivate(), schedule_update(), and WorkerThread().
|
private |
Definition at line 54 of file MapUpdater.h.
Referenced by activate(), activated(), and deactivate().
|
private |
Definition at line 59 of file MapUpdater.h.
Referenced by schedule_update(), update_finished(), and wait().