#include <bn_value_template_actions.h>
template<typename Value, typename Property, class PropertyManager>
toggle_value_template_action class
Changes the property of a value when the action is updated a given number of times.
Template parameters | |
---|---|
Value | Value to modify. |
Property | Property of the value to modify. |
PropertyManager | Reads and writes the property of the value to modify. |
Constructors, destructors, conversion operators
- toggle_value_template_action(const Value& value, int duration_updates, const Property& new_property) protected
- Constructor.
- toggle_value_template_action(Value&& value, int duration_updates, const Property& new_property) protected
- Constructor.
Public functions
- void reset()
- Resets the property to its initial state.
- void update()
- Sets the property to new_property or to its initial state when the given amount of update calls are done.
- auto duration_updates() const -> int
- Returns how much times the action has to be updated to change the property.
Protected functions
- auto value() const -> const Value&
- Returns the value to modify.
- auto new_property() const -> const Property&
- Returns the new state for the property when the action is updated the given number of times.
Function documentation
template<typename Value, typename Property, class PropertyManager>
bn:: toggle_value_template_action<Value, Property, PropertyManager>:: toggle_value_template_action(const Value& value,
int duration_updates,
const Property& new_property) protected
Constructor.
Parameters | |
---|---|
value | Value to copy. |
duration_updates | How much times the action has to be updated to change the property. |
new_property | New state for the property when the action is updated duration_updates times. |
template<typename Value, typename Property, class PropertyManager>
bn:: toggle_value_template_action<Value, Property, PropertyManager>:: toggle_value_template_action(Value&& value,
int duration_updates,
const Property& new_property) protected
Constructor.
Parameters | |
---|---|
value | Value to move. |
duration_updates | How much times the action has to be updated to change the property. |
new_property | New state for the property when the action is updated duration_updates times. |