2016-09-27 15:01:08 -04:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2008-02-07 16:14:05 -05:00
|
|
|
#ifndef cmGraphAdjacencyList_h
|
|
|
|
#define cmGraphAdjacencyList_h
|
|
|
|
|
2017-04-11 22:00:21 +02:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2016-09-01 20:05:48 +02:00
|
|
|
|
2019-01-21 17:15:21 +01:00
|
|
|
#include <utility>
|
2016-11-05 21:40:14 +01:00
|
|
|
#include <vector>
|
2008-02-07 16:14:05 -05:00
|
|
|
|
2019-09-30 10:46:28 -04:00
|
|
|
#include "cmListFileCache.h"
|
|
|
|
|
2010-08-25 10:07:25 -04: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:
|
2019-01-21 17:15:21 +01:00
|
|
|
cmGraphEdge(int n, bool s, cmListFileBacktrace bt)
|
2016-05-16 10:34:04 -04:00
|
|
|
: Dest(n)
|
|
|
|
, Strong(s)
|
2019-01-21 17:15:21 +01:00
|
|
|
, Backtrace(std::move(bt))
|
2016-05-16 10:34:04 -04:00
|
|
|
{
|
|
|
|
}
|
2010-08-25 10:07:25 -04:00
|
|
|
operator int() const { return this->Dest; }
|
|
|
|
|
|
|
|
bool IsStrong() const { return this->Strong; }
|
2018-06-01 09:53:41 -04:00
|
|
|
|
2018-10-17 10:46:00 -04:00
|
|
|
cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
|
|
|
|
|
2010-08-25 10:07:25 -04:00
|
|
|
private:
|
|
|
|
int Dest;
|
|
|
|
bool Strong;
|
2018-10-17 10:46:00 -04:00
|
|
|
cmListFileBacktrace Backtrace;
|
2010-08-25 10:07:25 -04:00
|
|
|
};
|
2016-05-16 10:34:04 -04:00
|
|
|
struct cmGraphEdgeList : public std::vector<cmGraphEdge>
|
|
|
|
{
|
|
|
|
};
|
|
|
|
struct cmGraphNodeList : public std::vector<int>
|
|
|
|
{
|
|
|
|
};
|
|
|
|
struct cmGraphAdjacencyList : public std::vector<cmGraphEdgeList>
|
|
|
|
{
|
|
|
|
};
|
2008-02-07 16:14:05 -05:00
|
|
|
|
|
|
|
#endif
|