ardour
route_graph.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 Paul Davis
3  Author: Carl Hetherington <cth@carlh.net>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 
19 */
20 
21 #ifndef __ardour_route_graph_h__
22 #define __ardour_route_graph_h__
23 
24 #include <map>
25 #include <set>
26 
27 namespace ARDOUR {
28 
30 
41 {
42 public:
43  typedef std::map<GraphVertex, std::set<GraphVertex> > EdgeMap;
44 
45  void add (GraphVertex from, GraphVertex to, bool via_sends_only);
46  bool has (GraphVertex from, GraphVertex to, bool* via_sends_only);
47  std::set<GraphVertex> from (GraphVertex r) const;
48  void remove (GraphVertex from, GraphVertex to);
49  bool has_none_to (GraphVertex to) const;
50  bool empty () const;
51  void dump () const;
52 
53 private:
54  void insert (EdgeMap& e, GraphVertex a, GraphVertex b);
55 
56  typedef std::multimap<GraphVertex, std::pair<GraphVertex, bool> > EdgeMapWithSends;
57 
58  EdgeMapWithSends::iterator find_in_from_to_with_sends (GraphVertex, GraphVertex);
59 
61  EdgeMap _from_to;
63  EdgeMap _to_from;
68  EdgeMapWithSends _from_to_with_sends;
69 };
70 
74  );
75 
76 }
77 
78 #endif
boost::shared_ptr< Route > GraphVertex
Definition: route_graph.h:29
std::multimap< GraphVertex, std::pair< GraphVertex, bool > > EdgeMapWithSends
Definition: route_graph.h:56
std::map< GraphVertex, std::set< GraphVertex > > EdgeMap
Definition: route_graph.h:43
Definition: amp.h:29
EdgeMapWithSends _from_to_with_sends
Definition: route_graph.h:68
#define LIBARDOUR_API
boost::shared_ptr< RouteList > topological_sort(boost::shared_ptr< RouteList >, GraphEdges)
Definition: route_graph.cc:194