pixled-lib  1.0
Public Types | Public Member Functions | List of all members
pixled::base::Function< R > Class Template Referenceabstract

#include <function.h>

Inheritance diagram for pixled::base::Function< R >:
Inheritance graph
[legend]
Collaboration diagram for pixled::base::Function< R >:
Collaboration graph
[legend]

Public Types

typedef R Type
 

Public Member Functions

virtual R operator() (led l, time t) const =0
 
virtual Function< R > * copy () const =0
 

Detailed Description

template<typename R>
class pixled::base::Function< R >

Generic Function interface, that can be used as arguments for other Functions.

Notice that Function parameters are voluntarily not fixed in this base class. This allows Functions to be used as other Functions parameters, since when a Function is passed as a parameter, the only thing that matters is its return type, that can actually be considered as the type of the parameter.

Template Parameters
Rreturn type
See also
pixled::Function

Member Typedef Documentation

◆ Type

template<typename R >
typedef R pixled::base::Function< R >::Type

Function return type.

Member Function Documentation

◆ operator()()

template<typename R >
virtual R pixled::base::Function< R >::operator() ( led  l,
time  t 
) const
pure virtual

Computes the value of this Function for led l at time t.

Parameters
lled
ttime
Returns
Result of this Function, evaluated on led l at time t. Notice that evaluating a function usually requires the recursive evaluation of other Functions (that are actually parameters of this function) until a Constant is reached for example.

Implemented in pixled::Constant< T >, pixled::signal::Sawtooth, pixled::signal::Triangle, pixled::signal::Square, pixled::signal::Sine, pixled::random::NormalDistribution< R >, pixled::random::UniformDistribution< R >, pixled::random::RandomXYT, pixled::random::RandomT, pixled::geometry::PointLine, pixled::geometry::AlphaLine, pixled::geometry::YLine, pixled::geometry::XLine, pixled::geometry::Line, pixled::geometry::AngleRad, pixled::geometry::AngleDeg, pixled::geometry::Point, pixled::geometry::LineDistance, pixled::geometry::Distance, pixled::geometry::I, pixled::geometry::Y, pixled::geometry::X, pixled::detail::Cast< To, From >, pixled::conditional::GreaterThanOrEqual< P1, P2 >, pixled::conditional::GreaterThan< P1, P2 >, pixled::conditional::LessThanOrEqual< P1, P2 >, pixled::conditional::LessThan< P1, P2 >, pixled::conditional::NotEqual< P1, P2 >, pixled::conditional::Equal< P1, P2 >, pixled::conditional::If< T >, pixled::chrono::T, pixled::chroma::rgb, pixled::chroma::hsb, pixled::arithmetic::Modulus< R, P1, P2 >, pixled::arithmetic::Divides< R, P1, P2 >, pixled::arithmetic::Multiplies< R, P1, P2 >, pixled::arithmetic::Minus< R, P1, P2 >, pixled::arithmetic::Plus< R, P1, P2 >, pixled::animation::Sequence, pixled::animation::Blink, pixled::animation::Blooming, pixled::animation::RadialRainbowWave, pixled::animation::RainbowWave, pixled::animation::Rainbow, pixled::animation::RadialUnitWave, pixled::animation::LinearUnitWave, and pixled::animation::Wave< R >.

Examples
pixled/function/function.cpp.

◆ copy()

template<typename R >
virtual Function<R>* pixled::base::Function< R >::copy ( ) const
pure virtual

Returns a dynamically allocated copy of this function.

Returns
copy of this function

Implemented in pixled::random::RandomXYT, pixled::random::RandomT, pixled::geometry::I, pixled::geometry::Y, pixled::geometry::X, pixled::detail::Cast< To, From >, pixled::Function< Implem, R, Args >, pixled::Function< Square, float, float >, pixled::Function< XLine, line, coordinate >, pixled::Function< Equal< P1, P2 >, bool, P1, P2 >, pixled::Function< Blooming, color, color, point, coordinate >, pixled::Function< Point, point, coordinate, coordinate >, pixled::Function< Blink, color, color, time >, pixled::Function< LineDistance, coordinate, line, point >, pixled::Function< AngleRad, angle, float >, pixled::Function< AlphaLine, line, point, angle >, pixled::Function< RadialRainbowWave, float, coordinate, time, point >, pixled::Function< LinearUnitWave, float, coordinate, time, line >, pixled::Function< NotEqual< P1, P2 >, bool, P1, P2 >, pixled::Function< LessThanOrEqual< P1, P2 >, bool, P1, P2 >, pixled::Function< rgb, color, uint8_t, uint8_t, uint8_t >, pixled::Function< NormalDistribution< R >, R, float, float, random_engine >, pixled::Function< PointLine, line, point, point >, pixled::Function< Plus< R, P1, P2 >, R, P1, P2 >, pixled::Function< RainbowWave, float, float, time, line >, pixled::Function< UniformDistribution< R >, R, R, R, random_engine >, pixled::Function< Divides< R, P1, P2 >, R, P1, P2 >, pixled::Function< Sawtooth, float, float >, pixled::Function< LessThan< P1, P2 >, bool, P1, P2 >, pixled::Function< GreaterThan< P1, P2 >, bool, P1, P2 >, pixled::Function< Multiplies< R, P1, P2 >, R, P1, P2 >, pixled::Function< Wave< R >, R, time, R, R >, pixled::Function< Rainbow, float, time >, pixled::Function< If< T >, T, bool, T, T >, pixled::Function< GreaterThanOrEqual< P1, P2 >, bool, P1, P2 >, pixled::Function< YLine, line, coordinate >, pixled::Function< hsb, color, float, float, float >, pixled::Function< Minus< R, P1, P2 >, R, P1, P2 >, pixled::Function< Triangle, float, float >, pixled::Function< AngleDeg, angle, float >, pixled::Function< Line, line, coordinate, coordinate, coordinate >, pixled::Function< Modulus< R, P1, P2 >, R, P1, P2 >, pixled::Function< Sine, float, float >, pixled::Function< Distance, coordinate, point, point >, pixled::Function< RadialUnitWave, float, coordinate, time, point >, pixled::Constant< T >, pixled::chrono::T, and pixled::animation::Sequence.


The documentation for this class was generated from the following file: