+double ActionHeap::top_date() const
+{
+ return top().first;
+}
+void ActionHeap::insert(Action* action, double date, ActionHeap::Type type)
+{
+ action->type_ = type;
+ action->heap_hook_ = emplace(std::make_pair(date, action));
+}
+void ActionHeap::remove(Action* action)
+{
+ action->type_ = ActionHeap::Type::unset;
+ if (action->heap_hook_) {
+ erase(*action->heap_hook_);
+ action->heap_hook_ = boost::none;
+ }
+}
+void ActionHeap::update(Action* action, double date, ActionHeap::Type type)
+{
+ action->type_ = type;
+ if (action->heap_hook_) {
+ heap_type::update(*action->heap_hook_, std::make_pair(date, action));
+ } else {
+ action->heap_hook_ = emplace(std::make_pair(date, action));
+ }
+}
+Action* ActionHeap::pop()
+{
+ Action* action = top().second;
+ heap_type::pop();
+ action->heap_hook_ = boost::none;
+ return action;
+}
+