mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-04 23:00:54 +00:00
cmState: Move SnapshotType enum to separate namespace
This commit is contained in:
@@ -32,7 +32,7 @@ struct cmStateDetail::SnapshotDataType
|
|||||||
cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator Policies;
|
cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator Policies;
|
||||||
cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator PolicyRoot;
|
cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator PolicyRoot;
|
||||||
cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator PolicyScope;
|
cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator PolicyScope;
|
||||||
cmState::SnapshotType SnapshotType;
|
cmStateEnums::SnapshotType SnapshotType;
|
||||||
bool Keep;
|
bool Keep;
|
||||||
cmLinkedTree<std::string>::iterator ExecutionListFile;
|
cmLinkedTree<std::string>::iterator ExecutionListFile;
|
||||||
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator
|
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator
|
||||||
@@ -748,7 +748,7 @@ cmState::Snapshot cmState::CreateBaseSnapshot()
|
|||||||
this->SnapshotData.Push(this->SnapshotData.Root());
|
this->SnapshotData.Push(this->SnapshotData.Root());
|
||||||
pos->DirectoryParent = this->SnapshotData.Root();
|
pos->DirectoryParent = this->SnapshotData.Root();
|
||||||
pos->ScopeParent = this->SnapshotData.Root();
|
pos->ScopeParent = this->SnapshotData.Root();
|
||||||
pos->SnapshotType = BaseType;
|
pos->SnapshotType = cmStateEnums::BaseType;
|
||||||
pos->Keep = true;
|
pos->Keep = true;
|
||||||
pos->BuildSystemDirectory =
|
pos->BuildSystemDirectory =
|
||||||
this->BuildsystemDirectory.Push(this->BuildsystemDirectory.Root());
|
this->BuildsystemDirectory.Push(this->BuildsystemDirectory.Root());
|
||||||
@@ -778,7 +778,7 @@ cmState::Snapshot cmState::CreateBuildsystemDirectorySnapshot(
|
|||||||
this->SnapshotData.Push(originSnapshot.Position);
|
this->SnapshotData.Push(originSnapshot.Position);
|
||||||
pos->DirectoryParent = originSnapshot.Position;
|
pos->DirectoryParent = originSnapshot.Position;
|
||||||
pos->ScopeParent = originSnapshot.Position;
|
pos->ScopeParent = originSnapshot.Position;
|
||||||
pos->SnapshotType = BuildsystemDirectoryType;
|
pos->SnapshotType = cmStateEnums::BuildsystemDirectoryType;
|
||||||
pos->Keep = true;
|
pos->Keep = true;
|
||||||
pos->BuildSystemDirectory = this->BuildsystemDirectory.Push(
|
pos->BuildSystemDirectory = this->BuildsystemDirectory.Push(
|
||||||
originSnapshot.Position->BuildSystemDirectory);
|
originSnapshot.Position->BuildSystemDirectory);
|
||||||
@@ -810,7 +810,7 @@ cmState::Snapshot cmState::CreateFunctionCallSnapshot(
|
|||||||
cmStateDetail::PositionType pos =
|
cmStateDetail::PositionType pos =
|
||||||
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
||||||
pos->ScopeParent = originSnapshot.Position;
|
pos->ScopeParent = originSnapshot.Position;
|
||||||
pos->SnapshotType = FunctionCallType;
|
pos->SnapshotType = cmStateEnums::FunctionCallType;
|
||||||
pos->Keep = false;
|
pos->Keep = false;
|
||||||
pos->ExecutionListFile = this->ExecutionListFiles.Push(
|
pos->ExecutionListFile = this->ExecutionListFiles.Push(
|
||||||
originSnapshot.Position->ExecutionListFile, fileName);
|
originSnapshot.Position->ExecutionListFile, fileName);
|
||||||
@@ -828,7 +828,7 @@ cmState::Snapshot cmState::CreateMacroCallSnapshot(
|
|||||||
{
|
{
|
||||||
cmStateDetail::PositionType pos =
|
cmStateDetail::PositionType pos =
|
||||||
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
||||||
pos->SnapshotType = MacroCallType;
|
pos->SnapshotType = cmStateEnums::MacroCallType;
|
||||||
pos->Keep = false;
|
pos->Keep = false;
|
||||||
pos->ExecutionListFile = this->ExecutionListFiles.Push(
|
pos->ExecutionListFile = this->ExecutionListFiles.Push(
|
||||||
originSnapshot.Position->ExecutionListFile, fileName);
|
originSnapshot.Position->ExecutionListFile, fileName);
|
||||||
@@ -843,7 +843,7 @@ cmState::Snapshot cmState::CreateIncludeFileSnapshot(
|
|||||||
{
|
{
|
||||||
cmStateDetail::PositionType pos =
|
cmStateDetail::PositionType pos =
|
||||||
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
||||||
pos->SnapshotType = IncludeFileType;
|
pos->SnapshotType = cmStateEnums::IncludeFileType;
|
||||||
pos->Keep = true;
|
pos->Keep = true;
|
||||||
pos->ExecutionListFile = this->ExecutionListFiles.Push(
|
pos->ExecutionListFile = this->ExecutionListFiles.Push(
|
||||||
originSnapshot.Position->ExecutionListFile, fileName);
|
originSnapshot.Position->ExecutionListFile, fileName);
|
||||||
@@ -859,7 +859,7 @@ cmState::Snapshot cmState::CreateVariableScopeSnapshot(
|
|||||||
cmStateDetail::PositionType pos =
|
cmStateDetail::PositionType pos =
|
||||||
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
||||||
pos->ScopeParent = originSnapshot.Position;
|
pos->ScopeParent = originSnapshot.Position;
|
||||||
pos->SnapshotType = VariableScopeType;
|
pos->SnapshotType = cmStateEnums::VariableScopeType;
|
||||||
pos->Keep = false;
|
pos->Keep = false;
|
||||||
pos->PolicyScope = originSnapshot.Position->Policies;
|
pos->PolicyScope = originSnapshot.Position->Policies;
|
||||||
assert(originSnapshot.Position->Vars.IsValid());
|
assert(originSnapshot.Position->Vars.IsValid());
|
||||||
@@ -876,7 +876,7 @@ cmState::Snapshot cmState::CreateInlineListFileSnapshot(
|
|||||||
{
|
{
|
||||||
cmStateDetail::PositionType pos =
|
cmStateDetail::PositionType pos =
|
||||||
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
||||||
pos->SnapshotType = InlineListFileType;
|
pos->SnapshotType = cmStateEnums::InlineListFileType;
|
||||||
pos->Keep = true;
|
pos->Keep = true;
|
||||||
pos->ExecutionListFile = this->ExecutionListFiles.Push(
|
pos->ExecutionListFile = this->ExecutionListFiles.Push(
|
||||||
originSnapshot.Position->ExecutionListFile, fileName);
|
originSnapshot.Position->ExecutionListFile, fileName);
|
||||||
@@ -890,7 +890,7 @@ cmState::Snapshot cmState::CreatePolicyScopeSnapshot(
|
|||||||
{
|
{
|
||||||
cmStateDetail::PositionType pos =
|
cmStateDetail::PositionType pos =
|
||||||
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
|
||||||
pos->SnapshotType = PolicyScopeType;
|
pos->SnapshotType = cmStateEnums::PolicyScopeType;
|
||||||
pos->Keep = false;
|
pos->Keep = false;
|
||||||
pos->BuildSystemDirectory->DirectoryEnd = pos;
|
pos->BuildSystemDirectory->DirectoryEnd = pos;
|
||||||
pos->PolicyScope = originSnapshot.Position->Policies;
|
pos->PolicyScope = originSnapshot.Position->Policies;
|
||||||
@@ -943,7 +943,7 @@ cmState::Snapshot::Snapshot(cmState* state,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
cmState::SnapshotType cmState::Snapshot::GetType() const
|
cmStateEnums::SnapshotType cmState::Snapshot::GetType() const
|
||||||
{
|
{
|
||||||
return this->Position->SnapshotType;
|
return this->Position->SnapshotType;
|
||||||
}
|
}
|
||||||
@@ -1041,18 +1041,18 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const
|
|||||||
|
|
||||||
Snapshot snapshot;
|
Snapshot snapshot;
|
||||||
cmStateDetail::PositionType parentPos = this->Position;
|
cmStateDetail::PositionType parentPos = this->Position;
|
||||||
while (parentPos->SnapshotType == cmState::PolicyScopeType ||
|
while (parentPos->SnapshotType == cmStateEnums::PolicyScopeType ||
|
||||||
parentPos->SnapshotType == cmState::VariableScopeType) {
|
parentPos->SnapshotType == cmStateEnums::VariableScopeType) {
|
||||||
++parentPos;
|
++parentPos;
|
||||||
}
|
}
|
||||||
if (parentPos->SnapshotType == cmState::BuildsystemDirectoryType ||
|
if (parentPos->SnapshotType == cmStateEnums::BuildsystemDirectoryType ||
|
||||||
parentPos->SnapshotType == cmState::BaseType) {
|
parentPos->SnapshotType == cmStateEnums::BaseType) {
|
||||||
return snapshot;
|
return snapshot;
|
||||||
}
|
}
|
||||||
|
|
||||||
++parentPos;
|
++parentPos;
|
||||||
while (parentPos->SnapshotType == cmState::PolicyScopeType ||
|
while (parentPos->SnapshotType == cmStateEnums::PolicyScopeType ||
|
||||||
parentPos->SnapshotType == cmState::VariableScopeType) {
|
parentPos->SnapshotType == cmStateEnums::VariableScopeType) {
|
||||||
++parentPos;
|
++parentPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1070,8 +1070,8 @@ cmState::Snapshot cmState::Snapshot::GetCallStackBottom() const
|
|||||||
assert(this->Position != this->State->SnapshotData.Root());
|
assert(this->Position != this->State->SnapshotData.Root());
|
||||||
|
|
||||||
cmStateDetail::PositionType pos = this->Position;
|
cmStateDetail::PositionType pos = this->Position;
|
||||||
while (pos->SnapshotType != cmState::BaseType &&
|
while (pos->SnapshotType != cmStateEnums::BaseType &&
|
||||||
pos->SnapshotType != cmState::BuildsystemDirectoryType &&
|
pos->SnapshotType != cmStateEnums::BuildsystemDirectoryType &&
|
||||||
pos != this->State->SnapshotData.Root()) {
|
pos != this->State->SnapshotData.Root()) {
|
||||||
++pos;
|
++pos;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,21 @@ struct PolicyStackEntry;
|
|||||||
typedef cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator PositionType;
|
typedef cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator PositionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace cmStateEnums {
|
||||||
|
|
||||||
|
enum SnapshotType
|
||||||
|
{
|
||||||
|
BaseType,
|
||||||
|
BuildsystemDirectoryType,
|
||||||
|
FunctionCallType,
|
||||||
|
MacroCallType,
|
||||||
|
IncludeFileType,
|
||||||
|
InlineListFileType,
|
||||||
|
PolicyScopeType,
|
||||||
|
VariableScopeType
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
class cmState
|
class cmState
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -37,18 +52,6 @@ public:
|
|||||||
cmState();
|
cmState();
|
||||||
~cmState();
|
~cmState();
|
||||||
|
|
||||||
enum SnapshotType
|
|
||||||
{
|
|
||||||
BaseType,
|
|
||||||
BuildsystemDirectoryType,
|
|
||||||
FunctionCallType,
|
|
||||||
MacroCallType,
|
|
||||||
IncludeFileType,
|
|
||||||
InlineListFileType,
|
|
||||||
PolicyScopeType,
|
|
||||||
VariableScopeType
|
|
||||||
};
|
|
||||||
|
|
||||||
class Directory;
|
class Directory;
|
||||||
|
|
||||||
class Snapshot
|
class Snapshot
|
||||||
@@ -75,7 +78,7 @@ public:
|
|||||||
Snapshot GetBuildsystemDirectoryParent() const;
|
Snapshot GetBuildsystemDirectoryParent() const;
|
||||||
Snapshot GetCallStackParent() const;
|
Snapshot GetCallStackParent() const;
|
||||||
Snapshot GetCallStackBottom() const;
|
Snapshot GetCallStackBottom() const;
|
||||||
SnapshotType GetType() const;
|
cmStateEnums::SnapshotType GetType() const;
|
||||||
|
|
||||||
void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
|
void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
|
||||||
cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id) const;
|
cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user