2016-10-30 18:24:19 +01:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2021-09-14 00:13:48 +02:00
|
|
|
#pragma once
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2017-07-20 19:35:53 +02:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2016-10-30 18:24:19 +01:00
|
|
|
|
2019-11-11 23:01:05 +01:00
|
|
|
#include <utility>
|
2017-04-14 19:02:05 +02:00
|
|
|
#include <vector>
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2020-02-01 23:06:01 +01:00
|
|
|
#include "cmListFileCache.h"
|
|
|
|
|
2010-11-13 01:00:53 +02:00
|
|
|
/**
|
|
|
|
* Graph edge representation. Most use cases just need the
|
|
|
|
* destination vertex, so we support conversion to/from an int. We
|
|
|
|
* also store boolean to indicate whether an edge is "strong".
|
|
|
|
*/
|
|
|
|
class cmGraphEdge
|
|
|
|
{
|
|
|
|
public:
|
2020-08-30 11:54:41 +02:00
|
|
|
cmGraphEdge(int n, bool s, bool c, cmListFileBacktrace bt)
|
2016-07-09 11:21:54 +02:00
|
|
|
: Dest(n)
|
|
|
|
, Strong(s)
|
2020-08-30 11:54:41 +02:00
|
|
|
, Cross(c)
|
2019-11-11 23:01:05 +01:00
|
|
|
, Backtrace(std::move(bt))
|
2016-07-09 11:21:54 +02:00
|
|
|
{
|
|
|
|
}
|
2010-11-13 01:00:53 +02:00
|
|
|
operator int() const { return this->Dest; }
|
|
|
|
|
|
|
|
bool IsStrong() const { return this->Strong; }
|
2018-08-09 18:06:22 +02:00
|
|
|
|
2020-08-30 11:54:41 +02:00
|
|
|
bool IsCross() const { return this->Cross; }
|
|
|
|
|
2019-11-11 23:01:05 +01:00
|
|
|
cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
|
|
|
|
|
2010-11-13 01:00:53 +02:00
|
|
|
private:
|
|
|
|
int Dest;
|
|
|
|
bool Strong;
|
2020-08-30 11:54:41 +02:00
|
|
|
bool Cross;
|
2019-11-11 23:01:05 +01:00
|
|
|
cmListFileBacktrace Backtrace;
|
2010-11-13 01:00:53 +02:00
|
|
|
};
|
2016-07-09 11:21:54 +02:00
|
|
|
struct cmGraphEdgeList : public std::vector<cmGraphEdge>
|
|
|
|
{
|
|
|
|
};
|
|
|
|
struct cmGraphNodeList : public std::vector<int>
|
|
|
|
{
|
|
|
|
};
|
|
|
|
struct cmGraphAdjacencyList : public std::vector<cmGraphEdgeList>
|
|
|
|
{
|
|
|
|
};
|