Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
Mutator< TI > Class Template Reference

#include "lib/time/control-impl.hpp"

Description

template<class TI>
class lib::time::mutation::Mutator< TI >

Implementation building block: impose changes to a Time element.

The purpose of the Mutator is to attach a target time entity, which then will be subject to any received value changes, offsets and grid nudging. The actual attachment is to be performed in a subclass, by using the Mutation interface. When attaching to a target, the Mutator will be outfitted with a set of suitable functors, incorporating the specific behaviour for the concrete combination of input changes ("source values") and target object type. This works by binding to the appropriate implementation functionality, guided by a templated policy class. After installing these functors, these decisions remains opaque and encapsulated within the functor objects, so the mutator object doesn't need to carry this type information on the interface

Definition at line 82 of file control-impl.hpp.

Protected Member Functions

void ensure_isArmed () const
 
template<class TAR >
void bind_to (TAR &target) const
 
void unbind ()
 

Protected Attributes

ValueSetter setVal_
 
Ofsetter offset_
 
Nudger nudge_
 

Private Types

typedef function< TI(TI const &)> ValueSetter
 
typedef function< TI(Offset const &)> Ofsetter
 
typedef function< TI(int)> Nudger
 

Additional Inherited Members

- Static Public Member Functions inherited from Mutation
static EncapsulatedMutation changeTime (Time)
 Convenience factory to yield a simple Mutation changing the absolute start time.
 
static EncapsulatedMutation changeDuration (Duration)
 Convenience factory: simple Mutation to adjust the duration or length of a timespan.
 
static EncapsulatedMutation adjust (Offset)
 Convenience factory: simple Mutation to adjust the duration or length of a timespan.
 
static EncapsulatedMutation materialise (QuTime const &)
 Convenience factory: materialise the given quantised time into an explicit fixed internal time value, according to the underlying time grid; impose the resulting value then as new time point or start point to the target.
 
static EncapsulatedMutation nudge (int adjustment)
 build a time mutation to nudge the target time value by an offset, defined as number of steps on an implicit nudge grid.
 
static EncapsulatedMutation nudge (int adjustment, Symbol gridID)
 build a time mutation to nudge the target time value in steps based on a pre-defined grid.
 
- Public Member Functions inherited from Mutation
virtual ~Mutation ()
 
virtual void change (Duration &) const =0
 
virtual void change (TimeSpan &) const =0
 
virtual void change (QuTime &) const =0
 
- Static Protected Member Functions inherited from Mutation
static TimeValueimposeChange (TimeValue &, TimeValue const &)
 
static TimeValueimposeChange (TimeValue &, Offset const &)
 
static TimeValueimposeChange (TimeValue &, int)
 
static TimeValueimposeChange (QuTime &, int)
 

Member Typedef Documentation

◆ ValueSetter

template<class TI >
typedef function<TI(TI const&)> ValueSetter
private

Definition at line 85 of file control-impl.hpp.

◆ Ofsetter

template<class TI >
typedef function<TI(Offset const&)> Ofsetter
private

Definition at line 86 of file control-impl.hpp.

◆ Nudger

template<class TI >
typedef function<TI(int)> Nudger
private

Definition at line 87 of file control-impl.hpp.

Member Function Documentation

◆ ensure_isArmed()

template<class TI >
void ensure_isArmed ( ) const
inlineprotected

Definition at line 95 of file control-impl.hpp.

References Mutator< TI >::setVal_.

◆ bind_to()

template<class TI >
template<class TAR >
void bind_to ( TAR &  target) const
protected

Definition at line 177 of file control-impl.hpp.

◆ unbind()

template<class TI >
void unbind ( )
protected

Definition at line 188 of file control-impl.hpp.

Member Data Documentation

◆ setVal_

template<class TI >
ValueSetter setVal_
mutableprotected

Definition at line 90 of file control-impl.hpp.

Referenced by Mutator< TI >::ensure_isArmed().

◆ offset_

template<class TI >
Ofsetter offset_
mutableprotected

Definition at line 91 of file control-impl.hpp.

◆ nudge_

template<class TI >
Nudger nudge_
mutableprotected

Definition at line 92 of file control-impl.hpp.

+ Inheritance diagram for Mutator< TI >:
+ Collaboration diagram for Mutator< TI >:

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