20 #ifndef __CXXGRAPH_DIRECTEDEDGE_H__
21 #define __CXXGRAPH_DIRECTEDEDGE_H__
36 std::ostream &operator<<(std::ostream &o,
const DirectedEdge<T> &edge);
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 DirectedEdge<T> &edge);
61 DirectedEdge<T>::DirectedEdge(
const unsigned long id,
const std::pair<
const Node<T> *,
const Node<T> *> &nodepair) : Edge<T>(id, nodepair)
66 DirectedEdge<T>::DirectedEdge(
const Edge<T> &edge) : DirectedEdge(edge.getId(), *(edge.getNodePair().first), *(edge.getNodePair().second))
71 const Node<T> &DirectedEdge<T>::getFrom()
const
73 return *(Edge<T>::getNodePair().first);
77 const Node<T> &DirectedEdge<T>::getTo()
const
79 return *(Edge<T>::getNodePair().second);
83 const std::optional<bool> DirectedEdge<T>::isDirected()
const
89 const std::optional<bool> DirectedEdge<T>::isWeighted()
const
97 std::ostream &operator<<(std::ostream &os,
const DirectedEdge<T> &edge)
99 os <<
"((Node: " << edge.getFrom().getId() <<
")) +----- |Edge: #" << edge.getId() <<
"|-----> ((Node: " << edge.getTo().getId() <<
"))";
Definition: DirectedEdge.hpp:39
Definition: UndirectedEdge.hpp:39