make node members public

This commit is contained in:
Maximilian Keßler 2023-11-04 17:41:17 +01:00
parent 433430f92c
commit 0b91007fa6
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -90,6 +90,11 @@ public:
/** @return The array of ids of the neighbors of this node. **/ /** @return The array of ids of the neighbors of this node. **/
std::vector<NodeId> const & neighbors() const; std::vector<NodeId> const & neighbors() const;
public:
NodeId matched_neighbor {invalid_node_id};
NodeId ear_or_root_neighbor {invalid_node_id};
NodeId root_of_ear_component {invalid_node_id};
private: private:
// This allows each Graph to access private members of this class, // This allows each Graph to access private members of this class,
// in our case the add_neighbor function // in our case the add_neighbor function
@ -104,9 +109,6 @@ private:
void add_neighbor(NodeId const id); void add_neighbor(NodeId const id);
std::vector<NodeId> _neighbors; std::vector<NodeId> _neighbors;
NodeId _matched_neighbor {invalid_node_id};
NodeId _ear_or_root_neighbor {invalid_node_id};
NodeId _root_of_ear_component {invalid_node_id};
}; // class Node }; // class Node
/** /**
@ -228,19 +230,19 @@ Node const & Graph::node(NodeId const id) const
inline inline
NodeId Graph::matched_neighbor(NodeId const id) const NodeId Graph::matched_neighbor(NodeId const id) const
{ {
return _nodes[id]._matched_neighbor; return _nodes[id].matched_neighbor;
} }
inline inline
NodeId Graph::ear_or_root_neighbor(const ED::NodeId id) const NodeId Graph::ear_or_root_neighbor(const ED::NodeId id) const
{ {
return _nodes[id]._ear_or_root_neighbor; return _nodes[id].ear_or_root_neighbor;
} }
inline inline
NodeId Graph::root_of_ear_component(const ED::NodeId id) const NodeId Graph::root_of_ear_component(const ED::NodeId id) const
{ {
return _nodes[id]._root_of_ear_component; return _nodes[id].root_of_ear_component;
} }
} // namespace ED } // namespace ED