Rosetta  2020.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
utility::graph::DirectedEdgeList Class Reference

Custom edge list class. Returns const-iterators which only return DirectedEdge const *'s and non-const-iterators which can return either const or non-const DirectedEdge*'s. Manages its own memory using an unordered-object-pool for fast insertion and deletion of DirectedEdgeListElements. 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 <Digraph.hh>

Public Member Functions

 DirectedEdgeList (boost::unordered_object_pool< DirectedEdgeListElement > &edge_list_element_pool)
 
 ~DirectedEdgeList ()
 
void push_back (DirectedEdge *edgeptr)
 create a new edge-list element and insert it at the front of the list More...
 
void push_front (DirectedEdge *edgeptr)
 create a new edge-list element and insert it at the end of the list More...
 
DirectedEdgeListIterator insert (DirectedEdgeListIterator const &element_to_insert_before, DirectedEdge *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...
 
DirectedEdgeListIterator begin ()
 returns a non-const iterator to the front of the list More...
 
DirectedEdgeListConstIterator begin () const
 returns a const iterator to the front of the list More...
 
DirectedEdgeListConstIterator const_begin () const
 returns a const iterator to the front of the list More...
 
DirectedEdgeListIterator last ()
 returns a non-const iterator to the last element in the list More...
 
DirectedEdgeListConstIterator last () const
 returns a const iterator to the last element in the list More...
 
DirectedEdgeListConstIterator const_last () const
 returns a const iterator to the last element in the list More...
 
DirectedEdgeListIterator end ()
 returns a non-const iterator to the end of the list More...
 
DirectedEdgeListConstIterator end () const
 returns a const iterator to the end of the list More...
 
DirectedEdgeListConstIterator const_end () const
 returns a const iterator to the end of the list More...
 
void erase (DirectedEdgeListIterator to_erase)
 removes an element from the list pointed to by the input iterator More...
 
bool is_end_element (DirectedEdgeListElement const *element) const
 method invoked by the DirectedEdgeListIterator class: is an iterator the special end iterator for a list? More...
 
platform::Size size () const
 O(N) More...
 

Private Member Functions

 DirectedEdgeList (DirectedEdgeList const &)
 Uncopyable – private and unimplemented copy ctor. More...
 
DirectedEdgeList const & operator= (DirectedEdgeList const &)
 Uncopyable – private and unimplemented assignment operator. More...
 

Private Attributes

boost::unordered_object_pool
< DirectedEdgeListElement > & 
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 Digraph, the graph deletes its nodes (and their edge lists) before it deletes itself. More...
 
DirectedEdgeListElementend_
 The special "end" position in the list. More...
 

Detailed Description

Custom edge list class. Returns const-iterators which only return DirectedEdge const *'s and non-const-iterators which can return either const or non-const DirectedEdge*'s. Manages its own memory using an unordered-object-pool for fast insertion and deletion of DirectedEdgeListElements. 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.

Constructor & Destructor Documentation

utility::graph::DirectedEdgeList::DirectedEdgeList ( boost::unordered_object_pool< DirectedEdgeListElement > &  edge_list_element_pool)
utility::graph::DirectedEdgeList::~DirectedEdgeList ( )
utility::graph::DirectedEdgeList::DirectedEdgeList ( DirectedEdgeList const &  )
private

Uncopyable – private and unimplemented copy ctor.

Member Function Documentation

DirectedEdgeListIterator utility::graph::DirectedEdgeList::begin ( )
inline
DirectedEdgeListConstIterator utility::graph::DirectedEdgeList::begin ( ) const
inline

returns a const iterator to the front of the list

References end_, and utility::graph::DirectedEdgeListElement::next_.

DirectedEdgeListConstIterator utility::graph::DirectedEdgeList::const_begin ( ) const
inline
DirectedEdgeListConstIterator utility::graph::DirectedEdgeList::const_end ( ) const
inline
DirectedEdgeListConstIterator utility::graph::DirectedEdgeList::const_last ( ) const
inline

returns a const iterator to the last element in the list

References end_, and utility::graph::DirectedEdgeListElement::previous_.

DirectedEdgeListIterator utility::graph::DirectedEdgeList::end ( )
inline
DirectedEdgeListConstIterator utility::graph::DirectedEdgeList::end ( ) const
inline

returns a const iterator to the end of the list

References end_.

void utility::graph::DirectedEdgeList::erase ( DirectedEdgeListIterator  to_erase)
DirectedEdgeListIterator utility::graph::DirectedEdgeList::insert ( DirectedEdgeListIterator const &  element_to_insert_before,
DirectedEdge edgeptr 
)
bool utility::graph::DirectedEdgeList::is_end_element ( DirectedEdgeListElement const *  element) const
inline

method invoked by the DirectedEdgeListIterator class: is an iterator the special end iterator for a list?

References end_.

Referenced by utility::graph::DirectedEdgeListIterator::valid(), and utility::graph::DirectedEdgeListConstIterator::valid().

DirectedEdgeListIterator utility::graph::DirectedEdgeList::last ( )
inline

returns a non-const iterator to the last element in the list

References end_, and utility::graph::DirectedEdgeListElement::previous_.

Referenced by utility::graph::Digraph::add_edge().

DirectedEdgeListConstIterator utility::graph::DirectedEdgeList::last ( ) const
inline

returns a const iterator to the last element in the list

References end_, and utility::graph::DirectedEdgeListElement::previous_.

DirectedEdgeList const& utility::graph::DirectedEdgeList::operator= ( DirectedEdgeList const &  )
private

Uncopyable – private and unimplemented assignment operator.

void utility::graph::DirectedEdgeList::push_back ( DirectedEdge edgeptr)
void utility::graph::DirectedEdgeList::push_front ( DirectedEdge edgeptr)
platform::Size utility::graph::DirectedEdgeList::size ( ) const

O(N)

References begin(), and end().

Referenced by utility::graph::Digraph::output_dimacs().

Member Data Documentation

boost::unordered_object_pool< DirectedEdgeListElement >& utility::graph::DirectedEdgeList::edge_list_element_pool_
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 Digraph, the graph deletes its nodes (and their edge lists) before it deletes itself.

Referenced by erase(), insert(), push_back(), push_front(), and ~DirectedEdgeList().

DirectedEdgeListElement* utility::graph::DirectedEdgeList::end_
private

The documentation for this class was generated from the following files: