1 #ifndef MF_FLOW_FILTER_PARAMETER_H_
2 #define MF_FLOW_FILTER_PARAMETER_H_
8 namespace mf {
namespace flow {
10 template<
typename Value>
17 std::function<function_type> function_;
29 bool is_defined() const noexcept {
return !! function_; }
32 if(!
is_defined())
throw std::runtime_error(
"node parameter is undefined");
33 else return function_(t);
37 function_ = [constant_value](
time_unit i) {
return constant_value; };
40 template<
typename Function>
std::ptrdiff_t time_unit
Discrete time unit type.
Definition: common.h:52
filter_parameter(const Value &constant_value)
Definition: filter_parameter.h:25
void set_mirror(const filter_parameter ¶m)
Definition: filter_parameter.h:45
Value value_type
Definition: filter_parameter.h:13
bool is_defined() const noexcept
Definition: filter_parameter.h:29
void set_constant(const Value &constant_value)
Definition: filter_parameter.h:36
void set_time_function(Function &&func)
Definition: filter_parameter.h:41
value_type get(time_unit t) const
Definition: filter_parameter.h:31
Value(time_unit t) function_type
Definition: filter_parameter.h:14
Definition: filter_parameter.h:11
void unset()
Definition: filter_parameter.h:49
filter_parameter()=default