blockfactory  0.8
A framework for wrapping algorithms for dataflow programming
blockfactory::mex::SimulinkBlockInformation Class Referencefinal

Simulink implementation of block information. More...

#include <SimulinkBlockInformation.h>

Inheritance diagram for blockfactory::mex::SimulinkBlockInformation:
[legend]

Detailed Description

Simulink implementation of block information.

This class implements the core::BlockInformationfor abstract class providing to core::Block objects the support of interfacing with the Simulink engine.

Public Types

using ParameterIndex = unsigned
 

Public Member Functions

 SimulinkBlockInformation (SimStruct *simstruct)
 
 ~SimulinkBlockInformation () override
 
bool getUniqueName (std::string &blockUniqueName) const override
 Get the unique name of the block instance. More...
 
bool optionFromKey (const std::string &key, double &option) const override
 Convert a block option from its string identifier to a specific implementation. More...
 
bool addParameterMetadata (const core::ParameterMetadata &paramMD) override
 Add a parameter metadata. More...
 
bool parseParameters (core::Parameters &parameters) override
 Parse the core::Block parameters. More...
 
bool setPortsInfo (const core::InputPortsInfo &inputPortsInfo, const core::OutputPortsInfo &outputPortsInfo) override
 Set input / output ports information. More...
 
core::Port::Info getInputPortInfo (const core::Port::Index idx) const override
 Get information of an input port. More...
 
core::Port::Info getOutputPortInfo (const core::Port::Index idx) const override
 Get information of an output port. More...
 
core::Port::Size::Vector getInputPortWidth (const core::Port::Index idx) const override
 Get the size of a 1D input port. More...
 
core::Port::Size::Vector getOutputPortWidth (const core::Port::Index idx) const override
 Get the size of a 1D output port. More...
 
core::Port::Size::Matrix getInputPortMatrixSize (const core::Port::Index idx) const override
 Get the size of a 2D input port. More...
 
core::Port::Size::Matrix getOutputPortMatrixSize (const core::Port::Index idx) const override
 Get the size of a 2D output port. More...
 
core::InputSignalPtr getInputPortSignal (const core::Port::Index idx) const override
 Get the signal connected to an input input port. More...
 
core::OutputSignalPtr getOutputPortSignal (const core::Port::Index idx) const override
 Get the signal connected to an output port. More...
 
- Public Member Functions inherited from blockfactory::core::BlockInformation
 BlockInformation ()=default
 
virtual ~BlockInformation ()=default
 

Member Typedef Documentation

Constructor & Destructor Documentation

blockfactory::mex::SimulinkBlockInformation::SimulinkBlockInformation ( SimStruct simstruct)
blockfactory::mex::SimulinkBlockInformation::~SimulinkBlockInformation ( )
override

Member Function Documentation

bool blockfactory::mex::SimulinkBlockInformation::addParameterMetadata ( const core::ParameterMetadata paramMD)
overridevirtual

Add a parameter metadata.

In order to gather parameters from the running engine, the block must pass their metadata.

Parameters
paramMDThe metadata to add.
Returns
True for success, false otherwise.
See also
core::BlockInformation::parseParameters

Implements blockfactory::core::BlockInformation.

core::Port::Info blockfactory::mex::SimulinkBlockInformation::getInputPortInfo ( const core::Port::Index  idx) const
overridevirtual

Get information of an input port.

Parameters
idxThe index of the port.
Returns
A Port::Info object containing the port information.

Implements blockfactory::core::BlockInformation.

core::Port::Size::Matrix blockfactory::mex::SimulinkBlockInformation::getInputPortMatrixSize ( const core::Port::Index  idx) const
overridevirtual

Get the size of a 2D input port.

Parameters
idxThe index of the port.
Returns
The size of the port.

Implements blockfactory::core::BlockInformation.

core::InputSignalPtr blockfactory::mex::SimulinkBlockInformation::getInputPortSignal ( const core::Port::Index  idx) const
overridevirtual

Get the signal connected to an input input port.

Parameters
idxThe index of the port to which the signal is connected.
Returns
The pointer to the signal connected to the input port for success, a nullptr otherwise.

Implements blockfactory::core::BlockInformation.

core::Port::Size::Vector blockfactory::mex::SimulinkBlockInformation::getInputPortWidth ( const core::Port::Index  idx) const
overridevirtual

Get the size of a 1D input port.

Parameters
idxThe index of the port.
Returns
The size of the port.

Implements blockfactory::core::BlockInformation.

core::Port::Info blockfactory::mex::SimulinkBlockInformation::getOutputPortInfo ( const core::Port::Index  idx) const
overridevirtual

Get information of an output port.

Parameters
idxThe index of the port.
Returns
A Port::Info object containing the port information.

Implements blockfactory::core::BlockInformation.

core::Port::Size::Matrix blockfactory::mex::SimulinkBlockInformation::getOutputPortMatrixSize ( const core::Port::Index  idx) const
overridevirtual

Get the size of a 2D output port.

Parameters
idxThe index of the port.
Returns
The size of the port.

Implements blockfactory::core::BlockInformation.

core::OutputSignalPtr blockfactory::mex::SimulinkBlockInformation::getOutputPortSignal ( const core::Port::Index  idx) const
overridevirtual

Get the signal connected to an output port.

Parameters
idxThe index of the port to which the signal is connected.
Returns
The pointer to the signal connected to the output port for success, a nullptr otherwise.

Implements blockfactory::core::BlockInformation.

core::Port::Size::Vector blockfactory::mex::SimulinkBlockInformation::getOutputPortWidth ( const core::Port::Index  idx) const
overridevirtual

Get the size of a 1D output port.

Parameters
idxThe index of the port.
Returns
The size of the port.

Implements blockfactory::core::BlockInformation.

bool blockfactory::mex::SimulinkBlockInformation::getUniqueName ( std::string &  blockUniqueName) const
overridevirtual

Get the unique name of the block instance.

Retrive from the engine the unique name of the block. A typical example is the scoped name of the block that takes into account its location in the model hierarchy.

Parameters
[out]blockUniqueNameThe unique name of the block instance.
Returns
True for success, false otherwise.

Implements blockfactory::core::BlockInformation.

bool blockfactory::mex::SimulinkBlockInformation::optionFromKey ( const std::string &  key,
double &  option 
) const
overridevirtual

Convert a block option from its string identifier to a specific implementation.

Parameters
[in]keyIdentifier of the block option.
[out]optionImplementation-specific block option.
Returns
True if the option has been converted, false otherwise.

Implements blockfactory::core::BlockInformation.

bool blockfactory::mex::SimulinkBlockInformation::parseParameters ( core::Parameters parameters)
overridevirtual

Parse the core::Block parameters.

This method allows defining how to gather block parameters from a specific implementation.

Parameters
[out]parametersA container filled with the parsed parameters.
Returns
True for success, false otherwise.

Implements blockfactory::core::BlockInformation.

bool blockfactory::mex::SimulinkBlockInformation::setPortsInfo ( const core::InputPortsInfo inputPortsInfo,
const core::OutputPortsInfo outputPortsInfo 
)
overridevirtual

Set input / output ports information.

Specify I/O ports information such as indices, dimensions, and datatype.

Parameters
inputPortsInfoVector of core::Port::Info objects storing input port information.
outputPortsInfoVector of core::Port::Info objects storing output port information.
Returns
True for success, false otherwise.
Note
This method also automatically set the number of input and output ports and should be called only once.

Implements blockfactory::core::BlockInformation.


The documentation for this class was generated from the following file: