Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
ag-ohlberger
dune-community
dune-xt
Commits
67879bd6
Commit
67879bd6
authored
10 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[common.configuration] added ctor taking an istream
parent
1ab183fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/stuff/common/configuration.cc
+18
-0
18 additions, 0 deletions
dune/stuff/common/configuration.cc
dune/stuff/common/configuration.hh
+8
-0
8 additions, 0 deletions
dune/stuff/common/configuration.hh
with
26 additions
and
0 deletions
dune/stuff/common/configuration.cc
+
18
−
0
View file @
67879bd6
...
...
@@ -100,6 +100,17 @@ Configuration::Configuration(const Configuration& other)
{
}
Configuration
::
Configuration
(
std
::
istream
&
in
,
const
bool
record_defaults
,
const
bool
warn_on_default_access
,
const
bool
log_on_exit
,
const
std
::
string
logfile
)
:
BaseType
(
initialize
(
in
))
,
requests_map_
()
,
record_defaults_
(
record_defaults
)
,
warn_on_default_access_
(
warn_on_default_access
)
,
log_on_exit_
(
log_on_exit
)
,
logfile_
(
logfile
)
{
}
Configuration
::
Configuration
(
const
std
::
string
filename
,
const
bool
record_defaults
,
const
bool
warn_on_default_access
,
const
bool
log_on_exit
,
const
std
::
string
logfile
)
:
Configuration
::
Configuration
(
initialize
(
filename
),
record_defaults
,
warn_on_default_access
,
log_on_exit
,
logfile
)
...
...
@@ -481,6 +492,13 @@ ParameterTree Configuration::initialize(const std::string filename)
return
param_tree
;
}
// ... initialize(...)
ParameterTree
Configuration
::
initialize
(
std
::
istream
&
in
)
{
ParameterTree
param_tree
;
Dune
::
ParameterTreeParser
::
readINITree
(
in
,
param_tree
);
return
param_tree
;
}
// ... initialize(...)
ParameterTree
Configuration
::
initialize
(
int
argc
,
char
**
argv
)
{
ParameterTree
param_tree
;
...
...
This diff is collapsed.
Click to expand it.
dune/stuff/common/configuration.hh
+
8
−
0
View file @
67879bd6
...
...
@@ -117,6 +117,11 @@ public:
Configuration
(
const
Configuration
&
other
);
Configuration
(
std
::
istream
&
in
,
const
bool
record_defaults
=
internal
::
configuration_record_defaults
,
const
bool
warn_on_default_access
=
internal
::
configuration_warn_on_default_access
,
const
bool
log_on_exit
=
internal
::
configuration_log_on_exit
,
const
std
::
string
logfile
=
internal
::
configuration_logfile
);
//! read ParameterTree from file and call Configuration(const ParameterTree& tree)
explicit
Configuration
(
const
std
::
string
filename
,
const
bool
record_defaults
,
const
bool
warn_on_default_access
,
const
bool
log_on_exit
,
const
std
::
string
logfile
);
...
...
@@ -578,6 +583,9 @@ private:
//! read Dune::ParameterTree from file
static
ParameterTree
initialize
(
const
std
::
string
filename
);
//! read Dune::ParameterTree from istream
static
ParameterTree
initialize
(
std
::
istream
&
in
);
//! read Dune::ParameterTree from arguments
static
ParameterTree
initialize
(
int
argc
,
char
**
argv
);
...
...
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