![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <id_set_queue.h>
Public Member Functions | |
| void | clear () |
| Removes all elements from the queue. | |
| bool | contains (unsigned id) const |
| Checks whether an ID is in the queue. | |
| bool | empty () const |
| Checks whether the queue contains any element. | |
| unsigned | id_count () const |
| IDSetMinQueue () | |
| IDSetMinQueue (unsigned n) | |
| The queue may contain IDs from 0 to n-1. | |
| unsigned | peek () const |
| unsigned | pop () |
| void | push (unsigned id) |
Static Private Member Functions | |
| static unsigned | is_larger_child (unsigned x) |
| True if other_child(x) < x. Only works if x != root. | |
| static unsigned | is_smaller_child (unsigned x) |
| True if other_child(x) > x. Only works if x != root. | |
| static unsigned | larger_child (unsigned x) |
| Returns the node y such that parent(y) == x and y > other_child(y). | |
| static unsigned | other_child (unsigned x) |
| Maps a node onto its sibling. Only works if x != root. | |
| static unsigned | parent (unsigned x) |
| Maps a node onto its parent. Only works if x != root. | |
| static unsigned | smaller_child (unsigned x) |
| Returns the node y such that parent(y) == x and y < other_child(y). | |
| static unsigned | smallest_two_power_no_smaller_than (unsigned x) |
Private Attributes | |
| std::vector< bool > | data |
| unsigned | max_number_of_ids |
| unsigned | min_id |
| unsigned | offset |
Static Private Attributes | |
| static const unsigned | root = 1 |
This is min queue that can only contain IDs from a given range. IDs are compared by their value. Ids in the queue cannot be duplicated.
Definition at line 14 of file id_set_queue.h.
|
inline |
Definition at line 108 of file id_set_queue.h.
|
inlineexplicit |
The queue may contain IDs from 0 to n-1.
Definition at line 111 of file id_set_queue.h.
|
inline |
Removes all elements from the queue.
Definition at line 218 of file id_set_queue.h.
References empty(), and pop().
Referenced by RoutingKit::CustomizableContractionHierarchyPartialCustomization::reset(), and RoutingKit::CustomizableContractionHierarchyPartialCustomization::reset().
|
inline |
Checks whether an ID is in the queue.
Definition at line 153 of file id_set_queue.h.
References data, id_count(), and offset.
|
inline |
Checks whether the queue contains any element.
Definition at line 159 of file id_set_queue.h.
References RoutingKit::invalid_id, and min_id.
Referenced by clear(), RoutingKit::CustomizableContractionHierarchyPartialCustomization::customize(), and pop().
|
inline |
Definition at line 118 of file id_set_queue.h.
References max_number_of_ids.
Referenced by contains(), push(), and RoutingKit::CustomizableContractionHierarchyPartialCustomization::reset().
|
inlinestaticprivate |
True if other_child(x) < x. Only works if x != root.
Definition at line 79 of file id_set_queue.h.
Referenced by is_smaller_child().
|
inlinestaticprivate |
True if other_child(x) > x. Only works if x != root.
Definition at line 84 of file id_set_queue.h.
References is_larger_child().
Referenced by pop().
|
inlinestaticprivate |
Returns the node y such that parent(y) == x and y > other_child(y).
Definition at line 94 of file id_set_queue.h.
|
inlinestaticprivate |
Maps a node onto its sibling. Only works if x != root.
Definition at line 74 of file id_set_queue.h.
Referenced by pop().
|
inlinestaticprivate |
Maps a node onto its parent. Only works if x != root.
Definition at line 69 of file id_set_queue.h.
Referenced by pop(), and push().
|
inline |
Returns the smallest ID in the queue without removing it. Returns invalid_id if the queue is empty.
Definition at line 165 of file id_set_queue.h.
References min_id.
|
inline |
Returns the smallest ID in the queue and removes it. Returns invalid_id if the queue is empty.
Definition at line 171 of file id_set_queue.h.
References data, empty(), RoutingKit::invalid_id, is_smaller_child(), min_id, offset, other_child(), parent(), root, and smaller_child().
Referenced by clear(), and RoutingKit::CustomizableContractionHierarchyPartialCustomization::customize().
|
inline |
Adds an ID to the queue. If the ID is already in the queue, then nothing happens.
Definition at line 124 of file id_set_queue.h.
References data, id_count(), RoutingKit::invalid_id, min_id, RoutingKit::min_to(), offset, parent(), and root.
Referenced by RoutingKit::CustomizableContractionHierarchyPartialCustomization::customize(), and RoutingKit::CustomizableContractionHierarchyPartialCustomization::update_arc().
|
inlinestaticprivate |
Returns the node y such that parent(y) == x and y < other_child(y).
Definition at line 89 of file id_set_queue.h.
Referenced by pop().
|
inlinestaticprivate |
Definition at line 98 of file id_set_queue.h.
|
private |
Definition at line 228 of file id_set_queue.h.
Referenced by contains(), pop(), and push().
|
private |
Definition at line 225 of file id_set_queue.h.
Referenced by id_count().
|
private |
|
private |
Definition at line 227 of file id_set_queue.h.
Referenced by contains(), pop(), and push().
|
staticprivate |
Definition at line 66 of file id_set_queue.h.