ardour
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ARDOUR::GraphEdges Class Reference

#include <route_graph.h>

Public Types

typedef std::map< GraphVertex,
std::set< GraphVertex > > 
EdgeMap
 

Public Member Functions

void add (GraphVertex from, GraphVertex to, bool via_sends_only)
 
bool has (GraphVertex from, GraphVertex to, bool *via_sends_only)
 
std::set< GraphVertexfrom (GraphVertex r) const
 
void remove (GraphVertex from, GraphVertex to)
 
bool has_none_to (GraphVertex to) const
 
bool empty () const
 
void dump () const
 

Private Types

typedef std::multimap
< GraphVertex, std::pair
< GraphVertex, bool > > 
EdgeMapWithSends
 

Private Member Functions

void insert (EdgeMap &e, GraphVertex a, GraphVertex b)
 
EdgeMapWithSends::iterator find_in_from_to_with_sends (GraphVertex, GraphVertex)
 

Private Attributes

EdgeMap _from_to
 
EdgeMap _to_from
 
EdgeMapWithSends _from_to_with_sends
 

Detailed Description

A list of edges for a directed graph for routes.

It keeps the same data in a few different ways, with add() adding edges to all different representations, remove() removing similarly, and the lookup method using whichever representation is most efficient for that particular lookup.

This may be a premature optimisation...

Definition at line 40 of file route_graph.h.

Member Typedef Documentation

typedef std::map<GraphVertex, std::set<GraphVertex> > ARDOUR::GraphEdges::EdgeMap

Definition at line 43 of file route_graph.h.

typedef std::multimap<GraphVertex, std::pair<GraphVertex, bool> > ARDOUR::GraphEdges::EdgeMapWithSends
private

Definition at line 56 of file route_graph.h.

Member Function Documentation

void GraphEdges::add ( GraphVertex  from,
GraphVertex  to,
bool  via_sends_only 
)

Definition at line 30 of file route_graph.cc.

void GraphEdges::dump ( ) const

Definition at line 133 of file route_graph.cc.

bool GraphEdges::empty ( ) const

Definition at line 126 of file route_graph.cc.

GraphEdges::EdgeMapWithSends::iterator GraphEdges::find_in_from_to_with_sends ( GraphVertex  from,
GraphVertex  to 
)
private

Find a from/to pair in the _from_to_with_sends map.

Returns
iterator to the edge, or _from_to_with_sends.end().

Definition at line 49 of file route_graph.cc.

set< GraphVertex > GraphEdges::from ( GraphVertex  r) const
Returns
the vertices that are fed from `r'

Definition at line 83 of file route_graph.cc.

bool GraphEdges::has ( GraphVertex  from,
GraphVertex  to,
bool *  via_sends_only 
)
Parameters
via_sends_onlyif non-0, filled in with true if the edge is a path via a send only.
Returns
true if the given edge is present.

Definition at line 67 of file route_graph.cc.

bool GraphEdges::has_none_to ( GraphVertex  to) const
Parameters
to`To' route.
Returns
true if there are no edges going to `to'.

Definition at line 120 of file route_graph.cc.

void GraphEdges::insert ( EdgeMap e,
GraphVertex  a,
GraphVertex  b 
)
private

Insert an edge into one of the EdgeMaps

Definition at line 154 of file route_graph.cc.

void GraphEdges::remove ( GraphVertex  from,
GraphVertex  to 
)

Definition at line 94 of file route_graph.cc.

Member Data Documentation

EdgeMap ARDOUR::GraphEdges::_from_to
private

map of edges with from as `first' and to as `second'

Definition at line 61 of file route_graph.h.

EdgeMapWithSends ARDOUR::GraphEdges::_from_to_with_sends
private

map of edges with via-sends information; first part of the map is the `from' vertex, second is the `to' vertex and a flag which is true if the edge is via a send only.

Definition at line 68 of file route_graph.h.

EdgeMap ARDOUR::GraphEdges::_to_from
private

map of the same edges with to as `first' and from as `second'

Definition at line 63 of file route_graph.h.


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