|
Kactus2
Kactus2 reference guide
|
Interface for editing registers. More...
#include <RegisterInterface.h>
Public Member Functions | |
| RegisterInterface (QSharedPointer< RegisterValidator > validator, QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter, FieldInterface *subInterface, AccessPolicyInterface *accessPolicyInterface) | |
| virtual | ~RegisterInterface ()=default |
| bool | addAccessPolicy (std::string const ®isterName) |
| void | addRegister (int const &row, int const &dataIndex, std::string const &newRegisterName=std::string("")) |
| void | addRegister (std::string const &newRegisterName=std::string("")) |
| void | copyRows (std::vector< int > const &selectedRows) |
| AccessTypes::Access | getAccess (std::string const ®isterName) const |
| int | getAccessPolicyCount (std::string const ®isterName) const |
| AccessPolicyInterface * | getAccessPolicyInterface () const |
| std::string | getAccessString (std::string const ®isterName, bool getAccessPolicyAccess=false) const |
| virtual int | getAllReferencesToIdInItem (const std::string &itemName, std::string const &valueID) const override final |
| std::string | getDimensionExpression (std::string const ®isterName) const |
| std::string | getDimensionFormattedExpression (std::string const ®isterName) const |
| std::string | getDimensionValue (std::string const ®isterName, int const &baseNumber=0) const |
| std::vector< std::string > | getExpressionsInSelectedRegisters (std::vector< std::string > const ®isterNames) const |
| std::string | getIndexedItemName (int itemIndex) const final |
| std::string | getIsPresentExpression (std::string const ®isterName) const |
| std::string | getIsPresentFormattedExpression (std::string const ®isterName) const |
| std::string | getIsPresentValue (std::string const ®isterName, int const &baseNumber=0) const |
| virtual int | getItemIndex (std::string const &itemName) const override final |
| virtual std::vector< std::string > | getItemNames () const override final |
| std::string | getOffsetExpression (std::string const ®isterName) const |
| std::string | getOffsetFormattedExpression (std::string const ®isterName) const |
| std::string | getOffsetValue (std::string const ®isterName, int const &baseNumber=0) const |
| int | getPasteRowCount () const |
| std::string | getSizeExpression (std::string const ®isterName) const |
| std::string | getSizeFormattedExpression (std::string const ®isterName) const |
| std::string | getSizeValue (std::string const ®isterName, int const &baseNumber=0) const |
| FieldInterface * | getSubInterface () const |
| std::string | getVolatile (std::string const ®isterName) const |
| bool | hasValidDimension (std::string const ®isterName) const |
| bool | hasValidIsPresent (std::string const ®isterName) const |
| bool | hasValidOffset (std::string const ®isterName) const |
| bool | hasValidSize (std::string const ®isterName) const |
| int | indexInRegisterData (int const &index) const |
| virtual int | itemCount () const override final |
| virtual bool | itemHasValidName (std::string const &itemName) const override final |
| std::vector< std::string > | pasteRows () |
| int | registerDataCount () const |
| bool | removeRegister (std::string const ®isterName, int const &dataIndex) |
| bool | setAccess (std::string const ®isterName, std::string const &newAccess, bool setAccessPolicyAccess=false) |
| void | setAddressUnitBits (int const &newAddressUnitbits) |
| bool | setDimension (std::string const ®isterName, std::string const &newDimension) |
| bool | setIsPresent (std::string const ®isterName, std::string const &newIsPresent) |
| virtual bool | setName (std::string const ¤tName, std::string const &newName) override final |
| bool | setOffset (std::string const ®isterName, std::string const &newOffset) |
| void | setRegisters (QSharedPointer< QList< QSharedPointer< RegisterBase > > > newRegisterData) |
| bool | setSize (std::string const ®isterName, std::string const &newSize) |
| bool | setVolatile (std::string const ®isterName, std::string const &newVolatile) |
| 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 |
| ParameterizableInterface & | operator= (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 | getDisplayName (std::string const &itemName) const |
| virtual std::string | getShortDescription (std::string const &itemName) const |
| NameGroupInterface & | operator= (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 |
| CommonInterface & | operator= (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 |
Interface for editing registers.
Definition at line 34 of file RegisterInterface.h.
| RegisterInterface::RegisterInterface | ( | QSharedPointer< RegisterValidator > | validator, |
| QSharedPointer< ExpressionParser > | expressionParser, | ||
| QSharedPointer< ExpressionFormatter > | expressionFormatter, | ||
| FieldInterface * | subInterface, | ||
| AccessPolicyInterface * | accessPolicyInterface ) |
The constructor.
| [in] | validator | Validator for registers. |
| [in] | expressionParser | Parser for expressions. |
| [in] | expressionFormatter | Formatter for expressions. |
| [in] | subInterface | Interface for accessing fields. |
|
virtualdefault |
The destructor.
| bool RegisterInterface::addAccessPolicy | ( | std::string const & | registerName | ) |
Adds a new access policy to the selected register.
| [in] | registerName | The selected register. |
| void RegisterInterface::addRegister | ( | int const & | row, |
| int const & | dataIndex, | ||
| std::string const & | newRegisterName = std::string("") ) |
Add a new register, inserting it to position specified by row and dataIndex.
| [in] | row | Row of the new register. |
| [in] | dataIndex | Index of the new register in the register data. |
| [in] | newRegisterName | Name of the new register. |
| void RegisterInterface::addRegister | ( | std::string const & | newRegisterName = std::string("") | ) |
Add a new register. This overload should be preferred when using Python.
| [in] | newRegisterName | Name of the new register. |
| void RegisterInterface::copyRows | ( | std::vector< int > const & | selectedRows | ) |
Copy the selected registers.
| [in] | selectedRows | Indexes of the selected registers. |
| AccessTypes::Access RegisterInterface::getAccess | ( | std::string const & | registerName | ) | const |
Get the access of the selected register or access policy given by the access policy index.
| [in] | registerName | Name of the selected register. |
| [in] | accessPolicyIndex | The index of the selected access policy. |
| int RegisterInterface::getAccessPolicyCount | ( | std::string const & | registerName | ) | const |
Get the number of access policies for a given register.
| [in] | registerName | The name of the register to get the number off access policies of. |
| AccessPolicyInterface * RegisterInterface::getAccessPolicyInterface | ( | ) | const |
Get the access policy interface.
@return Interface for accessing the register access policies.
| std::string RegisterInterface::getAccessString | ( | std::string const & | registerName, |
| bool | getAccessPolicyAccess = false ) const |
Get the access string of the selected register or first access policy.
| [in] | registerName | Name of the selected register. |
| [in] | getAccessPolicyAccess | Flag indicating if access is fetched from access policy or directly from register. Access is fetched from first access policy, if true. |
|
finaloverridevirtual |
Calculate all the references to the selected ID in the selected item.
| [in] | itemName | Name of the selected item. |
| [in] | valueID | The selected ID. |
Implements ParameterizableInterface.
| std::string RegisterInterface::getDimensionExpression | ( | std::string const & | registerName | ) | const |
Get the dimension expression of the selected register.
| [in] | registerName | Name of the selected register. |
| std::string RegisterInterface::getDimensionFormattedExpression | ( | std::string const & | registerName | ) | const |
Get the formatted dimension expression of the selected register.
| [in] | registerName | Name of the selected register. |
| std::string RegisterInterface::getDimensionValue | ( | std::string const & | registerName, |
| int const & | baseNumber = 0 ) const |
Get the calculated dimension value of the selected register.
| [in] | registerName | Name of the selected register. |
| [in] | baseNumber | Base for displaying the value. |
| std::vector< std::string > RegisterInterface::getExpressionsInSelectedRegisters | ( | std::vector< std::string > const & | registerNames | ) | const |
Get the expressions in the selected registers.
| [in] | registerNames | Names of the selected registers. |
|
finalvirtual |
Get name of the indexed item.
| [in] | itemIndex | Index of the selected item. |
Implements NameGroupInterface.
| std::string RegisterInterface::getIsPresentExpression | ( | std::string const & | registerName | ) | const |
Get the is present expression of the selected register.
| [in] | registerName | Name of the selected register. |
| std::string RegisterInterface::getIsPresentFormattedExpression | ( | std::string const & | registerName | ) | const |
Get the formatted is present expression of the selected register.
| [in] | registerName | Name of the selected register. |
| std::string RegisterInterface::getIsPresentValue | ( | std::string const & | registerName, |
| int const & | baseNumber = 0 ) const |
Get the calculated is present value of the selected register.
| [in] | registerName | Name of the selected register. |
| [in] | baseNumber | Base for displaying the value. |
|
finaloverridevirtual |
Get index of the selected item.
| [in] | itemName | Name of the selected item. |
Implements NameGroupInterface.
|
finaloverridevirtual |
Get the names of the available items.
Implements CommonInterface.
| std::string RegisterInterface::getOffsetExpression | ( | std::string const & | registerName | ) | const |
Get the offset expression of the selected register.
| [in] | registerName | Name of the selected register. |
| std::string RegisterInterface::getOffsetFormattedExpression | ( | std::string const & | registerName | ) | const |
Get the formatted offset expression of the selected register.
| [in] | registerName | Name of the selected register. |
| std::string RegisterInterface::getOffsetValue | ( | std::string const & | registerName, |
| int const & | baseNumber = 0 ) const |
Get the calculated offset value of the selected register.
| [in] | registerName | Name of the selected register. |
| [in] | baseNumber | Base for displaying the value. |
| int RegisterInterface::getPasteRowCount | ( | ) | const |
Get the number of pasted registers.
| std::string RegisterInterface::getSizeExpression | ( | std::string const & | registerName | ) | const |
Get the size expression of the selected register.
| [in] | registerName | Name of the selected register. |
| std::string RegisterInterface::getSizeFormattedExpression | ( | std::string const & | registerName | ) | const |
Get the formatted size expression of the selected register.
| [in] | registerName | Name of the selected register. |
| std::string RegisterInterface::getSizeValue | ( | std::string const & | registerName, |
| int const & | baseNumber = 0 ) const |
Get the calculated size value of the selected register.
| [in] | registerName | Name of the selected register. |
| [in] | baseNumber | Base for displaying the value. |
| FieldInterface * RegisterInterface::getSubInterface | ( | ) | const |
Get the sub interface.
| std::string RegisterInterface::getVolatile | ( | std::string const & | registerName | ) | const |
Get the volatile of the selected register.
| [in] | registerName | Name of the selected register. |
| bool RegisterInterface::hasValidDimension | ( | std::string const & | registerName | ) | const |
Check if the selected register has a valid dimension.
| [in] | registerName | Name of the selected register. |
| bool RegisterInterface::hasValidIsPresent | ( | std::string const & | registerName | ) | const |
Check if the selected register has a valid is present value.
| [in] | registerName | Name of the selected register. |
| bool RegisterInterface::hasValidOffset | ( | std::string const & | registerName | ) | const |
Check if the selected register has a valid offset.
| [in] | registerName | Name of the selected register. |
| bool RegisterInterface::hasValidSize | ( | std::string const & | registerName | ) | const |
Check if the selected register has a valid size.
| [in] | registerName | Name of the selected register. |
| int RegisterInterface::indexInRegisterData | ( | int const & | index | ) | const |
Get the selected index as the index of register data.
| [in] | index | The selected index. |
|
finaloverridevirtual |
|
finaloverridevirtual |
Check if the selected item has a valid name.
| [in] | itemName | Name of the selected item. |
Implements NameGroupInterface.
| std::vector< std::string > RegisterInterface::pasteRows | ( | ) |
Paste the selected registers.
| int RegisterInterface::registerDataCount | ( | ) | const |
Get the number of register data.
| bool RegisterInterface::removeRegister | ( | std::string const & | registerName, |
| int const & | dataIndex ) |
Remove the selected register.
| [in] | registerName | Name of the selected register. |
| [in] | dataIndex | Index of the removed register in the register data. |
| bool RegisterInterface::setAccess | ( | std::string const & | registerName, |
| std::string const & | newAccess, | ||
| bool | setAccessPolicyAccess = false ) |
Set the access value for the selected register or its access policy given by the access policy index.
| [in] | registerName | Name of the selected register. |
| [in] | newAccess | The new access value. |
| [in] | getAccessPolicyAccess | Flag indicating if access is set to access policy or directly to register. Access is set to first access policy, if true. |
| void RegisterInterface::setAddressUnitBits | ( | int const & | newAddressUnitbits | ) |
Change the value for address unit bits.
| [in] | newAddressUnitbits | The new value for address unit bits. |
| bool RegisterInterface::setDimension | ( | std::string const & | registerName, |
| std::string const & | newDimension ) |
Set a new dimension value for the selected register.
| [in] | registerName | Name of the selected register. |
| [in] | newDimension | New dimension value. |
| bool RegisterInterface::setIsPresent | ( | std::string const & | registerName, |
| std::string const & | newIsPresent ) |
Set a new is present value for the selected register.
| [in] | registerName | Name of the selected register. |
| [in] | newIsPresent | New is present value. |
|
finaloverridevirtual |
Set a new name for the selected item.
| [in] | currentName | Name of the selected item. |
| [in] | newName | New name for the item. |
Implements NameGroupInterface.
| bool RegisterInterface::setOffset | ( | std::string const & | registerName, |
| std::string const & | newOffset ) |
Set a new offset value for the selected register.
| [in] | registerName | Name of the selected register. |
| [in] | newOffset | New offset value. |
| void RegisterInterface::setRegisters | ( | QSharedPointer< QList< QSharedPointer< RegisterBase > > > | newRegisterData | ) |
Set available registers.
| [in] | newRegisterData | The new register data. |
| bool RegisterInterface::setSize | ( | std::string const & | registerName, |
| std::string const & | newSize ) |
Set a new size value for the selected register.
| [in] | registerName | Name of the selected register. |
| [in] | newSize | New size value. |
| bool RegisterInterface::setVolatile | ( | std::string const & | registerName, |
| std::string const & | newVolatile ) |
Set the volatile for the selected register.
| [in] | registerName | Name of the selected register. |
| [in] | newVolatile | The new volatile value. |
|
finaloverridevirtual |
Validates the contained items.
Implements CommonInterface.