#include <pqueue.hpp>
Definition at line 53 of file pqueue.hpp.
Public Member Functions | |
virtual bool | contains_index (const I &) const =0 |
virtual bool | is_empty () const |
Returns true if the collection is empty. | |
virtual T & | item (const I &index)=0 |
virtual const T & | item (const I &index) const =0 |
pqueue & | operator= (const pqueue &) |
T & | operator[] (const I &index) |
const T & | operator[] (const I &index) const |
pqueue (const pqueue &) | |
pqueue () | |
virtual | ~pqueue () |
Other Useful Functions | |
virtual void | append (const iterable< T, IBase > &) |
Append all members of a collection to this one. | |
virtual iterator | find_value (const T &) |
virtual const_iterator | find_value (const T &) const |
A generic find function that iterates over the collection to find a particular value. | |
Iterable Implementation | |
virtual void | append (const T &) |
Add an item to the end of the collection. | |
virtual void | insert (const iterator &, const T &) |
Insert an item before the one specified by the iterator. | |
virtual void | remove (const iterator &) |
Remove the item specified by the iterator. | |
Countable Implementation | |
virtual void | clear () |
Clears the contents of the collection. | |
virtual gsgl::index_t | size () const |
A generic count function that iterates over the collection. | |
Indexable Implementation | |
virtual bool | contains_index (const gsgl::index_t &) const |
virtual T & | item (const gsgl::index_t &) |
virtual const T & | item (const gsgl::index_t &) const |
Priority Queue Functionality | |
T & | get_head () |
const T & | get_head () const |
void | pop () |
void | push (const T &, const I &) |
Iterators | |
iterator | iter () |
const_iterator | iter () const |
Private Attributes | |
data::simple_array< I > | priorities |
data::simple_array< T > | values |
pqueue | ( | ) | [inline] |
Definition at line 101 of file pqueue.hpp.
Definition at line 108 of file pqueue.hpp.
~pqueue | ( | ) | [inline, virtual] |
Definition at line 124 of file pqueue.hpp.
void append | ( | const T & | ) | [inline, virtual] |
Add an item to the end of the collection.
Implements iterable.
Definition at line 173 of file pqueue.hpp.
References pqueue::push().
void clear | ( | ) | [inline, virtual] |
Clears the contents of the collection.
Implements countable.
Definition at line 140 of file pqueue.hpp.
References simple_array::clear(), pqueue::priorities, and pqueue::values.
virtual bool contains_index | ( | const I & | ) | const [pure virtual, inherited] |
Implemented in dictionary.
bool contains_index | ( | const gsgl::index_t & | index | ) | const [inline, virtual] |
iterable< T, IBase >::const_iterator find_value | ( | const T & | item | ) | const [inline, virtual, inherited] |
A generic find function that iterates over the collection to find a particular value.
Definition at line 153 of file iterable.hpp.
References iterable::const_iterator::is_valid().
Referenced by gsgl::data::global_unregister_resource_aux().
T & get_head | ( | ) | [inline] |
const T & get_head | ( | ) | const [inline] |
void insert | ( | const iterator & | , | |
const T & | ||||
) | [inline, virtual] |
Insert an item before the one specified by the iterator.
Implements iterable.
Definition at line 180 of file pqueue.hpp.
References pqueue::priorities, and pqueue::push().
virtual bool is_empty | ( | ) | const [inline, virtual, inherited] |
Returns true if the collection is empty.
Definition at line 59 of file countable.hpp.
Referenced by application::application(), broker_creator::broker_creator(), config_variable< gsgl::platform::color >::config_variable(), file::file(), font_impl::font_impl(), config_record::from_stream(), application::get_config_overrides(), node::get_name(), brokered_object::get_type_name(), event_map::load_keyboard_events(), application::load_scenery(), model_part::model_part(), package::package(), physics_frame::physics_frame(), solar_system::solar_system(), stellar_db::stellar_db(), and vehicle::vehicle().
virtual T& item | ( | const I & | index | ) | [pure virtual, inherited] |
Implemented in dictionary.
virtual const T& item | ( | const I & | index | ) | const [pure virtual, inherited] |
Implemented in dictionary.
Referenced by indexable< gsgl::data::log_target *, unsigned int >::operator[]().
T & item | ( | const gsgl::index_t & | index | ) | [inline, virtual] |
const T & item | ( | const gsgl::index_t & | index | ) | const [inline, virtual] |
iterator iter | ( | ) | [inline, inherited] |
Definition at line 101 of file iterable.hpp.
const_iterator iter | ( | ) | const [inline, inherited] |
Definition at line 100 of file iterable.hpp.
Referenced by config_variable::assign_from_string(), treebox::clear_tree_nodes(), keplerian_element_propagator::get_array(), config_record::get_child(), satellite_element_propagator::get_elements(), application::load_scenery(), list::operator==(), dictionary::operator==(), config_record::override_with(), vector::parse(), transform::parse(), application::remove_viewpoint_nodes(), config_record::to_stream(), vector::vector(), application::~application(), and cache::~cache().
T& operator[] | ( | const I & | index | ) | [inline, inherited] |
Definition at line 58 of file indexable.hpp.
const T& operator[] | ( | const I & | index | ) | const [inline, inherited] |
Definition at line 57 of file indexable.hpp.
void pop | ( | ) | [inline] |
Definition at line 237 of file pqueue.hpp.
References pqueue::priorities, simple_array::remove(), and pqueue::values.
void push | ( | const T & | item, | |
const I & | priority | |||
) | [inline] |
Definition at line 223 of file pqueue.hpp.
References simple_array::insert(), pqueue::priorities, and pqueue::values.
Referenced by pqueue::append(), and pqueue::insert().
void remove | ( | const iterator & | ) | [inline, virtual] |
Remove the item specified by the iterator.
Implements iterable.
Definition at line 187 of file pqueue.hpp.
References pqueue::priorities, simple_array::remove(), and pqueue::values.
gsgl::index_t size | ( | ) | const [inline, virtual] |
A generic count function that iterates over the collection.
Reimplemented from iterable.
Definition at line 132 of file pqueue.hpp.
References assert, pqueue::priorities, simple_array::size(), and pqueue::values.
data::simple_array<I> priorities [private] |
Definition at line 59 of file pqueue.hpp.
Referenced by pqueue::clear(), pqueue::insert(), pqueue::operator=(), pqueue::pop(), pqueue::push(), pqueue::remove(), and pqueue::size().
data::simple_array<T> values [private] |
Definition at line 58 of file pqueue.hpp.
Referenced by pqueue::clear(), pqueue::contains_index(), pqueue::get_head(), pqueue::item(), pqueue::operator=(), pqueue::pop(), pqueue::push(), pqueue::remove(), and pqueue::size().