1 #ifndef FUNCTIONNAL_API_H
2 #define FUNCTIONNAL_API_H
85 typename std::remove_reference<T>::type
180 : fct(other.fct->copy()) {
210 fct = other.fct->copy();
348 template<
typename Implem,
typename R,
typename... Args>
358 std::tuple<const FctWrapper<Args>...>
args;
382 template<
typename... Fcts>
396 template<std::
size_t i>
398 return *std::get<i>(
args);
422 template<std::
size_t i>
423 typename std::tuple_element<i, decltype(
args)>::type::Type
call(
led l,
time t)
const {
424 return (*std::get<i>(
args))(l, t);
432 return new Implem(
static_cast<const Implem&
>(*
this));
450 template<
typename To,
typename From>
465 : f(std::move(from)) {}
468 return (*this->f)(l, t);
498 template<
typename To,
typename From>
Definition: function.h:97
T operator()(led, time) const override
Definition: function.h:116
Constant< T > * copy() const override
Definition: function.h:124
Constant(const T &value)
Definition: function.h:107
Definition: function.h:136
const base::Function< R > & operator*() const
Definition: function.h:241
FctWrapper(R value)
Definition: function.h:167
FctWrapper(FctWrapper< R > &&other)
Definition: function.h:191
FctWrapper & operator=(FctWrapper< R > &&other)
Definition: function.h:225
const base::Function< R > & get() const
Definition: function.h:248
FctWrapper(const base::Function< R > &fct)
Definition: function.h:158
~FctWrapper()
Definition: function.h:258
FctWrapper & operator=(const FctWrapper< R > &other)
Definition: function.h:207
R Type
Definition: function.h:144
FctWrapper(const FctWrapper< R > &other)
Definition: function.h:179
Definition: function.h:349
base::Function< R > * copy() const override
Definition: function.h:431
Function(Fcts &&... fcts)
Definition: function.h:383
std::tuple< const FctWrapper< Args >... > args
Definition: function.h:358
std::tuple_element< i, decltype(args)>::type::Type call(led l, time t) const
Definition: function.h:423
const base::Function< typename std::tuple_element< i, decltype(args)>::type::Type > & arg() const
Definition: function.h:397
Definition: function.h:33
R Type
Definition: function.h:38
virtual Function< R > * copy() const =0
virtual R operator()(led l, time t) const =0
Definition: function.h:451
Cast(base::Function< From > &&from)
Definition: function.h:464
Cast(const base::Function< From > &from)
Definition: function.h:459
To operator()(led l, time t) const override
Definition: function.h:467
Cast< To, From > * copy() const override
Definition: function.h:471
Definition: animation.cpp:3
detail::Cast< To, typename std::remove_reference< From >::type::Type > Cast(From &&from)
Definition: function.h:499
unsigned long time
Definition: time.h:10
Definition: function.h:16
Definition: function.h:77
static constexpr bool value
Definition: function.h:82