Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chaofan Chen
ogs
Commits
27d27001
Commit
27d27001
authored
9 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[BL] move checkAndInvalidate()
The access now must be done through some non-member functions.
parent
ca43f661
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
BaseLib/ConfigTreeNew.cpp
+16
-0
16 additions, 0 deletions
BaseLib/ConfigTreeNew.cpp
BaseLib/ConfigTreeNew.h
+28
-7
28 additions, 7 deletions
BaseLib/ConfigTreeNew.h
with
44 additions
and
7 deletions
BaseLib/ConfigTreeNew.cpp
+
16
−
0
View file @
27d27001
...
@@ -246,4 +246,20 @@ ConfigTreeNew::checkAndInvalidate()
...
@@ -246,4 +246,20 @@ ConfigTreeNew::checkAndInvalidate()
_tree
=
nullptr
;
_tree
=
nullptr
;
}
}
void
checkAndInvalidate
(
ConfigTreeNew
&
conf
)
{
conf
.
checkAndInvalidate
();
}
void
checkAndInvalidate
(
ConfigTreeNew
*
const
conf
)
{
if
(
conf
)
conf
->
checkAndInvalidate
();
}
void
checkAndInvalidate
(
std
::
unique_ptr
<
ConfigTreeNew
>
const
&
conf
)
{
if
(
conf
)
conf
->
checkAndInvalidate
();
}
}
}
This diff is collapsed.
Click to expand it.
BaseLib/ConfigTreeNew.h
+
28
−
7
View file @
27d27001
...
@@ -15,10 +15,27 @@
...
@@ -15,10 +15,27 @@
#include
<map>
#include
<map>
#include
<functional>
#include
<functional>
#include
<memory>
namespace
BaseLib
namespace
BaseLib
{
{
class
ConfigTreeNew
;
/*! Check if \c conf has been read entirely and invalidate it.
*
* This method can savely be called on \c nullptr's.
*
* \see ConfigTreeNew::checkAndInvalidate()
*/
void
checkAndInvalidate
(
ConfigTreeNew
*
const
conf
);
//! \overload
void
checkAndInvalidate
(
std
::
unique_ptr
<
ConfigTreeNew
>
const
&
conf
);
//! \overload
void
checkAndInvalidate
(
ConfigTreeNew
&
conf
);
template
<
typename
Iterator
>
class
Range
;
template
<
typename
Iterator
>
class
Range
;
/*!
/*!
...
@@ -305,13 +322,6 @@ public:
...
@@ -305,13 +322,6 @@ public:
*/
*/
void
ignoreConfParamAll
(
std
::
string
const
&
param
)
const
;
void
ignoreConfParamAll
(
std
::
string
const
&
param
)
const
;
/*! Checks if the top level of this tree has been read entirely (and not too often).
*
* Caution: This method also invalidates the instance, i.e., afterwards it can not
* be read from the tree anymore!
*/
void
checkAndInvalidate
();
//! The destructor performs the check if all nodes at the current level of the tree
//! The destructor performs the check if all nodes at the current level of the tree
//! have been read.
//! have been read.
~
ConfigTreeNew
();
~
ConfigTreeNew
();
...
@@ -372,6 +382,13 @@ private:
...
@@ -372,6 +382,13 @@ private:
//! and the number of times it exists in the ConfigTree
//! and the number of times it exists in the ConfigTree
void
markVisitedDecrement
(
std
::
string
const
&
key
)
const
;
void
markVisitedDecrement
(
std
::
string
const
&
key
)
const
;
/*! Checks if the top level of this tree has been read entirely (and not too often).
*
* Caution: This method also invalidates the instance, i.e., afterwards it can not
* be read from the tree anymore!
*/
void
checkAndInvalidate
();
//! returns a short string at suitable for error/warning messages
//! returns a short string at suitable for error/warning messages
static
std
::
string
shortString
(
std
::
string
const
&
s
);
static
std
::
string
shortString
(
std
::
string
const
&
s
);
...
@@ -401,6 +418,10 @@ private:
...
@@ -401,6 +418,10 @@ private:
//! Set of allowed characters in a key name.
//! Set of allowed characters in a key name.
static
const
std
::
string
key_chars
;
static
const
std
::
string
key_chars
;
friend
void
checkAndInvalidate
(
ConfigTreeNew
*
const
conf
);
friend
void
checkAndInvalidate
(
ConfigTreeNew
&
conf
);
friend
void
checkAndInvalidate
(
std
::
unique_ptr
<
ConfigTreeNew
>
const
&
conf
);
};
};
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment