Skip to content

LeafElement

template <class Derived, typename ValueType> class LeafElement : public GenericElement<Derived>

The LeafElement represents a leaf and can be of any (supported) type

Functions

Name Description
unit The unit method serves for setting up a name for units unitName : The name describing units Return : reference to the Element (to allow method's chaining)
metricPrefix The metricPrefix describes the metric for the unit (e.g. milli, mega, femto, etc.) metricPrefix : The metric prefix Return : reference to the Element (to allow method's chaining)
allowedStates The allowedStates method serves for setting up allowed states for the element states : A string describing list of possible states. sep : A separator symbol used for parsing previous argument for list of states Return : reference to the Element (to allow method's chaining)
assignmentMandatory The assignmentMandatory method serves for setting up a mode that requires the value of the element always being specified.
assignmentOptional The assignmentOptional method serves for setting up a mode that allows the value of element be optional, so it can be omitted in configuration.
assignmentInternal The assignmentInternal method serves for setting up the element to be internal.
init The init method serves for setting up an access type property that allows the element to be included in initial schema.
reconfigurable The reconfigurable method serves for setting up an access type property that allows the element to be included in initial, reconfiguration and monitoring schemas.
readOnly The readOnly method serves for setting up an access type property that allows the element to be included in monitoring schema only.
daqPolicy The daqPolicy sets the DAQ policy for a parameter.

Function Details

allowedStates

Derived& allowedStates(const std::vector<karabo::data::State>& value)

The allowedStates method serves for setting up allowed states for the element

states : A string describing list of possible states.

sep : A separator symbol used for parsing previous argument for list of states

Return : reference to the Element (to allow method's chaining)

assignmentInternal

virtual DefaultValue<Derived, ValueType>& assignmentInternal()

The assignmentInternal method serves for setting up the element to be internal. In the code it behaves like optional parameter but it is not exposed to the user. It is omitted when the schema is serialized to XSD. The value of this parameter should be defined programmatically. Conceptually, internal parameter with internal flag can be treated as an argument to the constructor.

Return : reference to DefaultValue (to allow method's chaining)

assignmentMandatory

virtual Derived& assignmentMandatory()

The assignmentMandatory method serves for setting up a mode that requires the value of the element always being specified. No default value is possible.

Return : reference to the Element (to allow method's chaining)

assignmentOptional

virtual DefaultValue<Derived, ValueType>& assignmentOptional()

The assignmentOptional method serves for setting up a mode that allows the value of element be optional, so it can be omitted in configuration. Default value is injected if defined. If you chain functions for definition of expected parameters the next function may be only defaultValue or noDefaultValue. When the default value is not specified (noDefaultValue) you must always check if the parameter has a value set in delivered User configuration.

Return : reference to DefaultValue object allowing proper defaultValue method chaining.

Example:

SOME_ELEMENT(expected)
        ...
        .assignmentOptional().defaultValue("client")
        ...
        .commit();

daqPolicy

virtual Derived& daqPolicy(const DAQPolicy& policy)

The daqPolicy sets the DAQ policy for a parameter.

Return : reference to the Element (to allow method's chaining)

init

virtual Derived& init()

The init method serves for setting up an access type property that allows the element to be included in initial schema.

Return : reference to the Element (to allow method's chaining)

metricPrefix

Derived& metricPrefix(const MetricPrefixType& metricPrefix)

The metricPrefix describes the metric for the unit (e.g. milli, mega, femto, etc.)

metricPrefix : The metric prefix

Return : reference to the Element (to allow method's chaining)

readOnly

virtual ReadOnlySpecific<Derived, ValueType>& readOnly()

The readOnly method serves for setting up an access type property that allows the element to be included in monitoring schema only.

Return : reference to the Element (to allow method's chaining)

reconfigurable

virtual Derived& reconfigurable()

The reconfigurable method serves for setting up an access type property that allows the element to be included in initial, reconfiguration and monitoring schemas.

Return : reference to the Element (to allow method's chaining)

unit

Derived& unit(const UnitType& unit)

The unit method serves for setting up a name for units

unitName : The name describing units

Return : reference to the Element (to allow method's chaining)