ah_value Documentation

template <class T>
class value
#include <ah_value.h>

a stateful variable class - simplistically

Inherits from sigslot::has_slots<>

Public Functions

void set(T x)

sets the variable to a certain value

Parameters
  • x

void silentset(T x)

sets the variable to a value and silences all signals (for this operation)

Parameters
  • x

T get(void)

returns the value of the variable

Return
the value of the variable

void setlevel(T x)

sets the trigger threshold

Parameters
  • x

T getlevel(void)

returns the value of the trigger threshold

Return
the value of the trigger threshold

void resetmaxmin(void)

resets the states of maximum and minimum during the data-logging time

T getmax(void)

returns the maximum value encountered since the start of the program or since the last call to resetmaxmin

Return
maximum value during data-logging time

T getmin(void)

returns the minimum value encountered since the start of the program or since the last call to resetmaxmin

Return
minimum value during data-logging time

T getold(void)

returns the last value before the last call to set

Return
value of variable before last call to set

Public Members

sigslot::signal0 changed

a signal that is triggered when the value changes

sigslot::signal0 levelchanged

a signal that is triggered when someone changes the trigger level

sigslot::signal0 abovelevel

a signal triggered when the value goes from below to above the trigger level

sigslot::signal0 belowlevel

a signal triggered when the value goes from above to below the trigger level

sigslot::signal0 atlevel

a signal triggered when the value goes from not equal to equal the trigger level

Private Members

T val

the value of the variable

T level

the trigger level

T max

the current maximum

T min

the current minimum

T old

the last value