olsr::gra::AdjGraph Class Reference

The graph per se. More...

#include <graph.hh>

List of all members.

Public Types

typedef arcset_t aset_t
 Convenience alias.
typedef nodeset_t nset_t
 Convenience alias.

Public Member Functions

std::string to_string () const
 AdjGraph ()
 AdjGraph (const This &other)
Thisoperator= (const This &other)
const aset_tarcs () const
const nset_tnodes () const
std::pair
< nset_t::const_iterator, bool > 
insert_node (const AdjNode &n)
std::pair
< aset_t::const_iterator, bool > 
insert_arc (const AdjInfo &a)
void insert_edge (const AdjInfo &a)
void remove_arc (aset_t::iterator pos)
void remove_arc (const AdjInfo &a)
void remove_edge (aset_t::iterator pos)
void remove_edge (const AdjInfo &a)
void remove_arc_then_node (aset_t::iterator pos)
void remove_arc_then_node (const AdjInfo &a)
void remove_edge_then_node (aset_t::iterator pos)
void remove_edge_then_node (const AdjInfo &a)
void remove_node (nset_t::iterator pos)
void remove_node (const AdjNode &n)
void remove_node_if_alone (nset_t::iterator pos)
void remove_node_if_alone (const AdjNode &n)

Private Types

typedef AdjGraph This
typedef std::hash_set< const
AdjInfo *, hash_AdjInfo,
utl::pequal_to< AdjInfo > > 
apset_t
 Set of pointers to arc.
typedef std::hash_map< const
AdjNode *, apset_t,
hash_AdjNode, utl::pequal_to
< AdjNode > > 
apsetmap_t
 Map from node pointer to apset_t.

Private Member Functions

void build_asetmap ()

Private Attributes

aset_t _aset
 Set of arcs.
nset_t _nset
 Set of nodes.
apsetmap_t _apset_map
 Map of nodes to connecting arcs.


Detailed Description

The graph per se.

Member Typedef Documentation

std::hash_set< const AdjInfo * > olsr::gra::AdjGraph::apset_t [private]

Set of pointers to arc.

Used to build subsets of the set of arcs.

std::hash_map< const AdjNode *, apset_t > olsr::gra::AdjGraph::apsetmap_t [private]

Map from node pointer to apset_t.

Used to find easily the set of arcs departing of or arriving at a given node.

Convenience alias.

Convenience alias.


Constructor & Destructor Documentation

olsr::gra::AdjGraph::AdjGraph (  )  [inline]

Graph constructor

olsr::gra::AdjGraph::AdjGraph ( const This other  )  [inline]

Graph copy constructor

References build_asetmap().


Member Function Documentation

std::string olsr::gra::AdjGraph::to_string (  )  const [inline]

AdjGraph & olsr::gra::AdjGraph::operator= ( const This other  )  [inline]

Graph assignment operator

References _apset_map, _aset, _nset, and build_asetmap().

const aset_t& olsr::gra::AdjGraph::arcs (  )  const [inline]

Accessor to the set of arcs.

Returns:
reference to the set of arcs

References _aset.

Referenced by olsr::alg::dijkstra().

const nset_t& olsr::gra::AdjGraph::nodes (  )  const [inline]

Accessor to the set of nodes.

Returns:
reference to the set of nodes

References _nset.

Referenced by olsr::alg::dijkstra(), and olsr::set::CoherenceProxy::update_graph().

std::pair< AdjGraph::nset_t::const_iterator, bool > olsr::gra::AdjGraph::insert_node ( const AdjNode n  )  [inline]

std::pair< AdjGraph::aset_t::const_iterator, bool > olsr::gra::AdjGraph::insert_arc ( const AdjInfo a  )  [inline]

void olsr::gra::AdjGraph::insert_edge ( const AdjInfo a  )  [inline]

Edge insertion method. Inserts both the arc and the inverted arc.

  • a the arc to be inserted

References insert_arc(), and olsr::gra::AdjInfo::invert().

void olsr::gra::AdjGraph::remove_arc ( aset_t::iterator  pos  )  [inline]

void olsr::gra::AdjGraph::remove_arc ( const AdjInfo a  )  [inline]

Arc removal method.

  • a reference to the arc to be removed

References _aset, olsr::utl::Set< Elem, Iset, Iter, CIter >::end(), olsr::utl::Set< Elem, Iset, Iter, CIter >::find(), and remove_arc().

void olsr::gra::AdjGraph::remove_edge ( aset_t::iterator  pos  )  [inline]

Edge removal method. Removes both the arc and the inverted arc.

  • pos iterator to the arc to be removed

References olsr::gra::AdjInfo::invert(), and remove_arc().

void olsr::gra::AdjGraph::remove_edge ( const AdjInfo a  )  [inline]

Edge removal method. Removed both the arc and the inverted arc.

  • a reference to the arc to be removed

References olsr::gra::AdjInfo::invert(), and remove_arc().

void olsr::gra::AdjGraph::remove_arc_then_node ( aset_t::iterator  pos  )  [inline]

Arc removal method. Removes the endpoint nodes if they don't belong to other arcs.

  • pos iterator to the arc to be removed

References _apset_map, _nset, olsr::utl::Set< Elem, Iset, Iter, CIter >::end(), olsr::utl::Set< Elem, Iset, Iter, CIter >::find(), olsr::gra::AdjNode::make_key(), remove_arc(), and remove_node().

Referenced by remove_arc_then_node(), and remove_edge_then_node().

void olsr::gra::AdjGraph::remove_arc_then_node ( const AdjInfo a  )  [inline]

Arc removal method. Removes the endpoint nodes if they don't belong to other arcs.

  • a reference to the arc to be removed

References _aset, olsr::utl::Set< Elem, Iset, Iter, CIter >::end(), olsr::utl::Set< Elem, Iset, Iter, CIter >::find(), and remove_arc_then_node().

void olsr::gra::AdjGraph::remove_edge_then_node ( aset_t::iterator  pos  )  [inline]

Edge removal method. Removed both the arc and the inverted arc. Removes the endpoint nodes if they don't belong to other arcs.

  • pos iterator to the arc to be removed

References olsr::gra::AdjInfo::invert(), and remove_arc_then_node().

void olsr::gra::AdjGraph::remove_edge_then_node ( const AdjInfo a  )  [inline]

Edge removal method. Removed both the arc and the inverted arc. Removes the endpoint nodes if they don't belong to other arcs.

  • a reference to the arc to be removed

References olsr::gra::AdjInfo::invert(), and remove_arc_then_node().

void olsr::gra::AdjGraph::remove_node ( nset_t::iterator  pos  )  [inline]

void olsr::gra::AdjGraph::remove_node ( const AdjNode n  )  [inline]

Node removal method.

  • n reference to the node to be removed

References _nset, olsr::utl::Set< Elem, Iset, Iter, CIter >::end(), olsr::utl::Set< Elem, Iset, Iter, CIter >::find(), and remove_node().

void olsr::gra::AdjGraph::remove_node_if_alone ( nset_t::iterator  pos  )  [inline]

void olsr::gra::AdjGraph::remove_node_if_alone ( const AdjNode n  )  [inline]

Non-connected-node removal method.

  • n reference to the node to be removed

References _nset, olsr::utl::Set< Elem, Iset, Iter, CIter >::end(), olsr::utl::Set< Elem, Iset, Iter, CIter >::find(), and remove_node_if_alone().

void olsr::gra::AdjGraph::build_asetmap (  )  [inline, private]


Member Data Documentation


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

Generated on Thu Feb 12 20:45:38 2009 for Qolyester daemon by  doxygen 1.5.6