4 #include "CachedNode.hpp"
18 class SHOWCASE_API
CachedGraph :
public std::enable_shared_from_this<CachedGraph>
27 CachedNodePtr getNode(
const NodeId&
id)
const;
35 void initNode(
const GraphNode& node, std::unique_lock<std::mutex>&& lock);
40 void addEdge(
const NodeId& setOwner,
const NodeId& toSet,
41 std::unordered_map<
NodeId, std::set<NodeId>>& edges);
45 void collectNodes(
const NodeId& node, std::set<NodeId>& visited);
48 mutable std::mutex m_nodeMutex;
49 std::unordered_map<NodeId, CachedNodePtr> m_nodes;
51 std::mutex m_edgeMutex;
53 std::unordered_map<NodeId, std::set<NodeId>> m_outgoingEdges;
56 std::unordered_map<NodeId, std::set<NodeId>> m_incomingEdges;
58 std::weak_ptr<Graph> m_graph;
60 typedef std::shared_ptr<CachedGraph> CachedGraphPtr;