distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
ThreadList.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_THREADLIST_HPP_
13 #define INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_THREADLIST_HPP_
14 
16 
18 
19 namespace distortos
20 {
21 
22 namespace internal
23 {
24 
25 class ThreadControlBlock;
26 
29 {
35  {
36 
37  }
38 
48  bool operator()(const ThreadListNode& left, const ThreadListNode& right) const
49  {
50  return left.getEffectivePriority() < right.getEffectivePriority();
51  }
52 };
53 
55 class ThreadList : public estd::SortedIntrusiveList<ThreadDescendingEffectivePriority, ThreadListNode,
56  &ThreadListNode::threadListNode, ThreadControlBlock>
57 {
58 public:
59 
64  constexpr ThreadList() :
66  {
67 
68  }
69 };
70 
71 } // namespace internal
72 
73 } // namespace distortos
74 
75 #endif // INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_THREADLIST_HPP_
constexpr ThreadDescendingEffectivePriority()
ThreadDescendingEffectivePriority's constructor.
Definition: ThreadList.hpp:34
constexpr ThreadList()
ThreadList's constructor.
Definition: ThreadList.hpp:64
bool operator()(const ThreadListNode &left, const ThreadListNode &right) const
ThreadDescendingEffectivePriority's function call operator.
Definition: ThreadList.hpp:48
functor which gives descending effective priority order of elements on the list
Definition: ThreadList.hpp:28
uint8_t getEffectivePriority() const
Definition: ThreadListNode.hpp:53
ThreadListNode class header.
SortedIntrusiveList class is an IntrusiveList with sorted elements.
Definition: SortedIntrusiveList.hpp:40
Top-level namespace of distortos project.
Definition: buttons.hpp:33
SortedIntrusiveList template class header.
sorted intrusive list of threads (thread control blocks)
Definition: ThreadList.hpp:55
constexpr SortedIntrusiveList(const ThreadDescendingEffectivePriority &compare=ThreadDescendingEffectivePriority {})
SortedIntrusiveList's constructor.
Definition: SortedIntrusiveList.hpp:80
ThreadListNode class is a base for ThreadControlBlock that provides nodes for intrusive lists.
Definition: ThreadListNode.hpp:30