![]() |
stromx
0.7.0
|
Description of a parameter. More...
#include <Parameter.h>
Public Types | |
| enum | AccessMode { NO_ACCESS, NONE_READ, NONE_WRITE, INITIALIZED_READ, INITIALIZED_WRITE, ACTIVATED_WRITE } |
| enum | UpdateBehavior { PERSISTENT, PUSH, PULL, INTERNAL } |
Public Member Functions | |
| Parameter (const unsigned int id, const VariantHandle &variant, ParameterGroup *const group=0) | |
| AccessMode | accessMode () const |
| void | setAccessMode (const AccessMode mode) |
| UpdateBehavior | updateBehavior () const |
| void | setUpdateBehavior (const UpdateBehavior behavior) |
| virtual const Parameter * | group () const |
| virtual const std::vector < const Parameter * > & | members () const |
Public Member Functions inherited from stromx::runtime::DescriptionBase | |
| DescriptionBase (const unsigned int id, const VariantHandle &variant) | |
| const std::string & | title () const |
| unsigned int | id () const |
| const VariantHandle & | variant () const |
| void | setTitle (const std::string &title) |
| const VariantHandle & | visualization () const |
| void | setVisualization (const VariantHandle &visualization) |
| virtual const Data & | max () const |
| virtual const Data & | min () const |
| virtual const Data & | step () const |
| virtual const std::vector < EnumDescription > & | descriptions () const |
| virtual unsigned int | rows () const |
| virtual unsigned int | cols () const |
Description of a parameter.
In addition to the information stored in the parent class parameter descriptions store information about the access mode of a given parameter. Moreover, parameter groups are supported.
The possible access modes of a parameter.
| Status | None | Intialized | Active | Executing |
| NO_ACCESS | - | - | - | - |
| NONE_READ | R | R | R | R |
| NONE_WRITE | R/W | R | R | R |
| INITIALIZED_READ | - | R | R | R |
| INITIALIZED_WRITE | - | R/W | R | R |
| ACTIVATED_WRITE | - | R/W | R/W | R/W |
| Enumerator | |
|---|---|
| NO_ACCESS |
The parameter can never be accessed. |
| NONE_READ |
The parameter can be read during each status of the operator. |
| NONE_WRITE |
The parameter can be read during each status of the operator. It can be written during the status Operator::NONE. |
| INITIALIZED_READ |
The parameter can be read during the status Operator::INITIALIZED, Operator::ACTIVE and Operator::EXECUTING. |
| INITIALIZED_WRITE |
This parameter can be read during the status Operator::INITIALIZED, Operator::ACTIVE and Operator::EXECUTING. It can be written during the status Operator::INITIALIZED. |
| ACTIVATED_WRITE |
This parameter can be read during the status Operator::INITIALIZED, Operator::ACTIVE and Operator::EXECUTING. It can be written during the status Operator::INITIALIZED, Operator::ACTIVE and Operator::EXECUTING. |
| Enumerator | |
|---|---|
| PERSISTENT |
The value of this parameter will only change when it is explicitly set by Operator::setParameter(). In general, it is not necessary to set a persistent parameter to the same value more than once as it will hold the correct value after the first change. In the same spirit a read value can be considered to be "real" value until the parameter is changed by the user. This is the default behavior of parameters. |
| PUSH |
The value of this parameter can be set but reading the parameter does not necessarily return a meaningful result. E.g. setting a trigger parameter causes an action to be performed whenever the parameter is set. In general it makes sense set send parameters more than once. |
| PULL |
Snapshots of the value of this parameter can be read but setting it does not have a meaningful effect. E.g. the current state of a classifier operator which learns while being executed could be queried from a pull parameters. In general it makes to frequently read receive parameters. |
| INTERNAL |
This parameter is only internally used by the operator. It makes no sense to read or write its values from outside. In a GUI an internal parameter would not be displayed. |
| stromx::runtime::Parameter::Parameter | ( | const unsigned int | id, |
| const VariantHandle & | variant, | ||
| ParameterGroup *const | group = 0 |
||
| ) |
Constructs a parameter description.
|
inline |
Returns the access mode.
|
inlinevirtual |
Returns the group the parameter belongs to. Returns 0 if the parameter does not belong to any group.
|
inlinevirtual |
Returns the members of this parameter group. If the parameter is not a parameter group or it has no members the returned list is empty.
Reimplemented in stromx::runtime::ParameterGroup.
|
inline |
Sets the access mode.
|
inline |
Sets the update behavior.
|
inline |
Returns the update behavior. The update behavior describes when the value of an operator might be updated parameter by either an action from the client (i.e. Operator::setParameter()) or by the operator itself.
1.8.8