blob: 0f72052250ac08dd77d4f8b84eccbdb28e528bce (
plain) (
tree)
|
|
#ifndef NETWORK_SET_H_3036B8E3
#define NETWORK_SET_H_3036B8E3
#include <map>
#include <optional>
#include <set>
#include <utility>
#include <vector>
struct NetworkNode {
int entry;
int exit;
bool two_way;
bool operator<(const NetworkNode& rhs) const;
};
class NetworkSet {
public:
void Clear();
void AddLink(int id1, int id2, bool two_way);
void AddLinkToNetwork(int network_id, int id1, int id2, bool two_way);
bool IsItemInNetwork(int id) const;
const std::set<NetworkNode>& GetNetworkGraph(int id) const;
private:
std::map<int, std::set<NetworkNode>> network_by_item_;
};
#endif /* end of include guard: NETWORK_SET_H_3036B8E3 */
|