#include <list.hpp>
This class is optimized for fast iteration, insertion and deletion.
Definition at line 56 of file list.hpp.
Public Member Functions | |
virtual bool | contains_index (const I &) const =0 |
T & | get_head () |
const T & | get_head () const |
T & | get_tail () |
const T & | get_tail () const |
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 |
list (const list &) | |
list () | |
list & | operator= (const list &) |
bool | operator== (const list &) const |
T & | operator[] (const I &index) |
const T & | operator[] (const I &index) const |
virtual | ~list () |
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 | |
Adds a data item to the end of the list. | |
virtual void | append (const T &) |
Add an item to the end of the collection. | |
virtual void | insert (const iterator &, const T &) |
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 |
Iterators | |
iterator | iter () |
const_iterator | iter () const |
Protected Attributes | |
gsgl::index_t | count |
list_node * | head |
list_node * | tail |
Classes | |
struct | list_node |
Definition at line 124 of file list.hpp.
References list::append(), list::head, and list::list_node::next.
~list | ( | ) | [inline, virtual] |
void append | ( | const T & | ) | [inline, virtual] |
Add an item to the end of the collection.
Implements iterable.
Definition at line 270 of file list.hpp.
References list::count, list::head, list::list_node::next, and list::tail.
Referenced by application::application(), gsgl::data::global_register_resource_aux(), list::insert(), list::list(), application::load_scenery(), list::operator=(), application::remove_viewpoint_nodes(), and string::split().
void clear | ( | ) | [inline, virtual] |
Clears the contents of the collection.
Implements countable.
Definition at line 217 of file list.hpp.
References list::count, list::head, list::list_node::next, and list::tail.
Referenced by application::load_scenery(), queue::operator=(), list::operator=(), application::~application(), and list::~list().
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] |
T & get_tail | ( | ) | [inline] |
const T & get_tail | ( | ) | const [inline] |
void insert | ( | const iterator & | i, | |
const T & | item | |||
) | [inline, virtual] |
Implements iterable.
Definition at line 288 of file list.hpp.
References list::append(), list::count, and list::head.
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] |
Definition at line 256 of file list.hpp.
References list::head, list::list_node::item, and list::list_node::next.
const T & item | ( | const gsgl::index_t & | index | ) | const [inline, virtual] |
Definition at line 242 of file list.hpp.
References list::head, list::list_node::item, and list::list_node::next.
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().
Definition at line 134 of file list.hpp.
References list::append(), list::clear(), list::head, and list::list_node::next.
bool operator== | ( | const list< T > & | l | ) | const [inline] |
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 remove | ( | const iterator & | ) | [inline, virtual] |
Remove the item specified by the iterator.
Implements iterable.
Definition at line 309 of file list.hpp.
References list::count, list::head, and list::tail.
Referenced by gsgl::data::global_unregister_resource_aux().
gsgl::index_t size | ( | ) | const [inline, virtual] |
A generic count function that iterates over the collection.
Reimplemented from iterable.
Definition at line 210 of file list.hpp.
References list::count.
Referenced by mesh_file::load_obj_file(), and application::load_scenery().
gsgl::index_t count [protected] |
Definition at line 72 of file list.hpp.
Referenced by list::append(), list::clear(), list::contains_index(), list::insert(), list::remove(), and list::size().
Definition at line 73 of file list.hpp.
Referenced by list::append(), list::clear(), queue::front(), list::get_head(), list::insert(), list::item(), list::list(), queue::operator=(), list::operator=(), queue::pop(), and list::remove().
Definition at line 73 of file list.hpp.
Referenced by list::append(), list::clear(), list::get_tail(), and list::remove().