cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
help.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_PARAMETER_HELP_H
4#define pRC_CORE_PARAMETER_HELP_H
5
9
10namespace pRC
11{
12 template<class... Ps>
13 static inline constexpr auto help(Ps &&...parameters)
14 {
15 Logging::log("Compile Time Parameters:");
16
17 auto const printCompileTime = [](auto const &parameter)
18 {
19 if constexpr(typename RemoveReference<
20 decltype(parameter)>::Context() ==
22 {
23 Logging::log(" ", parameter.name() + ":",
24 parameter.argument() + "=<" +
25 name<typename RemoveReference<
26 decltype(parameter)>::Type>() +
27 ">");
28 if(parameter.description().size())
29 {
30 Logging::log(" ", parameter.description());
31 }
32 }
33 };
34 (printCompileTime(parameters), ...);
35
36 Logging::log("");
37 Logging::log("Run Time Parameters:");
38
39 auto const printRunTime = [](auto const &parameter)
40 {
41 if constexpr(typename RemoveReference<
42 decltype(parameter)>::Context() ==
44 {
45 Logging::log(" ", parameter.name() + ":",
46 parameter.argument(),
47 "<" +
48 name<typename RemoveReference<
49 decltype(parameter)>::Type>() +
50 ">");
51 if(parameter.description().size())
52 {
53 Logging::log(" ", parameter.description());
54 }
55 }
56 };
57 (printRunTime(parameters), ...);
58
59 Logging::log("");
60 }
61}
62#endif // pRC_CORE_PARAMETER_HELP_H
static void log(X &&arg, Xs &&...args)
Definition io.hpp:17
Definition cholesky.hpp:10
std::remove_reference_t< T > RemoveReference
Definition basics.hpp:41
static constexpr auto help(Ps &&...parameters)
Definition help.hpp:13
static constexpr auto parameter(A &&argument, N &&name, D &&description, T const &defaultValue)
Definition parameter.hpp:216
static constexpr auto name()
Definition type_name.hpp:11
Context
Definition context.hpp:9