Kactus2
Kactus2 reference guide
Loading...
Searching...
No Matches
AbstractParameterInterface Class Referenceabstract

Interface for editing parameters. More...

#include <AbstractParameterInterface.h>

Inheritance diagram for AbstractParameterInterface:
ParameterizableInterface NameGroupInterface CommonInterface ModuleParameterInterface ParametersInterface

Public Member Functions

 AbstractParameterInterface (const AbstractParameterInterface &other)=delete
 No copying. No assignment.
 
 AbstractParameterInterface (QSharedPointer< ParameterValidator > validator, QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter)
 
virtual ~AbstractParameterInterface ()=default
 
virtual int getAllReferencesToIdInItem (const std::string &itemName, std::string const &valueID) const override final
 
std::string getArrayLeftExpression (std::string const &parameterName) const
 
std::string getArrayLeftFormattedExpression (std::string const &parameterName) const
 
std::string getArrayLeftValue (std::string const &parameterName, int const &baseNumber=0) const
 
std::string getArrayRightExpression (std::string const &parameterName) const
 
std::string getArrayRightFormattedExpression (std::string const &parameterName) const
 
std::string getArrayRightValue (std::string const &parameterName, int const &baseNumber=0) const
 
std::string getBitWidthLeftExpression (std::string const &parameterName) const
 
std::string getBitWidthLeftFormattedExpression (std::string const &parameterName) const
 
std::string getBitWidthLeftValue (std::string const &parameterName, int const &baseNumber=0) const
 
std::string getBitWidthRightExpression (std::string const &parameterName) const
 
std::string getBitWidthRightFormattedExpression (std::string const &parameterName) const
 
std::string getBitWidthRightValue (std::string const &parameterName, int const &baseNumber=0) const
 
std::string getChoice (std::string const &parameterName) const
 
std::string getDisplayName (std::string const &parameterName) const
 
std::vector< std::string > getExpressionsInSelectedItems (std::vector< std::string > parameterNames) const
 
std::string getID (std::string const &parameterName) const
 
std::string getMaximum (std::string const &parameterName) const
 
std::string getMinimum (std::string const &parameterName) const
 
std::string getResolve (std::string const &parameterName) const
 
std::string getType (std::string const &parameterName) const
 
int getUsageCount (std::string const &parameterName) const
 
std::string getValue (std::string const &parameterName, int const &baseNumber=0) const
 
std::string getValueExpression (std::string const &parameterName) const
 
std::string getValueFormattedExpression (std::string const &parameterName) const
 
bool hasValidArrayValues (std::string const &parameterName) const
 
bool hasValidBitWidth (std::string const &parameterName) const
 
bool hasValidChoice (std::string const &parameterName) const
 
bool hasValidMaximum (std::string const &parameterName) const
 
bool hasValidMinimum (std::string const &parameterName) const
 
bool hasValidResolve (std::string const &parameterName) const
 
bool hasValidType (std::string const &parameterName) const
 
bool hasValidValue (std::string const &parameterName) const
 
bool increaseUsageCount (std::string const &parameterName)
 
virtual bool itemHasValidName (std::string const &itemName) const override final
 
AbstractParameterInterfaceoperator= (const AbstractParameterInterface &other)=delete
 
bool reduceUsageCount (std::string const &parameterName)
 
bool setArrayLeft (std::string const &parameterName, std::string const &newArrayLeft)
 
bool setArrayRight (std::string const &parameterName, std::string const &newArrayRight)
 
bool setBitWidthLeft (std::string const &parameterName, std::string const &newBitWidthLeft)
 
bool setBitWidthRight (std::string const &parameterName, std::string const &newBitWidthRight)
 
bool setChoice (std::string const &parameterName, std::string const &newChoice)
 
void setChoices (QSharedPointer< QList< QSharedPointer< Choice > > > newChoices)
 
bool setDisplayName (std::string const &parameterName, std::string const &newDisplayName)
 
bool setID (std::string const &parameterName, std::string const &newID)
 
bool setMaximum (std::string const &parameterName, std::string const &newMaximum)
 
bool setMinimum (std::string const &parameterName, std::string const &newMinimum)
 
virtual bool setName (std::string const &currentName, std::string const &newName) override final
 
bool setResolve (std::string const &parameterName, std::string const &newResolve)
 
bool setType (std::string const &parameterName, std::string const &newType)
 
bool setUsageCount (std::string const &parameterName, int const &newUsageCount)
 
bool setValue (std::string const &parameterName, std::string const &newValue)
 
virtual bool validateItems () const override final
 
- Public Member Functions inherited from ParameterizableInterface
 ParameterizableInterface (const ParameterizableInterface &other)=delete
 No copying. No assignment.
 
 ParameterizableInterface (QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter)
 
virtual ~ParameterizableInterface ()=default
 
ParameterizableInterfaceoperator= (const ParameterizableInterface &other)=delete
 
- Public Member Functions inherited from NameGroupInterface
 NameGroupInterface ()
 
 NameGroupInterface (const NameGroupInterface &other)=delete
 No copying. No assignment.
 
virtual ~NameGroupInterface ()=default
 
virtual std::string getDescription (std::string const &itemName) const
 
virtual std::string getIndexedItemName (int itemIndex) const =0
 
virtual int getItemIndex (std::string const &itemName) const =0
 
virtual std::string getShortDescription (std::string const &itemName) const
 
NameGroupInterfaceoperator= (const NameGroupInterface &other)=delete
 
virtual bool setDescription (std::string const &itemName, std::string const &newDescription)
 
virtual bool setDisplayName (std::string const &itemName, std::string const &newDisplayName) const
 
bool setShortDescription (std::string const &itemName, std::string const &newShortDescription) const
 
- Public Member Functions inherited from CommonInterface
 CommonInterface ()=default
 
 CommonInterface (const CommonInterface &other)=delete
 No copying. No assignment.
 
virtual ~CommonInterface ()=default
 
virtual std::vector< std::string > getItemNames () const =0
 
virtual int itemCount () const =0
 
CommonInterfaceoperator= (const CommonInterface &other)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from ParameterizableInterface
QString formattedValueFor (QString const &expression) const
 
QString parseExpressionToBaseNumber (QString const &expression, unsigned int const &baseNumber, bool *expressionIsValid=nullptr) const
 
QString parseExpressionToDecimal (QString const &expression, bool *expressionIsValid=nullptr) const
 
- Protected Member Functions inherited from CommonInterface
QString getUniqueName (std::string const &newName, std::string const &itemTypeName) const
 
bool nameHasChanged (std::string const &newName, std::string const &oldName) const
 

Detailed Description

Interface for editing parameters.

Definition at line 28 of file AbstractParameterInterface.h.

Constructor & Destructor Documentation

◆ AbstractParameterInterface() [1/2]

AbstractParameterInterface::AbstractParameterInterface ( QSharedPointer< ParameterValidator > validator,
QSharedPointer< ExpressionParser > expressionParser,
QSharedPointer< ExpressionFormatter > expressionFormatter )

The constructor.

Parameters
[in]validatorValidator for parameters.
[in]expressionParserParser for expressions.
[in]expressionFormatterFormatter for expressions.

◆ ~AbstractParameterInterface()

virtual AbstractParameterInterface::~AbstractParameterInterface ( )
virtualdefault

The destructor.

◆ AbstractParameterInterface() [2/2]

AbstractParameterInterface::AbstractParameterInterface ( const AbstractParameterInterface & other)
delete

No copying. No assignment.

Member Function Documentation

◆ getAllReferencesToIdInItem()

virtual int AbstractParameterInterface::getAllReferencesToIdInItem ( const std::string & itemName,
std::string const & valueID ) const
finaloverridevirtual

Calculate all the references to the selected ID in the selected item.

Parameters
[in]itemNameName of the selected item.
[in]valueIDThe selected ID.
Returns
Number of references to the selected ID in the selected item.

Implements ParameterizableInterface.

◆ getArrayLeftExpression()

std::string AbstractParameterInterface::getArrayLeftExpression ( std::string const & parameterName) const

Get the array left expression of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Array left expression of the selected parameter.

◆ getArrayLeftFormattedExpression()

std::string AbstractParameterInterface::getArrayLeftFormattedExpression ( std::string const & parameterName) const

Get the formatted array left expression of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Formatted array left expression of the selected parameter.

◆ getArrayLeftValue()

std::string AbstractParameterInterface::getArrayLeftValue ( std::string const & parameterName,
int const & baseNumber = 0 ) const

Get the calculated array left value of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]baseNumberBase for displaying the value.
Returns
Calculated array left value of the selected port.

◆ getArrayRightExpression()

std::string AbstractParameterInterface::getArrayRightExpression ( std::string const & parameterName) const

Get the array right expression of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Array right expression of the selected parameter.

◆ getArrayRightFormattedExpression()

std::string AbstractParameterInterface::getArrayRightFormattedExpression ( std::string const & parameterName) const

Get the formatted array right expression of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Formatted array right expression of the selected parameter.

◆ getArrayRightValue()

std::string AbstractParameterInterface::getArrayRightValue ( std::string const & parameterName,
int const & baseNumber = 0 ) const

Get the calculated array right value of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]baseNumberBase for displaying the value.
Returns
Calculated array right value of the selected port.

◆ getBitWidthLeftExpression()

std::string AbstractParameterInterface::getBitWidthLeftExpression ( std::string const & parameterName) const

Get the bit width left expression of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Bit width left expression of the selected parameter.

◆ getBitWidthLeftFormattedExpression()

std::string AbstractParameterInterface::getBitWidthLeftFormattedExpression ( std::string const & parameterName) const

Get the formatted bit width left expression of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Formatted bit width left expression of the selected parameter.

◆ getBitWidthLeftValue()

std::string AbstractParameterInterface::getBitWidthLeftValue ( std::string const & parameterName,
int const & baseNumber = 0 ) const

Get the calculated bit width left value of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]baseNumberBase for displaying the value.
Returns
Calculated bit width left value of the selected parameter.

◆ getBitWidthRightExpression()

std::string AbstractParameterInterface::getBitWidthRightExpression ( std::string const & parameterName) const

Get the bit width right expression of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Bit width right expression of the selected parameter.

◆ getBitWidthRightFormattedExpression()

std::string AbstractParameterInterface::getBitWidthRightFormattedExpression ( std::string const & parameterName) const

Get the formatted bit width right expression of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Formatted bit width right expression of the selected parameter.

◆ getBitWidthRightValue()

std::string AbstractParameterInterface::getBitWidthRightValue ( std::string const & parameterName,
int const & baseNumber = 0 ) const

Get the calculated bit width right value of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]baseNumberBase for displaying the value.
Returns
Calculated bit width right value of the selected port.

◆ getChoice()

std::string AbstractParameterInterface::getChoice ( std::string const & parameterName) const

Get the choice reference of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Choice reference of the selected parameter.

◆ getDisplayName()

std::string AbstractParameterInterface::getDisplayName ( std::string const & parameterName) const
virtual

Get the display name of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Name of the selected parameter.

Reimplemented from NameGroupInterface.

◆ getExpressionsInSelectedItems()

std::vector< std::string > AbstractParameterInterface::getExpressionsInSelectedItems ( std::vector< std::string > parameterNames) const

Get the expressions in the selected parameters.

Parameters
[in]parameterNamesNames of the selected parameters.
Returns
Expressions in the selected parameters.

◆ getID()

std::string AbstractParameterInterface::getID ( std::string const & parameterName) const

Get the ID of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
ID of the selected parameter.

◆ getMaximum()

std::string AbstractParameterInterface::getMaximum ( std::string const & parameterName) const

Get the maximum value the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Maximum value of the selected parameter.

◆ getMinimum()

std::string AbstractParameterInterface::getMinimum ( std::string const & parameterName) const

Get the minimum value the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Minimum value of the selected parameter.

◆ getResolve()

std::string AbstractParameterInterface::getResolve ( std::string const & parameterName) const

Get the resolve of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Resolve of the selected parameter.

◆ getType()

std::string AbstractParameterInterface::getType ( std::string const & parameterName) const

Get the type of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Type of the selected parameter.

◆ getUsageCount()

int AbstractParameterInterface::getUsageCount ( std::string const & parameterName) const

Get the usage count of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Usage count of the selected parameter.

◆ getValue()

std::string AbstractParameterInterface::getValue ( std::string const & parameterName,
int const & baseNumber = 0 ) const

Get the calculated value of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]baseNumberBase for displaying the value.
Returns
Calculated value of the selected port.

◆ getValueExpression()

std::string AbstractParameterInterface::getValueExpression ( std::string const & parameterName) const

Get the value expression of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Value expression of the selected parameter.

◆ getValueFormattedExpression()

std::string AbstractParameterInterface::getValueFormattedExpression ( std::string const & parameterName) const

Get the formatted value expression of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
Formatted value expression of the selected parameter.

◆ hasValidArrayValues()

bool AbstractParameterInterface::hasValidArrayValues ( std::string const & parameterName) const

Check if the selected parameter has valid array values.

Parameters
[in]parameterNameNew of the selected parameter.
Returns
True, if the array values are valid, false otherwise.

◆ hasValidBitWidth()

bool AbstractParameterInterface::hasValidBitWidth ( std::string const & parameterName) const

Check if the selected parameter has a valid bit width.

Parameters
[in]parameterNameNew of the selected parameter.
Returns
True, if the bit width is valid, false otherwise.

◆ hasValidChoice()

bool AbstractParameterInterface::hasValidChoice ( std::string const & parameterName) const

Check if the selected parameter has a valid choice.

Parameters
[in]parameterNameNew of the selected parameter.
Returns
True, if the choice is valid, false otherwise.

◆ hasValidMaximum()

bool AbstractParameterInterface::hasValidMaximum ( std::string const & parameterName) const

Check if the selected parameter has a valid maximum.

Parameters
[in]parameterNameNew of the selected parameter.
Returns
True, if the maximum is valid, false otherwise.

◆ hasValidMinimum()

bool AbstractParameterInterface::hasValidMinimum ( std::string const & parameterName) const

Check if the selected parameter has a valid minimum.

Parameters
[in]parameterNameNew of the selected parameter.
Returns
True, if the minimum is valid, false otherwise.

◆ hasValidResolve()

bool AbstractParameterInterface::hasValidResolve ( std::string const & parameterName) const

Check if the selected parameter has a valid resolve.

Parameters
[in]parameterNameNew of the selected parameter.
Returns
True, if the resolve is valid, false otherwise.

◆ hasValidType()

bool AbstractParameterInterface::hasValidType ( std::string const & parameterName) const

Check if the selected parameter has a valid type.

Parameters
[in]parameterNameNew of the selected parameter.
Returns
True, if the type is valid, false otherwise.

◆ hasValidValue()

bool AbstractParameterInterface::hasValidValue ( std::string const & parameterName) const

Check if the selected parameter has a valid value.

Parameters
[in]parameterNameNew of the selected parameter.
Returns
True, if the value is valid, false otherwise.

◆ increaseUsageCount()

bool AbstractParameterInterface::increaseUsageCount ( std::string const & parameterName)

Increase the usage count of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
True, if successful, false otherwise.

◆ itemHasValidName()

virtual bool AbstractParameterInterface::itemHasValidName ( std::string const & itemName) const
finaloverridevirtual

Check if the selected item has a valid name.

Parameters
[in]itemNameName of the selected item.
Returns
True, if the name is valid, false otherwise.

Implements NameGroupInterface.

◆ operator=()

AbstractParameterInterface & AbstractParameterInterface::operator= ( const AbstractParameterInterface & other)
delete

◆ reduceUsageCount()

bool AbstractParameterInterface::reduceUsageCount ( std::string const & parameterName)

Decrease the usage count of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
Returns
True, if successful, false otherwise.

◆ setArrayLeft()

bool AbstractParameterInterface::setArrayLeft ( std::string const & parameterName,
std::string const & newArrayLeft )

Set a new array left value for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newArrayLeftNew array left value.
Returns
True, if successful, false otherwise.

◆ setArrayRight()

bool AbstractParameterInterface::setArrayRight ( std::string const & parameterName,
std::string const & newArrayRight )

Set a new array right value for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newArrayRightNew array right value.
Returns
True, if successful, false otherwise.

◆ setBitWidthLeft()

bool AbstractParameterInterface::setBitWidthLeft ( std::string const & parameterName,
std::string const & newBitWidthLeft )

Set a new bit width left value for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newBitWidthLeftNew bit width left value.
Returns
True, if successful, false otherwise.

◆ setBitWidthRight()

bool AbstractParameterInterface::setBitWidthRight ( std::string const & parameterName,
std::string const & newBitWidthRight )

Set a new bit width right value for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newBitWidthRightNew bit width right value.
Returns
True, if successful, false otherwise.

◆ setChoice()

bool AbstractParameterInterface::setChoice ( std::string const & parameterName,
std::string const & newChoice )

Set the choice reference for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newChoiceThe new choice reference.
Returns
True, if successful, false otherwise.

◆ setChoices()

void AbstractParameterInterface::setChoices ( QSharedPointer< QList< QSharedPointer< Choice > > > newChoices)

Set available choices.

Parameters
[in]newChoicesThe new choices.

◆ setDisplayName()

bool AbstractParameterInterface::setDisplayName ( std::string const & parameterName,
std::string const & newDisplayName )

Set the display name of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newDisplayNameNew display name for the parameter.
Returns
True, if successful, false otherwise.

◆ setID()

bool AbstractParameterInterface::setID ( std::string const & parameterName,
std::string const & newID )

Set a new ID for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newIDNew ID.
Returns
True, if successful, false otherwise.

◆ setMaximum()

bool AbstractParameterInterface::setMaximum ( std::string const & parameterName,
std::string const & newMaximum )

Set the maximum value for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newMaximumNew maximum value of the parameter.
Returns
True, if successful, false otherwise.

◆ setMinimum()

bool AbstractParameterInterface::setMinimum ( std::string const & parameterName,
std::string const & newMinimum )

Set the minimum value for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newMinimumNew minimum value of the parameter.
Returns
True, if successful, false otherwise.

◆ setName()

virtual bool AbstractParameterInterface::setName ( std::string const & currentName,
std::string const & newName )
finaloverridevirtual

Set a new name for the selected item.

Parameters
[in]currentNameName of the selected item.
[in]newNameNew name for the item.
Returns
True, if successful, false otherwise.

Implements NameGroupInterface.

◆ setResolve()

bool AbstractParameterInterface::setResolve ( std::string const & parameterName,
std::string const & newResolve )

Set a resolve for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newResolveNew resolve.
Returns
True, if successful, false otherwise.

◆ setType()

bool AbstractParameterInterface::setType ( std::string const & parameterName,
std::string const & newType )

Set the type of the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newTypeNew type for the parameter.
Returns
True, if successful, false otherwise.

◆ setUsageCount()

bool AbstractParameterInterface::setUsageCount ( std::string const & parameterName,
int const & newUsageCount )

Set a new usage count for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newUsageCountNew usage count.
Returns
True, if successful, false otherwise.

◆ setValue()

bool AbstractParameterInterface::setValue ( std::string const & parameterName,
std::string const & newValue )

Set a new value for the selected parameter.

Parameters
[in]parameterNameName of the selected parameter.
[in]newValueNew value.
Returns
True, if successful, false otherwise.

◆ validateItems()

virtual bool AbstractParameterInterface::validateItems ( ) const
finaloverridevirtual

Validates the contained items.

Returns
True, if all the items are valid, false otherwise.

Implements CommonInterface.


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