-bool Action::isSuspended()
-{
- return suspended_ == SuspendStates::suspended;
-}
-/* insert action on heap using a given key and a hat (heap_action_type)
- * a hat can be of three types for communications:
- *
- * NORMAL = this is a normal heap entry stating the date to finish transmitting
- * LATENCY = this is a heap entry to warn us when the latency is payed
- * MAX_DURATION =this is a heap entry to warn us when the max_duration limit is reached
- */
-void Action::heapInsert(heap_type& heap, double key, Action::Type hat)
-{
- type_ = hat;
- heap_handle_ = heap.emplace(std::make_pair(key, this));
-}
-
-void Action::heapRemove(heap_type& heap)
-{
- type_ = Action::Type::NOTSET;
- if (heap_handle_) {
- heap.erase(*heap_handle_);
- clearHeapHandle();
- }
-}
-
-void Action::heapUpdate(heap_type& heap, double key, Action::Type hat)
-{
- type_ = hat;
- if (heap_handle_) {
- heap.update(*heap_handle_, std::make_pair(key, this));
- } else {
- heap_handle_ = heap.emplace(std::make_pair(key, this));
- }
-}
-