20 #ifndef __CXXGRAPH_UNDIRECTEDEDGE_H__
21 #define __CXXGRAPH_UNDIRECTEDEDGE_H__
35 std::ostream &operator<<(std::ostream &o,
const UndirectedEdge<T> &edge);
45 const Node<T> &getNode1()
const;
46 const Node<T> &getNode2()
const;
47 const std::optional<bool> isDirected()
const override;
48 const std::optional<bool> isWeighted()
const override;
52 friend std::ostream &operator<<<>(std::ostream &os,
const UndirectedEdge<T> &edge);
61 UndirectedEdge<T>::UndirectedEdge(
const unsigned long id,
const std::pair<
const Node<T> *,
const Node<T> *> &nodepair) : Edge<T>(id, nodepair)
66 UndirectedEdge<T>::UndirectedEdge(
const Edge<T> &edge) : UndirectedEdge(edge.getId(), *(edge.getNodePair().first), *(edge.getNodePair().second))
71 const Node<T> &UndirectedEdge<T>::getNode1()
const
73 return *(Edge<T>::getNodePair().first);
77 const Node<T> &UndirectedEdge<T>::getNode2()
const
79 return *(Edge<T>::getNodePair().second);
83 const std::optional<bool> UndirectedEdge<T>::isDirected()
const
89 const std::optional<bool> UndirectedEdge<T>::isWeighted()
const
95 std::ostream &operator<<(std::ostream &os,
const UndirectedEdge<T> &edge)
97 os <<
"((Node: " << edge.getNode1().getId() <<
")) <----- |Edge: #" << edge.getId() <<
"|-----> ((Node: " << edge.getNode2().getId() <<
"))";
Definition: DirectedEdge.hpp:39
Definition: UndirectedEdge.hpp:39