openDAQ
Open data acquisition platform
PropertyBuilderPtr Class Reference

The builder interface of Properties. Allows for construction of Properties through the build method. More...

Inherits ObjectPtr< IPropertyBuilder >.

Detailed Description

The builder interface of Properties. Allows for construction of Properties through the build method.

Contains setters for the Property fields. The setters take as parameters openDAQ objects, even if the value must always evaluate to, for example, a boolean. This allows for EvalValue objects to be set instead of a static value.

The EvalValue objects can evaluate to Boolean, String, List, Unit, and Property types. and can thus be used when such types are expected from the getters.

The Property can be built by calling the build method.

Public Member Functions

daq::PropertyPtr build () const
 Builds and returns a Property using the currently set values of the Builder. More...
 
PropertyBuilderPtr setValueType (daq::CoreType type) const
 Sets the Value type of the Property. Values written to the corresponding Property value must be of the same type. More...
 
daq::CoreType getValueType () const
 Gets the Value type of the Property. More...
 
PropertyBuilderPtr setName (const daq::StringPtr &name) const
 Sets the Name of the Property. The names of Properties in a Property object must be unique. The name is used as the key to the corresponding Property value when getting/setting the value. More...
 
daq::StringPtr getName () const
 Gets the Name of the Property. More...
 
PropertyBuilderPtr setDescription (const daq::StringPtr &description) const
 Sets the short string Description of the Property. More...
 
daq::StringPtr getDescription () const
 Gets the short string Description of the Property. More...
 
PropertyBuilderPtr setUnit (const daq::UnitPtr &unit) const
 Sets the Unit of the Property. More...
 
daq::UnitPtr getUnit () const
 Gets the Unit of the Property. More...
 
PropertyBuilderPtr setMinValue (const daq::NumberPtr &min) const
 Sets the Minimum value of the Property. Available only if the Value type is ctInt or ctFloat. More...
 
daq::NumberPtr getMinValue () const
 Gets the Minimum value of the Property. Available only if the Value type is ctInt or ctFloat. More...
 
PropertyBuilderPtr setMaxValue (const daq::NumberPtr &max) const
 Sets the Maximum value of the Property. Available only if the Value type is ctInt or ctFloat. More...
 
daq::NumberPtr getMaxValue () const
 Gets the Maximum value of the Property. Available only if the Value type is ctInt or ctFloat. More...
 
PropertyBuilderPtr setDefaultValue (const daq::BaseObjectPtr &value) const
 Sets the Default value of the Property. The Default value must always be configured for a Property to be in a valid state. Exceptions are Function/Procedure and Reference properties. The function will freeze default value if it is freezable. More...
 
daq::BaseObjectPtr getDefaultValue () const
 Gets the Default value of the Property. More...
 
PropertyBuilderPtr setSuggestedValues (const daq::ListPtr< daq::IBaseObject > &values) const
 Sets the list of Suggested values. Contains values that are the optimal settings for the corresponding Property value. These values, however, are not enforced when setting a new Property value. More...
 
daq::ListPtr< daq::IBaseObject > getSuggestedValues () const
 Gets the list of Suggested values. Contains values that are the optimal gettings for the corresponding Property value. These values, however, are not enforced when getting a new Property value. More...
 
PropertyBuilderPtr setVisible (const daq::BooleanPtr &visible) const
 Used to determine whether the property is visible or not. More...
 
daq::BooleanPtr getVisible () const
 Used to determine whether the property is visible or not. More...
 
PropertyBuilderPtr setReadOnly (const daq::BooleanPtr &readOnly) const
 Used to determine whether the Property is a read-only property or not. More...
 
daq::BooleanPtr getReadOnly () const
 Used to determine whether the Property is a read-only property or not. More...
 
PropertyBuilderPtr setSelectionValues (const daq::BaseObjectPtr &values) const
 Sets the list or dictionary of selection values. If the list/dictionary is not empty, the property is a Selection property, and must have the Value type ctInt. More...
 
daq::BaseObjectPtr getSelectionValues () const
 Gets the list or dictionary of selection values. More...
 
PropertyBuilderPtr setReferencedProperty (const daq::EvalValuePtr &propertyEval) const
 Sets the referenced property. If set, all getters except for the Name, Referenced property, and Is referenced getters will return the value of the Referenced property. More...
 
daq::EvalValuePtr getReferencedProperty () const
 Gets the referenced property. More...
 
PropertyBuilderPtr setValidator (const daq::ValidatorPtr &validator) const
 Sets the validator of the Property. More...
 
daq::ValidatorPtr getValidator () const
 Gets the validator of the Property. More...
 
PropertyBuilderPtr setCoercer (const daq::CoercerPtr &coercer) const
 Sets the coercer of the Property. More...
 
daq::CoercerPtr getCoercer () const
 Gets the coercer of the Property. More...
 
PropertyBuilderPtr setCallableInfo (const daq::CallableInfoPtr &callable) const
 Sets the Callable information objects of the Property that specifies the argument and return types of the callable object stored as the Property value. More...
 
daq::CallableInfoPtr getCallableInfo () const
 Gets the Callable information objects of the Property that specifies the argument and return types of the callable object stored as the Property value. More...
 
PropertyBuilderPtr setOnPropertyValueWrite (const daq::Event< daq::PropertyObjectPtr, PropertyValueEventArgsPtr > &event) const
 Sets a custom on-write event. Used mostly when cloning properties. More...
 
daq::Event< daq::PropertyObjectPtr, daq::PropertyValueEventArgsPtr > getOnPropertyValueWrite () const
 Gets a custom on-write event. Used mostly when cloning properties. More...
 
PropertyBuilderPtr setOnPropertyValueRead (const daq::Event< daq::PropertyObjectPtr, PropertyValueEventArgsPtr > &event) const
 Sets a custom on-read event. Used mostly when cloning properties. More...
 
daq::Event< daq::PropertyObjectPtr, daq::PropertyValueEventArgsPtr > getOnPropertyValueRead () const
 Gets a custom on-read event. Used mostly when cloning properties. More...
 

Member Function Documentation

◆ build()

daq::PropertyPtr build ( ) const
inline

Builds and returns a Property using the currently set values of the Builder.

Returns
The built property.

◆ getCallableInfo()

daq::CallableInfoPtr getCallableInfo ( ) const
inline

Gets the Callable information objects of the Property that specifies the argument and return types of the callable object stored as the Property value.

Returns
The Callable info object.

◆ getCoercer()

daq::CoercerPtr getCoercer ( ) const
inline

Gets the coercer of the Property.

Returns
The coercer.

◆ getDefaultValue()

daq::BaseObjectPtr getDefaultValue ( ) const
inline

Gets the Default value of the Property.

Returns
The Default value of the Property.

◆ getDescription()

daq::StringPtr getDescription ( ) const
inline

Gets the short string Description of the Property.

Returns
The Description of the Property.

◆ getMaxValue()

daq::NumberPtr getMaxValue ( ) const
inline

Gets the Maximum value of the Property. Available only if the Value type is ctInt or ctFloat.

Returns
The Maximum value of the Property.

◆ getMinValue()

daq::NumberPtr getMinValue ( ) const
inline

Gets the Minimum value of the Property. Available only if the Value type is ctInt or ctFloat.

Returns
The Minimum value of the Property.

◆ getName()

daq::StringPtr getName ( ) const
inline

Gets the Name of the Property.

Returns
The Name of the Property.

◆ getOnPropertyValueRead()

daq::Event<daq::PropertyObjectPtr, daq::PropertyValueEventArgsPtr> getOnPropertyValueRead ( ) const
inline

Gets a custom on-read event. Used mostly when cloning properties.

Returns
The on-read event.

◆ getOnPropertyValueWrite()

daq::Event<daq::PropertyObjectPtr, daq::PropertyValueEventArgsPtr> getOnPropertyValueWrite ( ) const
inline

Gets a custom on-write event. Used mostly when cloning properties.

Returns
The on-write event.

◆ getReadOnly()

daq::BooleanPtr getReadOnly ( ) const
inline

Used to determine whether the Property is a read-only property or not.

Returns
True if the Property is a read-only property; false otherwise.

◆ getReferencedProperty()

daq::EvalValuePtr getReferencedProperty ( ) const
inline

Gets the referenced property.

Returns
The referenced property.

◆ getSelectionValues()

daq::BaseObjectPtr getSelectionValues ( ) const
inline

Gets the list or dictionary of selection values.

Returns
The list/dictionary of possible selection values.

◆ getSuggestedValues()

daq::ListPtr<daq::IBaseObject> getSuggestedValues ( ) const
inline

Gets the list of Suggested values. Contains values that are the optimal gettings for the corresponding Property value. These values, however, are not enforced when getting a new Property value.

Returns
The Suggested values of the Property.

◆ getUnit()

daq::UnitPtr getUnit ( ) const
inline

Gets the Unit of the Property.

Returns
The Unit of the Property.

◆ getValidator()

daq::ValidatorPtr getValidator ( ) const
inline

Gets the validator of the Property.

Returns
The validator.

◆ getValueType()

daq::CoreType getValueType ( ) const
inline

Gets the Value type of the Property.

Returns
The value type.

◆ getVisible()

daq::BooleanPtr getVisible ( ) const
inline

Used to determine whether the property is visible or not.

Returns
True if the Property is visible; false otherwise.

◆ setCallableInfo()

PropertyBuilderPtr setCallableInfo ( const daq::CallableInfoPtr &  callable) const
inline

Sets the Callable information objects of the Property that specifies the argument and return types of the callable object stored as the Property value.

Parameters
callableThe Callable info object.

◆ setCoercer()

PropertyBuilderPtr setCoercer ( const daq::CoercerPtr &  coercer) const
inline

Sets the coercer of the Property.

Parameters
coercerThe coercer.

Used to coerce a value written to the corresponding Property value to the constraints specified by the coercer.

◆ setDefaultValue()

PropertyBuilderPtr setDefaultValue ( const daq::BaseObjectPtr &  value) const
inline

Sets the Default value of the Property. The Default value must always be configured for a Property to be in a valid state. Exceptions are Function/Procedure and Reference properties. The function will freeze default value if it is freezable.

Parameters
valueThe Default value of the Property.

◆ setDescription()

PropertyBuilderPtr setDescription ( const daq::StringPtr &  description) const
inline

Sets the short string Description of the Property.

Parameters
descriptionThe Description of the Property.

◆ setMaxValue()

PropertyBuilderPtr setMaxValue ( const daq::NumberPtr &  max) const
inline

Sets the Maximum value of the Property. Available only if the Value type is ctInt or ctFloat.

Parameters
maxThe Maximum value of the Property.

◆ setMinValue()

PropertyBuilderPtr setMinValue ( const daq::NumberPtr &  min) const
inline

Sets the Minimum value of the Property. Available only if the Value type is ctInt or ctFloat.

Parameters
minThe Minimum value of the Property.

◆ setName()

PropertyBuilderPtr setName ( const daq::StringPtr &  name) const
inline

Sets the Name of the Property. The names of Properties in a Property object must be unique. The name is used as the key to the corresponding Property value when getting/setting the value.

Parameters
nameThe Name of the Property.

◆ setOnPropertyValueRead()

PropertyBuilderPtr setOnPropertyValueRead ( const daq::Event< daq::PropertyObjectPtr, PropertyValueEventArgsPtr > &  event) const
inline

Sets a custom on-read event. Used mostly when cloning properties.

Parameters
eventThe on-read event.

◆ setOnPropertyValueWrite()

PropertyBuilderPtr setOnPropertyValueWrite ( const daq::Event< daq::PropertyObjectPtr, PropertyValueEventArgsPtr > &  event) const
inline

Sets a custom on-write event. Used mostly when cloning properties.

Parameters
eventThe on-write event.

◆ setReadOnly()

PropertyBuilderPtr setReadOnly ( const daq::BooleanPtr &  readOnly) const
inline

Used to determine whether the Property is a read-only property or not.

Parameters
readOnlyTrue if the Property is a read-only property; false otherwise.

Read-only Property values can still be modified by using the PropertyObjectProtected interface methods.

◆ setReferencedProperty()

PropertyBuilderPtr setReferencedProperty ( const daq::EvalValuePtr &  propertyEval) const
inline

Sets the referenced property. If set, all getters except for the Name, Referenced property, and Is referenced getters will return the value of the Referenced property.

Parameters
propertyEvalThe referenced property.

If the Property is not bound to a Property object this call will not be able to return the Referenced property.

◆ setSelectionValues()

PropertyBuilderPtr setSelectionValues ( const daq::BaseObjectPtr &  values) const
inline

Sets the list or dictionary of selection values. If the list/dictionary is not empty, the property is a Selection property, and must have the Value type ctInt.

Parameters
valuesThe list/dictionary of possible selection values.

◆ setSuggestedValues()

PropertyBuilderPtr setSuggestedValues ( const daq::ListPtr< daq::IBaseObject > &  values) const
inline

Sets the list of Suggested values. Contains values that are the optimal settings for the corresponding Property value. These values, however, are not enforced when setting a new Property value.

Parameters
valuesThe Suggested values of the Property.

◆ setUnit()

PropertyBuilderPtr setUnit ( const daq::UnitPtr &  unit) const
inline

Sets the Unit of the Property.

Parameters
unitThe Unit of the Property.

◆ setValidator()

PropertyBuilderPtr setValidator ( const daq::ValidatorPtr &  validator) const
inline

Sets the validator of the Property.

Parameters
validatorThe validator.

Used to validate whether a value written to the corresponding Property value is valid or not.

◆ setValueType()

PropertyBuilderPtr setValueType ( daq::CoreType  type) const
inline

Sets the Value type of the Property. Values written to the corresponding Property value must be of the same type.

Parameters
typeThe value type.

◆ setVisible()

PropertyBuilderPtr setVisible ( const daq::BooleanPtr &  visible) const
inline

Used to determine whether the property is visible or not.

Parameters
visibleTrue if the Property is visible; false otherwise.