about summary refs log tree commit diff stats
path: root/src/network_set.h
blob: e6f0c07e532eb1e632e0afb55210e1f4d3e4ab9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.
#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();

  void AddLink(int id1, int id2);

  bool IsItemInNetwork(int id) const;

  const std::set<std::pair<int, int>>& GetNetworkGraph(int id) const;

 private:

  std::map<int, std::set<std::pair<int, int>>> network_by_item_;
};

#endif /* end of include guard: NETWORK_SET_H_3036B8E3 */