2018-08-21 00:25:44 +02:00
|
|
|
/** A graph vertex.
|
|
|
|
*
|
|
|
|
* @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 Vertex {
|
|
|
|
template<typename VertexType, typename EdgeType>
|
|
|
|
friend class DirectedGraph;
|
|
|
|
|
|
|
|
public:
|
|
|
|
using Identifier = std::size_t;
|
|
|
|
|
|
|
|
const Identifier&
|
|
|
|
getIdentifier() const
|
|
|
|
{ return id; }
|
|
|
|
|
|
|
|
friend std::ostream&
|
2020-06-14 21:53:18 +02:00
|
|
|
operator<< (std::ostream &stream, const Vertex &vertex)
|
2018-08-21 00:25:44 +02:00
|
|
|
{ return stream << vertex.id; }
|
|
|
|
|
|
|
|
bool
|
2020-06-14 21:53:18 +02:00
|
|
|
operator==(const Vertex &other)
|
2018-08-21 00:25:44 +02:00
|
|
|
{ return this->id == other.id; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
Identifier id;
|
|
|
|
// HACK: how to resolve this circular type dependency?
|
|
|
|
std::list<std::size_t> edges;
|
|
|
|
};
|
|
|
|
|
2020-06-11 23:31:35 +02:00
|
|
|
} /* namespace graph */
|
2019-05-28 10:50:50 +02:00
|
|
|
} /* namespace villas */
|