]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/directed-graph.hh
caa065abecea23346e7cd3ccb326b47594eeb5c4
[lilypond.git] / flower / include / directed-graph.hh
1 /*
2   edge_out.hh -- declare Directed_graph_node
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef DEPENDENCY_HH
11 #define DEPENDENCY_HH
12
13 #include "parray.hh"
14
15 /**
16   Class to handle two-sided connections between nodes (the Dependencies)
17  */
18 class Directed_graph_node {
19     Link_array<Directed_graph_node>edge_out_l_arr_;
20     /// targets
21     Link_array<Directed_graph_node> edge_in_l_arr_;
22     
23 public:
24     
25     /** remove i-th edge_out (and exactly one ref to me in the edge_out)
26       */
27     void remove_edge_out_idx (int i);
28     void copy_edges_out (Directed_graph_node const&);
29     bool linked_b() const;
30     void unlink();
31     void junk_links();
32     void add (Directed_graph_node*);
33     void remove_edge_in (Directed_graph_node *);
34     void remove_edge_out (Directed_graph_node*);
35     bool contains_b (Directed_graph_node const*) const;
36
37     Directed_graph_node (Directed_graph_node const &);
38     void OK()const;
39     Directed_graph_node();
40
41     ~Directed_graph_node();
42     
43     /**
44      ensure that no edge_out exists doubly.
45      */
46     void uniq();
47     Link_array<Directed_graph_node> const& get_out_edge_arr() const;
48     Link_array<Directed_graph_node> const& get_in_edge_arr() const;
49 };
50
51 #endif // DEPENDENCY_HH