UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Edge.h
1 /***************************************************************************
2  * Copyright (C) 2005 SZS *
3  * Copyright (C) 2014 by Jan Stückrath <jan.stueckrath@uni-due.de> *
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 *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
19  ***************************************************************************/
20 
21 #ifndef DATA_STRUCTURESEDGE_H
22 #define DATA_STRUCTURESEDGE_H
23 
24 #include "Vertex.h"
25 
26 namespace uncover {
27  namespace graphs {
28 
34  class Edge
35  {
36 
37  public:
38 
42  typedef vector<IDType> VList;
43 
50  Edge(IDType id, vector<IDType> const& verts = vector<IDType>(), string label = "");
51 
55  ~Edge();
56 
61  IDType getID() const;
62 
67  string getLabel() const;
68 
73  void setLabel(string s);
74 
80  size_t getArity() const;
81 
86  VList& getVertices();
87 
92  VList const& getVertices() const;
93 
98  VList::iterator beginV();
99 
104  VList::const_iterator beginV() const;
105 
110  VList::const_iterator cbeginV() const;
111 
116  VList::iterator endV();
117 
122  VList::const_iterator endV() const;
123 
128  VList::const_iterator cendV() const;
129 
136  friend std::ostream& operator<< (std::ostream& ost, Edge const& data);
137 
138  private:
139 
144 
148  string label;
149 
154 
155  };
156 
157  }
158 }
159 
160 #endif
friend std::ostream & operator<<(std::ostream &ost, Edge const &data)
Streams all data stores in the given Edge to the given stream.
Definition: Edge.cpp:82
VList::iterator beginV()
Returns an iterator pointing to the first element of the sequence of attached vertices.
Definition: Edge.cpp:58
VList::iterator endV()
Returns an iterator pointing beyond the last element of the sequence of attached vertices.
Definition: Edge.cpp:70
IDType getID() const
Returns the ID of this Edge.
Definition: Edge.cpp:31
size_t getArity() const
Returns the number of vertices attached to this Edge.
Definition: Edge.cpp:46
string label
Stores the label of this Edge.
Definition: Edge.h:148
void setLabel(string s)
Sets the label of this Edge.
Definition: Edge.cpp:36
VList vertices
Stores the sequence of vertices to which this edge is attached.
Definition: Edge.h:153
Edge(IDType id, vector< IDType > const &verts=vector< IDType >(), string label="")
Creates a new Edge with the given ID, vertex sequence and label.
Definition: Edge.cpp:27
VList::const_iterator cendV() const
Returns an const_iterator pointing beyond the last element of the sequence of attached vertices...
Definition: Edge.cpp:78
IDType ID
Stores the ID of this Edge.
Definition: Edge.h:143
VList::const_iterator cbeginV() const
Returns an const_iterator pointing to the first element of the sequence of attached vertices...
Definition: Edge.cpp:66
string getLabel() const
Returns the label of this Edge.
Definition: Edge.cpp:41
VList & getVertices()
Returns a reference to the sequence of vertices of this Edge.
Definition: Edge.cpp:50
~Edge()
Destroys this instance of an Edge.
Definition: Edge.cpp:29
unsigned int IDType
IDType is an (unsigned) integer specifically used as an Identifier of graphs, elements of graphs or a...
Definition: globals.h:53
vector< IDType > VList
Alias for the sequence of vertices to which this edge is attached.
Definition: Edge.h:42
This class represents an edge in a Hypergraph.
Definition: Edge.h:34