Dynamic access interface for FIELD-valued parameters.
More...
#include <fieldParametersD.h>
|
| virtual | ~AbstractParameters ()=default |
| |
| template<concepts::Field FIELD> |
| bool | provides () const |
| |
| template<concepts::Field FIELD> |
| auto | get () const |
| |
| template<concepts::Field FIELD> |
| auto | getOrFallback (typename ParameterD< T, DESCRIPTOR, FIELD >::data_t &&fallback) const |
| |
| template<concepts::Field FIELD> |
| void | set (FieldD< T, DESCRIPTOR, FIELD > &&value) |
| |
| template<concepts::Field FIELD> |
| void | set (const FieldD< T, DESCRIPTOR, FIELD > &value) |
| |
template<concepts::BaseType T, concepts::Descriptor DESCRIPTOR>
struct olb::AbstractParameters< T, DESCRIPTOR >
Dynamic access interface for FIELD-valued parameters.
Definition at line 82 of file fieldParametersD.h.
◆ ~AbstractParameters()
template<concepts::BaseType T, concepts::Descriptor DESCRIPTOR>
◆ get()
template<concepts::BaseType T, concepts::Descriptor DESCRIPTOR>
template<concepts::Field FIELD>
Definition at line 95 of file fieldParametersD.h.
95 {
96 if (auto concrete = dynamic_cast<const ParameterD<T,DESCRIPTOR,FIELD>*>(this)) {
97 return concrete->read();
98 } else {
99 throw std::invalid_argument("FIELD not provided by this parameter set");
100 }
101 };
◆ getOrFallback()
template<concepts::BaseType T, concepts::Descriptor DESCRIPTOR>
template<concepts::Field FIELD>
Definition at line 104 of file fieldParametersD.h.
104 {
105 if (auto concrete = dynamic_cast<const ParameterD<T,DESCRIPTOR,FIELD>*>(this)) {
106 return concrete->read();
107 } else {
108 return fallback;
109 }
110 }
◆ provides()
template<concepts::BaseType T, concepts::Descriptor DESCRIPTOR>
template<concepts::Field FIELD>
Definition at line 86 of file fieldParametersD.h.
86 {
87 if (auto concrete = dynamic_cast<const ParameterD<T,DESCRIPTOR,FIELD>*>(this)) {
88 return true;
89 } else {
90 return false;
91 }
92 };
◆ set() [1/2]
template<concepts::BaseType T, concepts::Descriptor DESCRIPTOR>
template<concepts::Field FIELD>
Definition at line 122 of file fieldParametersD.h.
122 {
123 if (auto concrete = dynamic_cast<ParameterD<T,DESCRIPTOR,FIELD>*>(this)) {
124 return concrete->write(value);
125 } else {
126 throw std::invalid_argument("FIELD not provided by this parameter set");
127 }
128 };
◆ set() [2/2]
template<concepts::BaseType T, concepts::Descriptor DESCRIPTOR>
template<concepts::Field FIELD>
Definition at line 113 of file fieldParametersD.h.
113 {
114 if (auto concrete = dynamic_cast<ParameterD<T,DESCRIPTOR,FIELD>*>(this)) {
115 return concrete->write(std::forward<decltype(value)>(value));
116 } else {
117 throw std::invalid_argument("FIELD not provided by this parameter set");
118 }
119 };
The documentation for this struct was generated from the following file: