OverwriteElement
class OverwriteElement
@brief The OverwriteElement allows to overwrite/redefine Element properties of an existing Element of a base class in a derived class.
Types
| Name | Description |
|---|---|
| Restrictions | This class allows to define restrictions for the OVERWRITE_ELEMENT, i.e. which attributes of a different element may not be altered through OVERWRITE. The TABLE_ELEMENT e.g. has no notion of minInc or maxInc, and these should thus not be settable to it via overwrites. The class "serializes" its options to a vector |
Functions
| Name | Description |
|---|---|
| key | Specify the key to be overwritten name : unique key name Return : reference to the Element |
| setNewDisplayedName | Set a new displayed name name : Return : |
| setNewDescription | Set a new description description : Return : |
| setNewAlias | Set a new alias alias : Return : |
| setNewTags | Set new tags tags : Return : |
| setNewAssignmentMandatory | Set to now mandatory assignment Return : |
| setNewAssignmentOptional | Set to now optional assignment Return : |
| setNewAssignmentInternal | Set to now internal assignment Return : |
| setNowInit | Set to now being configurable only upon init Return : |
| setNowReconfigurable | Set to now being reconfigurable Return : |
| setNowReadOnly | Set to now being read-only Return : |
| setNowValidate | Set to now needing validation Return : |
| setNowSkipValidation | Set to now needing skipping validation for this element Return : |
| setNewDefaultValue | Set a new default value for this element value : Return : |
| setNewMinInc | Set a new minimum inclusive restriction for values set to the element value : Return : |
| setNewMaxInc | Set a new maximum inclusive restriction for values set to the element value : Return : |
| setNewMinExc | Set a new minimum exclusive restriction for values set to the element value : Return : |
| setNewMaxExc | Set a new maximum exclusive restriction for values set to the element value : Return : |
| setNewMin | Set a new minimum restriction for values set to the element value : Return : |
| setNewMax | Set a new maximum restriction for values set to the element value : Return : |
| setNewMinSize | Set a new minimum size restriction for values set to the element value : Return : |
| setNewMaxSize | Set a new maximum size restriction for values set to the element value : Return : |
| setNewOptions | Set new allowed options for this element opts : sep : Return : |
| setNewAllowedStates | Set new allowed States for this element s1-6 : sep : Return : |
| setNowOperatorAccess | Set the element to now have operator access Return : |
| setNowExpertAccess | Set the element to now have expert access Return : |
| setNewUnit | Set a new unit to use for values of this element unit : Return : |
| setNewMetricPrefix | Set a new metric prefix to use for values of this element unit : Return : |
| setNewOverwriteRestrictions | Adds new restrictions to the element by merging with existing restrictions restrictions, : contains the new set of restrictions as determined after merging with existing ones Return : |
| commit | The commit method injects the element to the expected parameters list. |
| checkIfRestrictionApplies | Throws an exemption if the restriction in question is set restriction : |
| checkTypedBoundaries | Check default/max/min value consistency, after the value type is known Requires that m_node is not NULL |
Function Details
checkIfRestrictionApplies
void checkIfRestrictionApplies(const Restrictions::Restriction& restriction) const
Throws an exemption if the restriction in question is set
restriction
:
checkTypedBoundaries
template <typename T> void checkTypedBoundaries()
Check default/max/min value consistency, after the value type is known
Requires that m_node is not NULL
commit
void commit()
The commit method injects the element to the expected parameters list. If not called the element is not usable. This must be called after the element is fully defined.
Return : reference to the GenericElement
key
OverwriteElement& key(std::string const& name)
Specify the key to be overwritten
name
: unique key name
Return : reference to the Element
setNewAlias
template <class AliasType> OverwriteElement& setNewAlias(const AliasType& alias)
Set a new alias
alias
:
Return :
setNewAllowedStates
OverwriteElement& setNewAllowedStates(const karabo::data::State& s1)
Set new allowed States for this element
s1-6
:
sep
:
Return :
setNewAssignmentInternal
OverwriteElement& setNewAssignmentInternal()
Set to now internal assignment
Return :
setNewAssignmentMandatory
OverwriteElement& setNewAssignmentMandatory()
Set to now mandatory assignment
Return :
setNewAssignmentOptional
OverwriteElement& setNewAssignmentOptional()
Set to now optional assignment
Return :
setNewDefaultValue
template <class ValueType> OverwriteElement& setNewDefaultValue(const ValueType& value)
Set a new default value for this element
value
:
Return :
setNewDescription
OverwriteElement& setNewDescription(const std::string& description)
Set a new description
description
:
Return :
setNewDisplayedName
OverwriteElement& setNewDisplayedName(const std::string& name)
Set a new displayed name
name
:
Return :
setNewMax
template <class ValueType> OverwriteElement& setNewMax(const ValueType& value)
Set a new maximum restriction for values set to the element
value
:
Return :
setNewMaxExc
template <class ValueType> OverwriteElement& setNewMaxExc(const ValueType& value)
Set a new maximum exclusive restriction for values set to the element
value
:
Return :
setNewMaxInc
template <class ValueType> OverwriteElement& setNewMaxInc(const ValueType& value)
Set a new maximum inclusive restriction for values set to the element
value
:
Return :
setNewMaxSize
template <class ValueType> OverwriteElement& setNewMaxSize(const ValueType& value)
Set a new maximum size restriction for values set to the element
value
:
Return :
setNewMetricPrefix
OverwriteElement& setNewMetricPrefix(const MetricPrefixType& metricPrefix)
Set a new metric prefix to use for values of this element
unit
:
Return :
setNewMin
template <class ValueType> OverwriteElement& setNewMin(const ValueType& value)
Set a new minimum restriction for values set to the element
value
:
Return :
setNewMinExc
template <class ValueType> OverwriteElement& setNewMinExc(const ValueType& value)
Set a new minimum exclusive restriction for values set to the element
value
:
Return :
setNewMinInc
template <class ValueType> OverwriteElement& setNewMinInc(const ValueType& value)
Set a new minimum inclusive restriction for values set to the element
value
:
Return :
setNewMinSize
template <class ValueType> OverwriteElement& setNewMinSize(const ValueType& value)
Set a new minimum size restriction for values set to the element
value
:
Return :
setNewOptions
OverwriteElement& setNewOptions(const std::string& opts, const std::string& sep = " ,;")
Set new allowed options for this element
opts
:
sep
:
Return :
setNewOverwriteRestrictions
OverwriteElement& setNewOverwriteRestrictions(OverwriteElement::Restrictions& restrictions)
Adds new restrictions to the element by merging with existing restrictions
restrictions,
: contains the new set of restrictions as determined after merging with existing ones
Return :
setNewTags
OverwriteElement& setNewTags(const std::vector<std::string>& tags)
Set new tags
tags
:
Return :
setNewUnit
OverwriteElement& setNewUnit(const UnitType& unit)
Set a new unit to use for values of this element
unit
:
Return :
setNowExpertAccess
OverwriteElement& setNowExpertAccess()
Set the element to now have expert access
Return :
setNowInit
OverwriteElement& setNowInit()
Set to now being configurable only upon init
Return :
setNowOperatorAccess
OverwriteElement& setNowOperatorAccess()
Set the element to now have operator access
Return :
setNowReadOnly
OverwriteElement& setNowReadOnly()
Set to now being read-only
Return :
setNowReconfigurable
OverwriteElement& setNowReconfigurable()
Set to now being reconfigurable
Return :
setNowSkipValidation
OverwriteElement& setNowSkipValidation()
Set to now needing skipping validation for this element
Return :
setNowValidate
OverwriteElement& setNowValidate()
Set to now needing validation
Return :