TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TaskScheduler::TaskQueue Class Reference

Public Member Functions

void Push (TaskContainer &&task)
 
TaskContainer Pop ()
 Pops the task out of the container. More...
 
TaskContainer constFirst () const
 
void Clear ()
 
void RemoveIf (std::function< bool(TaskContainer const &)> const &filter)
 
void ModifyIf (std::function< bool(TaskContainer const &)> const &filter)
 
bool IsEmpty () const
 

Private Attributes

std::multiset< TaskContainer,
Compare
container
 

Member Function Documentation

void TaskScheduler::TaskQueue::Clear ( )
131 {
132  container.clear();
133 }
std::multiset< TaskContainer, Compare > container
Definition: TaskScheduler.h:136

+ Here is the caller graph for this function:

auto TaskScheduler::TaskQueue::First ( ) const
126 {
127  return *container.begin();
128 }
std::multiset< TaskContainer, Compare > container
Definition: TaskScheduler.h:136

+ Here is the caller graph for this function:

bool TaskScheduler::TaskQueue::IsEmpty ( ) const
160 {
161  return container.empty();
162 }
std::multiset< TaskContainer, Compare > container
Definition: TaskScheduler.h:136

+ Here is the caller graph for this function:

void TaskScheduler::TaskQueue::ModifyIf ( std::function< bool(TaskContainer const &)> const filter)
145 {
146  std::vector<TaskContainer> cache;
147  for (auto itr = container.begin(); itr != container.end();)
148  if (filter(*itr))
149  {
150  cache.push_back(*itr);
151  itr = container.erase(itr);
152  }
153  else
154  ++itr;
155 
156  container.insert(cache.begin(), cache.end());
157 }
std::multiset< TaskContainer, Compare > container
Definition: TaskScheduler.h:136

+ Here is the caller graph for this function:

auto TaskScheduler::TaskQueue::Pop ( )

Pops the task out of the container.

119 {
120  TaskContainer result = *container.begin();
121  container.erase(container.begin());
122  return result;
123 }
std::multiset< TaskContainer, Compare > container
Definition: TaskScheduler.h:136
std::shared_ptr< Task > TaskContainer
Definition: TaskScheduler.h:123

+ Here is the caller graph for this function:

void TaskScheduler::TaskQueue::Push ( TaskContainer &&  task)
114 {
115  container.insert(task);
116 }
std::multiset< TaskContainer, Compare > container
Definition: TaskScheduler.h:136

+ Here is the caller graph for this function:

void TaskScheduler::TaskQueue::RemoveIf ( std::function< bool(TaskContainer const &)> const filter)
136 {
137  for (auto itr = container.begin(); itr != container.end();)
138  if (filter(*itr))
139  itr = container.erase(itr);
140  else
141  ++itr;
142 }
std::multiset< TaskContainer, Compare > container
Definition: TaskScheduler.h:136

+ Here is the caller graph for this function:

Member Data Documentation

std::multiset<TaskContainer, Compare> TaskScheduler::TaskQueue::container
private

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