openDAQ
Open data acquisition platform
FunctionBlockWrapperPtr Class Reference

Enables to change the configuration behaviour of a function block. More...

Inherits ObjectPtr< IFunctionBlockWrapper >.

Detailed Description

Enables to change the configuration behaviour of a function block.

Function block wrapper is used when a parent function block creates a child function block. Often it is required that the child function block does not expose all configuration features to the client SDK code. Some configuration is performed by the parent function block. Therefore it is required that the parent function block is able to hide and/or change configuration parameters of the child function block.

The parent function block should create an instance of a function block wrapper to modify the configuration interface of the child function block. The original function block is passed as a parameter to factory function. The parent function block should configure access to the original child function block using the functions on function block wrapper. Then it should publish the wrapped function block.

Public Member Functions

void includeInputPort (const daq::StringPtr &inputPortName) const
 Includes the input port to a list of input ports on the function block. More...
 
void excludeInputPort (const daq::StringPtr &inputPortName) const
 Excludes the input port from a list of input ports on the function block. More...
 
void includeSignal (const daq::StringPtr &signalLocalId) const
 Includes the signal to a list of signals on the function block. More...
 
void excludeSignal (const daq::StringPtr &signalLocalId) const
 Excludes the signal from a list of signals on the function block. More...
 
void includeProperty (const daq::StringPtr &propertyName) const
 Includes the property to a list of visible properties on the function block. More...
 
void excludeProperty (const daq::StringPtr &propertyName) const
 Excludes the property from a list of visible properties on the function block. More...
 
void includeFunctionBlock (const daq::StringPtr &functionBlockLocalId) const
 Includes the function block to a list of sub-function blocks on the function block. More...
 
void excludeFunctionBlock (const daq::StringPtr &functionBlockLocalId) const
 Excludes the function block from a list of sub-function blocks on the function block. More...
 
void setPropertyCoercer (const daq::StringPtr &propertyName, const daq::CoercerPtr &coercer) const
 Sets a custom coercer for the property. More...
 
void setPropertyValidator (const daq::StringPtr &propertyName, const daq::ValidatorPtr &validator) const
 Sets a custom validator for the property. More...
 
void setPropertySelectionValues (const daq::StringPtr &propertyName, const daq::ListPtr< daq::IString > &enumValues) const
 Sets a list of accepted selection values. More...
 
daq::FunctionBlockPtr getWrappedFunctionBlock () const
 Returns the wrapped function block which was passed as a parameter to the constructor/factory. More...
 

Member Function Documentation

◆ excludeFunctionBlock()

void excludeFunctionBlock ( const daq::StringPtr &  functionBlockLocalId) const
inline

Excludes the function block from a list of sub-function blocks on the function block.

Parameters
functionBlockLocalIdThe local id of the function block.

◆ excludeInputPort()

void excludeInputPort ( const daq::StringPtr &  inputPortName) const
inline

Excludes the input port from a list of input ports on the function block.

Parameters
inputPortNameThe name of the input port.

◆ excludeProperty()

void excludeProperty ( const daq::StringPtr &  propertyName) const
inline

Excludes the property from a list of visible properties on the function block.

Parameters
propertyNameThe name of the property.

Note that if the property is not visible in the wrapped function block, this method will have no effect. The method affects the return value of IFunctionBlock.GetVisibleProperties method.

◆ excludeSignal()

void excludeSignal ( const daq::StringPtr &  signalLocalId) const
inline

Excludes the signal from a list of signals on the function block.

Parameters
signalLocalIdThe name of the signal.

◆ getWrappedFunctionBlock()

daq::FunctionBlockPtr getWrappedFunctionBlock ( ) const
inline

Returns the wrapped function block which was passed as a parameter to the constructor/factory.

Returns
The wrapped function block.

◆ includeFunctionBlock()

void includeFunctionBlock ( const daq::StringPtr &  functionBlockLocalId) const
inline

Includes the function block to a list of sub-function blocks on the function block.

Parameters
functionBlockLocalIdThe local id of the sub-function block.

◆ includeInputPort()

void includeInputPort ( const daq::StringPtr &  inputPortName) const
inline

Includes the input port to a list of input ports on the function block.

Parameters
inputPortNameThe name of the input port.

◆ includeProperty()

void includeProperty ( const daq::StringPtr &  propertyName) const
inline

Includes the property to a list of visible properties on the function block.

Parameters
propertyNameThe name of the property.

Note that if the property is not visible in the wrapped function block, the property will not be included. The method the return value of IFunctionBlock.GetVisibleProperties method.

◆ includeSignal()

void includeSignal ( const daq::StringPtr &  signalLocalId) const
inline

Includes the signal to a list of signals on the function block.

Parameters
signalLocalIdThe local id of the signal.

◆ setPropertyCoercer()

void setPropertyCoercer ( const daq::StringPtr &  propertyName,
const daq::CoercerPtr &  coercer 
) const
inline

Sets a custom coercer for the property.

Parameters
propertyNameThe name of the property.
coercerThe custom coercer.

The custom coercer is applied before the standard coercer of the property.

◆ setPropertySelectionValues()

void setPropertySelectionValues ( const daq::StringPtr &  propertyName,
const daq::ListPtr< daq::IString > &  enumValues 
) const
inline

Sets a list of accepted selection values.

Parameters
propertyNameThe name of the property.
enumValuesThe list of accepted selection values. An element of a list is selection index (int).

The list of accepted selection values must be a subset of property selection values.

◆ setPropertyValidator()

void setPropertyValidator ( const daq::StringPtr &  propertyName,
const daq::ValidatorPtr &  validator 
) const
inline

Sets a custom validator for the property.

Parameters
propertyNameThe name of the property.
validatorThe custom validator.

The custom validator is applied before the standard validator of the property.