Skip to content

Restrictions

class 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 which can be passed as an attribute to the node describing the element. It works by making use of the ordered nature of the hash, allowing it to reconstruct itself from a vector.

Types

Name Description
Restriction The Restriction struct resembles an individual restriction on the OVERWRITE_ELEMENT While restrictions are set through boolean assignment, its internal data structure is a Karabo Hash.

Functions

Name Description
toVectorAttribute Returns the set of a restrictions as a vector to be set to as an attribute.
merge Merges two sets of restrictions.
assignFromAttrVector Assigns from a vector indicating restrictions.

Function Details

assignFromAttrVector

void assignFromAttrVector(const std::vector<bool>& attrs)

Assigns from a vector indicating restrictions. Order of entries is in declaration order of restrictions.

attrs :

merge

Restrictions& merge(const Restrictions& rhs)

Merges two sets of restrictions. Set restrictions from either element are preserved during the merge

rhs: : element to be merged

Return : : the merged element.

toVectorAttribute

std::vector<bool> toVectorAttribute() const

Returns the set of a restrictions as a vector to be set to as an attribute.

Return :