Horizon Official Technical Documentation
TaskScheduler::TaskQueue Class Reference

Public Member Functions

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

Private Attributes

std::multiset< TaskContainer, Comparecontainer
 

Member Function Documentation

◆ Clear()

void TaskScheduler::TaskQueue::Clear ( )
136{
137 container.clear();
138}
std::multiset< TaskContainer, Compare > container
Definition: TaskScheduler.hpp:178

Referenced by TaskScheduler::CancelAll().

+ Here is the caller graph for this function:

◆ Count()

std::size_t TaskScheduler::TaskQueue::Count ( group_t const &  group)
141{
142 std::size_t count = 0;
143
144 for (std::multiset<TaskContainer, Compare>::iterator it = container.begin();
145 it != container.end(); it++) {
146 if ((*it)->IsInGroup(group))
147 count++;
148 }
149
150 return count;
151}
size_t count(GridTypeListContainer< SPECIFIC_TYPE > const &elements, SPECIFIC_TYPE *)
Definition: GridReferenceContainer.hpp:100

References GridTypeListIterator::count().

Referenced by TaskScheduler::Count().

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

◆ First()

auto TaskScheduler::TaskQueue::First ( ) const
131{
132 return *container.begin();
133}

Referenced by TaskScheduler::Dispatch().

+ Here is the caller graph for this function:

◆ IsEmpty()

bool TaskScheduler::TaskQueue::IsEmpty ( ) const
178{
179 return container.empty();
180}

Referenced by TaskScheduler::Dispatch().

+ Here is the caller graph for this function:

◆ ModifyIf()

void TaskScheduler::TaskQueue::ModifyIf ( std::function< bool(TaskContainer const &)> const &  filter)
163{
164 std::vector<TaskContainer> cache;
165 for (auto itr = container.begin(); itr != container.end();)
166 if (filter(*itr))
167 {
168 cache.push_back(*itr);
169 itr = container.erase(itr);
170 }
171 else
172 ++itr;
173
174 container.insert(cache.begin(), cache.end());
175}

Referenced by TaskScheduler::DelayAll(), TaskScheduler::DelayGroup(), and TaskScheduler::RescheduleAtWithPredicate().

+ Here is the caller graph for this function:

◆ Pop()

auto TaskScheduler::TaskQueue::Pop ( )

Pops the task out of the container.

123{
124 TaskContainer result = *container.begin();
125 container.erase(container.begin());
126 return result;
127}
std::shared_ptr< Task > TaskContainer
Definition: TaskScheduler.hpp:165

Referenced by TaskScheduler::Dispatch().

+ Here is the caller graph for this function:

◆ Push()

void TaskScheduler::TaskQueue::Push ( TaskContainer &&  task)
117{
118 container.insert(task);
119}

References container.

Referenced by TaskScheduler::InsertTask().

+ Here is the caller graph for this function:

◆ RemoveIf()

void TaskScheduler::TaskQueue::RemoveIf ( std::function< bool(TaskContainer const &)> const &  filter)
154{
155 for (auto itr = container.begin(); itr != container.end();)
156 if (filter(*itr))
157 itr = container.erase(itr);
158 else
159 ++itr;
160}

Referenced by TaskScheduler::CancelGroup().

+ Here is the caller graph for this function:

Member Data Documentation

◆ container

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

Referenced by Push().


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