|
| ||||||||||||||||
This class can be used to store a configuration parameter. Such parameter has a current and a default value.
| typedef XorpCallback1<void, T>::RefPtr UpdateCallback | UpdateCallback |
| explicit ConfigParam (const T& value)
| ConfigParam |
Constructor of a parameter with an initial value.
Create a configurable parameter, and initialize its initial and current value.
Parameters:
| value | the initial and current value to initialize the parameter to. |
| ConfigParam (const T& value, const UpdateCallback& update_cb)
| ConfigParam |
Constructor of a parameter with an initial value and a callback.
Create a configurable parameter, initialize it, and assign a callback method that will be invoked when the value changes.
Parameters:
| value | the initial and current value to initialize the parameter to. |
| update_cb | the callback method that will be invoked when the value changes. |
| ~ConfigParam ()
| ~ConfigParam |
[virtual]
| const T& get ()
| get |
[const]
Get the current value of the parameter.
Returns: the current value of the parameter.
| void set (const T& value)
| set |
Set the current value of the parameter.
Parameters:
| value | the current value to set the parameter to. |
| ConfigParam& operator= (const T& value)
| operator= |
Assignment operator
Parameters:
| value | the value to assign to the parameter. |
Returns: the parameter with the new value assigned.
| const T& operator++ ()
| operator++ |
Increment Operator (prefix).
The numerical value of this configuration parameter is incremented by one.
Returns: a reference to this configuration parameter after it was incremented by one.
| T operator++ (int)
| operator++ |
Increment Operator (postfix).
The numerical value of this configuration parameter is incremented by one.
Returns: the value of this configuration parameter before it was incremented by one.
| const T& incr ()
| incr |
Increment Operator.
The numerical value of this configuration parameter is incremented by one.
Returns: a reference to this configuration parameter after it was incremented by one.
| const T& operator-- ()
| operator-- |
Decrement Operator (prefix).
The numerical value of this configuration parameter is decremented by one.
Returns: a reference to this configuration parameter after it was decremented by one.
| T operator-- (int)
| operator-- |
Decrement Operator (postfix).
The numerical value of this configuration parameter is decremented by one.
Returns: the value of this configuration parameter before it was decremented by one.
| const T& decr ()
| decr |
Decrement Operator.
The numerical value of this configuration parameter is decremented by one.
Returns: a reference to this configuration parameter after it was decremented by one.
| const T& get_initial_value ()
| get_initial_value |
[const]
Get the initial value of the parameter.
| void reset ()
| reset |
Reset the current value of the parameter to its initial value.