blob: e0ef0435188b714b59df37108badf8d743b97fcd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#ifndef NETWORK_SET_H_3036B8E3
#define NETWORK_SET_H_3036B8E3
#include <map>
#include <optional>
#include <set>
#include <utility>
#include <vector>
class NetworkSet {
public:
void Clear();
int AddLink(int id1, int id2);
bool IsItemInNetwork(int id) const;
int GetNetworkWithItem(int id) const;
const std::set<std::pair<int, int>>& GetNetworkGraph(int id) const;
private:
std::vector<std::set<std::pair<int, int>>> networks_;
std::map<int, int> network_by_item_;
};
#endif /* end of include guard: NETWORK_SET_H_3036B8E3 */
|