$darkmode
cloe::utility::contact Namespace Reference

Functions

template<typename N >
std::enable_if< std::is_integral< N >::value, N >::type round_step (N target, N increment)
 
template<typename N >
std::enable_if< std::is_floating_point< N >::value, N >::type round_step (N target, N increment)
 
template<typename D = Duration>
Switch< D > * make_switch (bool *ptr)
 
template<typename D = Duration>
PushButton< D > make_toggle (bool *ptr)
 
template<typename D = Duration, typename N >
PushButton< D > make_step (N *ptr, N single)
 
template<typename D = Duration, typename N >
PushButton< D > make_step (N *ptr, N single, N multiple)
 
template<typename D = Duration, typename N >
PushButton< D > make_round_step (N *ptr, N single)
 
template<typename D = Duration, typename N >
PushButton< D > make_round_step (N *ptr, N single, N multiple)
 
template<typename D = Duration, typename N >
PushButton< D > make_round_step_nonnegative (N *ptr, N single)
 
template<typename D = Duration, typename N >
PushButton< D > make_round_step_nonnegative (N *ptr, N single, N multiple)
 

Detailed Description

The contact namespace contains functions for creating common HMI buttons.

In very many cases, you will want to use your own definition. For this, you can see this namespace as a collection of examples, or you can even use some of the helper functions in your own definition. For example, the round_step function may be very useful for other definitions.

Function Documentation

◆ make_round_step() [1/2]

template<typename D = Duration, typename N >
PushButton<D> cloe::utility::contact::make_round_step ( N *  ptr,
single 
)

Return a push-button that increments *ptr by single every push, rounding up to multiples of single.

Here is the call graph for this function:

◆ make_round_step() [2/2]

template<typename D = Duration, typename N >
PushButton<D> cloe::utility::contact::make_round_step ( N *  ptr,
single,
multiple 
)

Return a push-button that increments *ptr by single every short push and by multiple when held down for longer period of time, rounding up by single and multiple, respectively.

Here is the call graph for this function:

◆ make_round_step_nonnegative() [1/2]

template<typename D = Duration, typename N >
PushButton<D> cloe::utility::contact::make_round_step_nonnegative ( N *  ptr,
single 
)

Return a push-button that increments *ptr by single every push, rounding up to multiples of single.

This does not decrement *ptr beyond zero.

Here is the call graph for this function:

◆ make_round_step_nonnegative() [2/2]

template<typename D = Duration, typename N >
PushButton<D> cloe::utility::contact::make_round_step_nonnegative ( N *  ptr,
single,
multiple 
)

Return a push-button that increments *ptr by single every short push and by multiple when held down for longer period of time, rounding up by single and multiple, respectively.

This does not decrement *ptr beyond zero.

Here is the call graph for this function:

◆ make_step() [1/2]

template<typename D = Duration, typename N >
PushButton<D> cloe::utility::contact::make_step ( N *  ptr,
single 
)

Return a push-button that increments *ptr by single every push.

◆ make_step() [2/2]

template<typename D = Duration, typename N >
PushButton<D> cloe::utility::contact::make_step ( N *  ptr,
single,
multiple 
)

Return a push-button that increments *ptr by single every short push and by multiple when held down for longer period of time.

◆ make_switch()

template<typename D = Duration>
Switch<D>* cloe::utility::contact::make_switch ( bool *  ptr)

Return an ON-OFF switch that reads and writes to *ptr.

The switch state can be queries with the has_contact method.

◆ make_toggle()

template<typename D = Duration>
PushButton<D> cloe::utility::contact::make_toggle ( bool *  ptr)

Return an ON-OFF toggle push-button that reads and writes to *ptr.

◆ round_step() [1/2]

template<typename N >
std::enable_if<std::is_integral<N>::value, N>::type cloe::utility::contact::round_step ( target,
increment 
)

Return the value of target incremented up to the next multiple of increment.

Restricted to the cases where N is an integral type.

Here is the caller graph for this function:

◆ round_step() [2/2]

template<typename N >
std::enable_if<std::is_floating_point<N>::value, N>::type cloe::utility::contact::round_step ( target,
increment 
)

Return the value of target incremented up to the next multiple of increment.

Restricted to the cases where N is an floating type.