2018-08-21 00:25:44 +02:00
|
|
|
/** A graph edge.
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @author Daniel Krebs <github@daniel-krebs.net>
|
2022-03-15 09:05:42 -04:00
|
|
|
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
2022-05-19 17:40:10 +02:00
|
|
|
* @license Apache License 2.0
|
2018-08-21 00:25:44 +02:00
|
|
|
*********************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace villas {
|
|
|
|
namespace graph {
|
|
|
|
|
|
|
|
class Edge {
|
|
|
|
template<typename VertexType, typename EdgeType>
|
|
|
|
friend class DirectedGraph;
|
|
|
|
|
|
|
|
public:
|
|
|
|
using Identifier = std::size_t;
|
|
|
|
|
|
|
|
friend std::ostream&
|
2020-06-14 21:53:18 +02:00
|
|
|
operator<< (std::ostream &stream, const Edge &edge)
|
2018-08-21 00:25:44 +02:00
|
|
|
{ return stream << edge.id; }
|
|
|
|
|
|
|
|
bool
|
2020-06-14 21:53:18 +02:00
|
|
|
operator==(const Edge &other)
|
2018-08-21 00:25:44 +02:00
|
|
|
{ return this->id == other.id; }
|
|
|
|
|
|
|
|
Vertex::Identifier getVertexTo() const
|
|
|
|
{ return to; }
|
|
|
|
|
|
|
|
Vertex::Identifier getVertexFrom() const
|
|
|
|
{ return from; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
Identifier id;
|
|
|
|
Vertex::Identifier from;
|
|
|
|
Vertex::Identifier to;
|
|
|
|
};
|
|
|
|
|
2020-06-11 23:31:35 +02:00
|
|
|
} /* namespace graph */
|
2019-05-28 10:50:50 +02:00
|
|
|
} /* namespace villas */
|