RoveComm C++ 3.0.0
Welcome to the RoveComm C++ repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of RoveComm C++. The RoveComm C++ project is the RoveComm interface for high level systems and should not be used for microcontrollers.
Loading...
Searching...
No Matches
BS::pr_task Struct Reference

A helper struct to store a task with an assigned priority. More...

#include <BS_thread_pool.hpp>

Collaboration diagram for BS::pr_task:

Public Member Functions

 pr_task (task_t &&task_, const priority_t priority_=0) noexcept(std::is_nothrow_move_constructible_v< task_t >)
 Construct a new task with an assigned priority.

Public Attributes

task_t task
 The task. It is mutable so it can be moved out of the const reference returned by std::priority_queue::top().
priority_t priority = 0
 The priority of the task.

Friends

bool operator< (const pr_task &lhs, const pr_task &rhs) noexcept
 Compare the priority of two tasks.

Detailed Description

A helper struct to store a task with an assigned priority.

Constructor & Destructor Documentation

◆ pr_task()

BS::pr_task::pr_task ( task_t && task_,
const priority_t priority_ = 0 )
inlineexplicitnoexcept

Construct a new task with an assigned priority.

Parameters
task_The task.
priority_The desired priority.
417: task(std::move(task_)), priority(priority_) {}
task_t task
The task. It is mutable so it can be moved out of the const reference returned by std::priority_queue...
Definition BS_thread_pool.hpp:434
priority_t priority
The priority of the task.
Definition BS_thread_pool.hpp:439
Here is the caller graph for this function:

◆ operator<

bool operator< ( const pr_task & lhs,
const pr_task & rhs )
friend

Compare the priority of two tasks.

Parameters
lhsThe first task.
rhsThe second task.
Returns
true if the first task has a lower priority than the second task, false otherwise.
427 {
428 return lhs.priority < rhs.priority;
429 }

Member Data Documentation

◆ priority

priority_t BS::pr_task::priority = 0

The priority of the task.

◆ task

task_t BS::pr_task::task
mutable

The task. It is mutable so it can be moved out of the const reference returned by std::priority_queue::top().


The documentation for this struct was generated from the following file: