![]() |
Rosetta Core
2014.16.56682
|
Custom edge list class. Returns const-iterators which only return Edge const *'s and non-const-iterators which can return either const or non-const Edge*'s. Manages its own memory using an unordered-object-pool for fast insertion and deletion of EdgeListElements. Implemented as a doubly linked list, though there's no practical way to start at the end of a list and work backward since decrementing the end iterator is not a valid operation. More...
#include <Graph.hh>
Public Member Functions | |
| EdgeList (boost::unordered_object_pool< EdgeListElement > &edge_list_element_pool) | |
| ~EdgeList () | |
| void | push_back (Edge *edgeptr) |
| create a new edge-list element and insert it at the front of the list More... | |
| void | push_front (Edge *edgeptr) |
| create a new edge-list element and insert it at the end of the list More... | |
| EdgeListIterator | insert (EdgeListIterator const &element_to_insert_before, Edge *edgeptr) |
| insert a new edge-list element in the list infront of the input iterator and return an iterator to the position of the new element More... | |
| EdgeListIterator | begin () |
| returns a non-const iterator to the front of the list More... | |
| EdgeListConstIterator | begin () const |
| returns a const iterator to the front of the list More... | |
| EdgeListConstIterator | const_begin () const |
| returns a const iterator to the front of the list More... | |
| EdgeListIterator | last () |
| returns a non-const iterator to the last element in the list More... | |
| EdgeListConstIterator | last () const |
| returns a const iterator to the last element in the list More... | |
| EdgeListConstIterator | const_last () const |
| returns a const iterator to the last element in the list More... | |
| EdgeListIterator | end () |
| returns a non-const iterator to the end of the list More... | |
| EdgeListConstIterator | end () const |
| returns a const iterator to the end of the list More... | |
| EdgeListConstIterator | const_end () const |
| returns a const iterator to the end of the list More... | |
| void | erase (EdgeListIterator to_erase) |
| removes an element from the list pointed to by the input iterator More... | |
| bool | is_end_element (EdgeListElement const *element) const |
| method invoked by the EdgeListIterator class: is an iterator the special end iterator for a list? More... | |
| platform::Size | size () const |
| O(N) More... | |
Private Member Functions | |
| EdgeList (EdgeList const &) | |
| Uncopyable – private and unimplemented copy ctor. More... | |
| EdgeList const & | operator= (EdgeList const &) |
| Uncopyable – private and unimplemented assignment operator. More... | |
Private Attributes | |
| boost::unordered_object_pool < EdgeListElement > & | edge_list_element_pool_ |
| this edge-list-element-pool reference is handed to the list to draw from. This pool must outlive the edge-list itself. To guarantee this, for the case of class Graph, the graph deletes its nodes (and their edge lists) before it deletes itself. More... | |
| EdgeListElement * | end_ |
| The special "end" position in the list. More... | |
Custom edge list class. Returns const-iterators which only return Edge const *'s and non-const-iterators which can return either const or non-const Edge*'s. Manages its own memory using an unordered-object-pool for fast insertion and deletion of EdgeListElements. Implemented as a doubly linked list, though there's no practical way to start at the end of a list and work backward since decrementing the end iterator is not a valid operation.
| core::graph::EdgeList::EdgeList | ( | boost::unordered_object_pool< EdgeListElement > & | edge_list_element_pool | ) |
References end_, core::graph::EdgeListElement::next_, and core::graph::EdgeListElement::previous_.
| core::graph::EdgeList::~EdgeList | ( | ) |
References begin(), edge_list_element_pool_, end(), and end_.
|
private |
Uncopyable – private and unimplemented copy ctor.
|
inline |
returns a non-const iterator to the front of the list
References end_, and core::graph::EdgeListElement::next_.
Referenced by core::graph::Node::add_edge(), core::graph::Graph::add_edge(), core::graph::Graph::all_pairs_shortest_paths(), core::graph::Graph::delete_everything(), core::graph::Node::drop_all_edges(), core::graph::Graph::drop_all_edges(), core::graph::Node::edge_list_begin(), core::graph::Graph::edge_list_begin(), core::graph::Node::find_edge(), core::graph::Node::lower_edge_list_begin(), core::graph::Graph::output_connectivity(), core::graph::Graph::output_dimacs(), size(), and ~EdgeList().
|
inline |
returns a const iterator to the front of the list
References end_, and core::graph::EdgeListElement::next_.
|
inline |
returns a const iterator to the front of the list
References end_, and core::graph::EdgeListElement::next_.
Referenced by core::graph::Node::const_edge_list_begin(), core::graph::Graph::const_edge_list_begin(), core::graph::Node::const_lower_edge_list_begin(), core::graph::Graph::getTotalMemoryUsage(), and core::graph::Node::print().
|
inline |
returns a const iterator to the end of the list
References end_.
Referenced by core::graph::Node::const_edge_list_end(), core::graph::Graph::const_edge_list_end(), core::graph::Node::const_upper_edge_list_end(), core::graph::Graph::getTotalMemoryUsage(), and core::graph::Node::print().
|
inline |
returns a const iterator to the last element in the list
References end_, and core::graph::EdgeListElement::previous_.
|
inline |
returns a non-const iterator to the end of the list
References end_.
Referenced by core::graph::Node::add_edge(), core::graph::Graph::all_pairs_shortest_paths(), core::graph::Graph::delete_everything(), core::graph::Node::drop_all_edges(), core::graph::Graph::drop_all_edges(), core::graph::Node::edge_list_end(), core::graph::Graph::edge_list_end(), core::graph::Node::find_edge(), core::graph::Graph::output_connectivity(), core::graph::Graph::output_dimacs(), size(), core::graph::Node::upper_edge_list_end(), and ~EdgeList().
|
inline |
returns a const iterator to the end of the list
References end_.
| void core::graph::EdgeList::erase | ( | EdgeListIterator | to_erase | ) |
removes an element from the list pointed to by the input iterator
References edge_list_element_pool_, core::graph::EdgeListIterator::element_, core::graph::EdgeListElement::next_, core::graph::EdgeListIterator::owner_, and core::graph::EdgeListElement::previous_.
Referenced by core::graph::Node::drop_edge(), and core::graph::Graph::drop_edge().
| EdgeListIterator core::graph::EdgeList::insert | ( | EdgeListIterator const & | element_to_insert_before, |
| Edge * | edgeptr | ||
| ) |
insert a new edge-list element in the list infront of the input iterator and return an iterator to the position of the new element
References edge_list_element_pool_, core::graph::EdgeListIterator::element_, core::graph::EdgeListElement::next_, core::graph::EdgeListIterator::owner_, and core::graph::EdgeListElement::previous_.
Referenced by core::graph::Node::add_edge().
|
inline |
method invoked by the EdgeListIterator class: is an iterator the special end iterator for a list?
References end_.
Referenced by core::graph::EdgeListIterator::valid(), and core::graph::EdgeListConstIterator::valid().
|
inline |
returns a non-const iterator to the last element in the list
References end_, and core::graph::EdgeListElement::previous_.
Referenced by core::graph::Graph::add_edge().
|
inline |
returns a const iterator to the last element in the list
References end_, and core::graph::EdgeListElement::previous_.
Uncopyable – private and unimplemented assignment operator.
| void core::graph::EdgeList::push_back | ( | Edge * | edgeptr | ) |
create a new edge-list element and insert it at the front of the list
References edge_list_element_pool_, end_, core::graph::EdgeListElement::next_, and core::graph::EdgeListElement::previous_.
Referenced by core::graph::Graph::add_edge().
| void core::graph::EdgeList::push_front | ( | Edge * | edgeptr | ) |
create a new edge-list element and insert it at the end of the list
References edge_list_element_pool_, end_, core::graph::EdgeListElement::next_, and core::graph::EdgeListElement::previous_.
Referenced by core::graph::Graph::add_edge().
| platform::Size core::graph::EdgeList::size | ( | ) | const |
|
private |
this edge-list-element-pool reference is handed to the list to draw from. This pool must outlive the edge-list itself. To guarantee this, for the case of class Graph, the graph deletes its nodes (and their edge lists) before it deletes itself.
Referenced by erase(), insert(), push_back(), push_front(), and ~EdgeList().
|
private |
The special "end" position in the list.
Referenced by begin(), const_begin(), const_end(), const_last(), EdgeList(), end(), is_end_element(), last(), push_back(), push_front(), and ~EdgeList().
1.8.7