Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
edge.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file edge.h
1 /* This software is distributed under the GNU Lesser General Public License */
2 //==========================================================================
3 //
4 // edge.h
5 //
6 //==========================================================================
7 // $Id: edge.h,v 1.15 2001/04/17 14:35:25 raitner Exp $
8 
9 #ifndef GTL_EDGE_H
10 #define GTL_EDGE_H
11 
12 #include <GTL/GTL.h>
13 
14 #include <list>
15 #include <ostream>
16 
18 
19 //--------------------------------------------------------------------------
20 // For MSVC 5.0 edge.h has to be included before node.h and
21 // {node,edge}_data.h. So we only declare needed classnames here
22 //--------------------------------------------------------------------------
23 
24 class node;
25 class edge_data;
26 
27 //--------------------------------------------------------------------------
28 // edge
29 //--------------------------------------------------------------------------
30 
35 {
36 public:
53  edge();
54 
60  node source() const;
61 
67  node target() const;
68 
72  void reverse ();
73 
79  void change_source (node n);
80 
86  void change_target (node n);
87 
94  const node& opposite(node n) const;
95 
99  list<node> sources() const;
100 
104  list<node> targets() const;
105 
109  int id() const;
110 
111 
119  bool is_hidden () const;
120 
121 
122  //================================================== Implementation
123 
124 private:
126 
127  void remove_from(int where) const; // 0 = sources, 1 == targets
128 
129  friend class graph;
130  friend class node;
131 
132  GTL_EXTERN friend bool operator==(edge, edge);
133  GTL_EXTERN friend bool operator!=(edge, edge);
134  GTL_EXTERN friend bool operator<(edge, edge);
135  GTL_EXTERN friend ostream& operator<< (ostream& os, const edge& e);
136 };
137 
139 
140 #endif // GTL_EDGE_H
141 
142 //--------------------------------------------------------------------------
143 // end of file
144 //--------------------------------------------------------------------------