resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmGraphAdjacencyList.h
1 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2    file Copyright.txt or https://cmake.org/licensing for details.  */
3 #pragma once
4
5 #include "cmConfigure.h" // IWYU pragma: keep
6
7 #include <utility>
8 #include <vector>
9
10 #include "cmListFileCache.h"
11
12 /**
13  * Graph edge representation.  Most use cases just need the
14  * destination vertex, so we support conversion to/from an int.  We
15  * also store boolean to indicate whether an edge is "strong".
16  */
17 class cmGraphEdge
18 {
19 public:
20   cmGraphEdge(int n, bool s, bool c, cmListFileBacktrace bt)
21     : Dest(n)
22     , Strong(s)
23     , Cross(c)
24     , Backtrace(std::move(bt))
25   {
26   }
27   operator int() const { return this->Dest; }
28
29   bool IsStrong() const { return this->Strong; }
30
31   bool IsCross() const { return this->Cross; }
32
33   cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
34
35 private:
36   int Dest;
37   bool Strong;
38   bool Cross;
39   cmListFileBacktrace Backtrace;
40 };
41 struct cmGraphEdgeList : public std::vector<cmGraphEdge>
42 {
43 };
44 struct cmGraphNodeList : public std::vector<int>
45 {
46 };
47 struct cmGraphAdjacencyList : public std::vector<cmGraphEdgeList>
48 {
49 };