mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(queue): add TSPriorityQueue and TSTimerPriority
This commit is contained in:
parent
2200aab4c2
commit
2e82693829
9 changed files with 264 additions and 0 deletions
16
storm/queue/TSTimerPriority.hpp
Normal file
16
storm/queue/TSTimerPriority.hpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include "storm/queue/CSBasePriority.hpp"
|
||||
|
||||
template <class T>
|
||||
class TSTimerPriority : public CSBasePriority {
|
||||
public:
|
||||
// Member variables
|
||||
T m_val;
|
||||
|
||||
// Member functions
|
||||
virtual bool Compare(CSBasePriority* a);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
bool TSTimerPriority<T>::Compare(CSBasePriority* a) {
|
||||
return this->m_val - static_cast<TSTimerPriority<T>*>(a)->m_val <= 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue