cMHN
1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
pRC
prc
core
parameter
report.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSD-2-Clause
2
3
#ifndef pRC_CORE_PARAMETER_REPORT_H
4
#define pRC_CORE_PARAMETER_REPORT_H
5
6
#include <
prc/core/log/log.hpp
>
7
#include <
prc/core/parameter/parameter.hpp
>
8
9
namespace
pRC
10
{
11
template
<
class
... Ps>
12
static
inline
constexpr
auto
report
(Ps &&...parameters)
13
{
14
auto
const
print
= [](
auto
const
&
parameter
)
15
{
16
Logging::log
(
" "
,
parameter
.name() +
":"
,
parameter
.value());
17
};
18
19
Logging::log
(
"Compile Time Parameters:"
);
20
21
auto
const
printCompileTime = [&
print
](
auto
const
&
parameter
)
22
{
23
if
constexpr
(
typename
RemoveReference
<
24
decltype
(
parameter
)>
::Context
() ==
25
Context::CompileTime
)
26
{
27
print
(
parameter
);
28
}
29
};
30
(printCompileTime(parameters), ...);
31
32
Logging::log
(
""
);
33
Logging::log
(
"Run Time Parameters:"
);
34
35
auto
const
printRunTime = [&
print
](
auto
const
&
parameter
)
36
{
37
if
constexpr
(
typename
RemoveReference
<
38
decltype
(
parameter
)>
::Context
() ==
39
Context::RunTime
)
40
{
41
print
(
parameter
);
42
}
43
};
44
(printRunTime(parameters), ...);
45
46
Logging::log
(
""
);
47
}
48
}
49
#endif
// pRC_CORE_PARAMETER_REPORT_H
log.hpp
pRC::Logging::log
static void log(X &&arg, Xs &&...args)
Definition
io.hpp:17
pRC
Definition
cholesky.hpp:10
pRC::RemoveReference
std::remove_reference_t< T > RemoveReference
Definition
basics.hpp:41
pRC::print
static auto print(String< N > const &string, std::FILE *stream)
Definition
print.hpp:18
pRC::report
static constexpr auto report(Ps &&...parameters)
Definition
report.hpp:12
pRC::parameter
static constexpr auto parameter(A &&argument, N &&name, D &&description, T const &defaultValue)
Definition
parameter.hpp:216
pRC::Context
Context
Definition
context.hpp:9
pRC::Context::CompileTime
@ CompileTime
pRC::Context::RunTime
@ RunTime
parameter.hpp
Generated by
1.11.0