TrinityCore
MapUpdater Class Reference

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

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
 

Detailed Description

Definition at line 30 of file MapUpdater.h.

Constructor & Destructor Documentation

◆ MapUpdater()

MapUpdater::MapUpdater ( )
inline

Definition at line 34 of file MapUpdater.h.

◆ ~MapUpdater()

MapUpdater::~MapUpdater ( )
inline

Definition at line 35 of file MapUpdater.h.

Member Function Documentation

◆ activate()

void MapUpdater::activate ( size_t  num_threads)

Definition at line 48 of file MapUpdater.cpp.

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

◆ activated()

bool MapUpdater::activated ( )

Definition at line 89 of file MapUpdater.cpp.

+ Here is the caller graph for this function:

◆ deactivate()

void MapUpdater::deactivate ( )

Definition at line 56 of file MapUpdater.cpp.

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

◆ schedule_update()

void MapUpdater::schedule_update ( Map map,
uint32  diff 
)

Definition at line 80 of file MapUpdater.cpp.

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

◆ update_finished()

void MapUpdater::update_finished ( )
private

Definition at line 94 of file MapUpdater.cpp.

+ Here is the caller graph for this function:

◆ wait()

void MapUpdater::wait ( )

Definition at line 70 of file MapUpdater.cpp.

+ Here is the caller graph for this function:

◆ WorkerThread()

void MapUpdater::WorkerThread ( )
private

Definition at line 103 of file MapUpdater.cpp.

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

Friends And Related Function Documentation

◆ MapUpdateRequest

friend class MapUpdateRequest
friend

Definition at line 37 of file MapUpdater.h.

Member Data Documentation

◆ _cancelationToken

std::atomic<bool> MapUpdater::_cancelationToken
private

Definition at line 54 of file MapUpdater.h.

◆ _condition

std::condition_variable MapUpdater::_condition
private

Definition at line 57 of file MapUpdater.h.

◆ _lock

std::mutex MapUpdater::_lock
private

Definition at line 56 of file MapUpdater.h.

◆ _queue

ProducerConsumerQueue<MapUpdateRequest*> MapUpdater::_queue
private

Definition at line 51 of file MapUpdater.h.

◆ _workerThreads

std::vector<std::thread> MapUpdater::_workerThreads
private

Definition at line 53 of file MapUpdater.h.

◆ pending_requests

size_t MapUpdater::pending_requests
private

Definition at line 58 of file MapUpdater.h.


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