stromx  0.8.0
Public Types | Public Member Functions | List of all members
stromx::runtime::Description Class Reference

Abstract description of an ID to variant map. More...

#include <Description.h>

Inheritance diagram for stromx::runtime::Description:
stromx::runtime::ConnectorDescription stromx::runtime::Parameter stromx::runtime::Input stromx::runtime::Output stromx::runtime::NumericParameter< runtime::stromx::runtime::Primitive > stromx::runtime::EnumParameter stromx::runtime::MatrixParameter stromx::runtime::NumericParameter< data_t > stromx::runtime::ParameterGroup

Public Types

enum  Type { NO_TYPE, PARAMETER, INPUT, OUTPUT }
 
enum  UpdateBehavior { PERSISTENT, PUSH, PULL, INTERNAL }
 

Public Member Functions

 Description (const unsigned int id, const VariantHandle &variant)
 
const std::string & title () const
 
unsigned int id () const
 
const VariantHandlevariant () const
 
void setTitle (const std::string &title)
 
const VariantHandlevisualization () const
 
void setVisualization (const VariantHandle &visualization)
 
virtual const Datamax () const
 
virtual const Datamin () const
 
virtual const Datastep () const
 
virtual const std::vector< EnumDescription > & descriptions () const
 
virtual unsigned int rows () const
 
virtual unsigned int cols () const
 
virtual Type originalType () const
 
virtual Type currentType () const
 

Detailed Description

Abstract description of an ID to variant map.

Instances of this class associate an ID with a data variant. Moreover the contain meta information of the data characterized by this mapping. Input connectors, output connectors and parameters of operators are characterized by such a description. In case of input and output nodes the data variant defines which data type can be passed to an input node or is to be expected from an output node. In case of parameter it characterizes the data type of the respective paramter. In addition, a Description can have a name which is purely informal and does not have any influence on its behavior.

Member Enumeration Documentation

§ Type

Different types objects which are annotated by an description.

Enumerator
NO_TYPE 

Undefined type.

PARAMETER 

Operator parameter.

INPUT 

Input connector.

OUTPUT 

Output connector.

§ UpdateBehavior

The update behavior of operator parameters.

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.

Constructor & Destructor Documentation

§ Description()

stromx::runtime::Description::Description ( const unsigned int  id,
const VariantHandle variant 
)

Constructs a description.

Member Function Documentation

§ cols()

virtual unsigned int stromx::runtime::Description::cols ( ) const
inlinevirtual

Returns the required number of columns of a matrix parameters. Returns 0 if any number of columns is possible.

Reimplemented in stromx::runtime::ConnectorDescription, and stromx::runtime::MatrixParameter.

§ currentType()

virtual Type stromx::runtime::Description::currentType ( ) const
inlinevirtual

Input and output connectors can be configured to act as operator parameters. Such a connector is listed as an operator parameter. The current type always refers to way the connector is currently configured, i.e. possibly as a parameter.

Reimplemented in stromx::runtime::Parameter, stromx::runtime::Input, and stromx::runtime::Output.

§ descriptions()

virtual const std::vector<EnumDescription>& stromx::runtime::Description::descriptions ( ) const
inlinevirtual

Returns the possible values of an enumeration value or an empty vector.

Reimplemented in stromx::runtime::EnumParameter.

§ id()

unsigned int stromx::runtime::Description::id ( ) const
inline

Returns the ID.

§ max()

virtual const Data& stromx::runtime::Description::max ( ) const
inlinevirtual

Returns the maximal value of this data value or an instance of None.

Reimplemented in stromx::runtime::NumericParameter< data_t >, and stromx::runtime::NumericParameter< runtime::stromx::runtime::Primitive >.

§ min()

virtual const Data& stromx::runtime::Description::min ( ) const
inlinevirtual

Returns the minimal value of this data value or an instance of None.

Reimplemented in stromx::runtime::NumericParameter< data_t >, and stromx::runtime::NumericParameter< runtime::stromx::runtime::Primitive >.

§ originalType()

virtual Type stromx::runtime::Description::originalType ( ) const
inlinevirtual

Input and output connectors can be configured to act as operator parameters. Such a connector is listed as an operator parameter. Its original type however remains that of a connector and signals the client that the parameter can be configured back to a connector if necessary.

Reimplemented in stromx::runtime::Parameter, stromx::runtime::Input, and stromx::runtime::Output.

§ rows()

virtual unsigned int stromx::runtime::Description::rows ( ) const
inlinevirtual

Returns the required number of rows of a matrix parameters. Returns 0 if any number of rows is possible.

Reimplemented in stromx::runtime::ConnectorDescription, and stromx::runtime::MatrixParameter.

§ setTitle()

void stromx::runtime::Description::setTitle ( const std::string &  title)
inline

Sets the title of the description.

§ setVisualization()

void stromx::runtime::Description::setVisualization ( const VariantHandle visualization)

Sets the visualization of this description.

§ step()

virtual const Data& stromx::runtime::Description::step ( ) const
inlinevirtual

Returns a useful step size to decrease or increase the value of this parameter. Returns NONE if no step size is defined for this parameter.

Reimplemented in stromx::runtime::NumericParameter< data_t >, and stromx::runtime::NumericParameter< runtime::stromx::runtime::Primitive >.

§ title()

const std::string& stromx::runtime::Description::title ( ) const
inline

Returns the title.

§ variant()

const VariantHandle& stromx::runtime::Description::variant ( ) const
inline

Returns the data variant of this value.

§ visualization()

const VariantHandle& stromx::runtime::Description::visualization ( ) const
inline

Returns how this data value should be visualized or an instance of Variant::None.


The documentation for this class was generated from the following files: