Kactus2
Kactus2 reference guide
Loading...
Searching...
No Matches
AddressBlockInterface Class Reference

Interface for editing address blocks. More...

#include <AddressBlockInterface.h>

Inheritance diagram for AddressBlockInterface:
MemoryBlockInterface ParameterizableInterface NameGroupInterface CommonInterface

Public Member Functions

 AddressBlockInterface (QSharedPointer< AddressBlockValidator > blockValidator, QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter, BusInterfaceInterface *busInterface, RegisterInterface *subInterface, ParametersInterface *parameterInterface)
 
virtual ~AddressBlockInterface ()=default
 
virtual bool acceptBlock (std::string const &blockName) const final
 
bool addAccessPolicy (std::string const &blockName) const
 
virtual void addBlock (int const &row, std::string const &newBlockName=std::string("")) final
 
AccessTypes::Access getAccess (std::string const &blockName) const
 
int getAccessPolicyCount (std::string const &blockName) const
 
std::string getAccessString (std::string const &blockName, bool getAccessPolicyAccess=false) const
 
virtual int getAllReferencesToIdInItem (const std::string &itemName, std::string const &valueID) const final
 
virtual std::vector< std::string > getExpressionsInSelectedItems (std::vector< std::string > const &itemNames) const final
 
std::string getRangeExpression (std::string const &blockName) const
 
std::string getRangeFormattedExpression (std::string const &blockName) const
 
RegisterInterfacegetSubInterface () const
 
General::Usage getUsage (std::string const &blockName) const
 
std::string getUsageString (std::string const &blockName) const
 
std::string getVolatile (std::string const &blockName) const
 
std::string getWidthExpression (std::string const &blockName) const
 
std::string getWidthFormattedExpression (std::string const &blockName) const
 
std::string getWidthValue (std::string const &blockName, int const &baseNumber=0) const
 
bool hasRegisters (std::string const &blockName) const
 
bool hasValidRange (std::string const &itemName) const
 
bool hasValidUsage (std::string const &itemName) const
 
bool hasValidWidth (std::string const &itemName) const
 
bool setAccess (std::string const &blockName, std::string const &newAccess, bool setAccessPolicyAccess=false) const
 
bool setRange (std::string const &blockName, std::string const &newRange) const
 
bool setUsage (std::string const &blockName, std::string const &newUsage) const
 
bool setVolatile (std::string const &blockName, bool newVolatile) const
 
bool setVolatile (std::string const &blockName, std::string const &newVolatileValue)
 
bool setWidth (std::string const &blockName, std::string const &newWidth) const
 
virtual bool validateItems () const override final
 
- Public Member Functions inherited from MemoryBlockInterface
 MemoryBlockInterface (QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter, BusInterfaceInterface *busInterface, ParametersInterface *parameterInterface)
 
virtual ~MemoryBlockInterface ()=default
 
virtual void addBlock (std::string const &newBlockName=std::string(""))
 
void copyRows (std::vector< int > selectedRows)
 
std::string getBaseAddressExpression (std::string const &blockName) const
 
std::string getBaseAddressFormattedExpression (std::string const &blockName) const
 
std::string getBaseAddressValue (std::string const &blockName, int const &baseNumber=0) const
 
BusInterfaceInterfacegetBusInterface () const
 
std::string getIndexedItemName (int itemIndex) const final
 
std::string getIsPresentExpression (std::string const &blockName) const
 
std::string getIsPresentFormattedExpression (std::string const &blockName) const
 
std::string getIsPresentValue (std::string const &blockName, int const &baseNumber=0) const
 
virtual int getItemIndex (std::string const &itemName) const override final
 
virtual std::vector< std::string > getItemNames () const override final
 
int getPasteRowCount () const
 
std::string getRangeValue (std::string const &blockName, int const &baseNumber=0) const
 
bool hasValidBaseAddress (std::string const &itemName) const
 
bool hasValidIsPresent (std::string const &itemName) const
 
virtual int itemCount () const override final
 
bool itemHasValidName (std::string const &itemName) const
 
std::vector< std::string > pasteRows ()
 
bool removeBlock (std::string const &blockName)
 
void setAddressUnitBits (std::string const &newAddressUnitbits)
 
bool setBaseAddress (std::string const &blockName, std::string const &newBaseAdress) const
 
bool setIsPresent (std::string const &blockName, std::string const &newIsPresent) const
 
void setMemoryBlocks (QSharedPointer< QList< QSharedPointer< MemoryBlockBase > > > newMemoryBlocks)
 
virtual bool setName (std::string const &currentName, std::string const &newName) override final
 
void setupSubInterfaces (QSharedPointer< Component > newComponent)
 
- 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 getDisplayName (std::string const &itemName) const
 
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
 
CommonInterfaceoperator= (const CommonInterface &other)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from MemoryBlockInterface
QString getAddressUnitBits () const
 
QSharedPointer< MemoryBlockBase > getBlock (std::string const &itemName) const
 
QSharedPointer< QList< QSharedPointer< MemoryBlockBase > > > getBlocksData ()
 
QString getNewBlockBaseAddress () const
 
QSharedPointer< AddressSpace > getReferencedAddressSpace (QString const &masterBusReference) const
 
- 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 address blocks.

Definition at line 34 of file AddressBlockInterface.h.

Constructor & Destructor Documentation

◆ AddressBlockInterface()

AddressBlockInterface::AddressBlockInterface ( QSharedPointer< AddressBlockValidator > blockValidator,
QSharedPointer< ExpressionParser > expressionParser,
QSharedPointer< ExpressionFormatter > expressionFormatter,
BusInterfaceInterface * busInterface,
RegisterInterface * subInterface,
ParametersInterface * parameterInterface )

The constructor.

Parameters
[in]blockValidatorValidator for address blocks.
[in]expressionParserParser for expressions.
[in]expressionFormatterFormatter for expressions.
[in]busInterfaceInterface for accessing bus interfaces.
[in]subInterfaceInterface for accessing registers.
[in]parameterInterfaceInterface for accessing parameters.

◆ ~AddressBlockInterface()

virtual AddressBlockInterface::~AddressBlockInterface ( )
virtualdefault

The destructor.

Member Function Documentation

◆ acceptBlock()

virtual bool AddressBlockInterface::acceptBlock ( std::string const & blockName) const
finalvirtual

Check if the selected memory block is an address block.

Parameters
[in]blockNameName of the selected memory block.
Returns
True, if the memory block is an address block, false otherwise.

Implements MemoryBlockInterface.

◆ addAccessPolicy()

bool AddressBlockInterface::addAccessPolicy ( std::string const & blockName) const

Add a new access policy to an address block.

Parameters
[in]blockNameName of the selected address block.
Returns
True, if the operation was successful, otherwise false.

◆ addBlock()

virtual void AddressBlockInterface::addBlock ( int const & row,
std::string const & newBlockName = std::string("") )
finalvirtual

Add a new address block.

Parameters
[in]rowRow of the new address block.
[in]newBlockNameName of the new address block.

Implements MemoryBlockInterface.

◆ getAccess()

AccessTypes::Access AddressBlockInterface::getAccess ( std::string const & blockName) const

Get the access of the selected address block. Used in std14 access editor.

Parameters
[in]blockNameName of the selected address block.
Returns
Access of the selected address block.

◆ getAccessPolicyCount()

int AddressBlockInterface::getAccessPolicyCount ( std::string const & blockName) const

Get the number of access policies an address block has.

Parameters
[in]blockNameName of the selected address block.
Returns
The number of access policies of the selected address block.

◆ getAccessString()

std::string AddressBlockInterface::getAccessString ( std::string const & blockName,
bool getAccessPolicyAccess = false ) const

Get the access string of the selected address block or one of its access policies specified by the accessPolicyIndex parameter. The default value of -1 returns the address block's access value. 0 and above returns an indexed access policy's access value.

Parameters
[in]blockNameName of the selected address block.
[in]getAccessPolicyAccessFlag indicating if access is fetched from access policy or directly from address block.
Returns
Access string of the selected address block or its access policy.

◆ getAllReferencesToIdInItem()

virtual int AddressBlockInterface::getAllReferencesToIdInItem ( const std::string & itemName,
std::string const & valueID ) const
finalvirtual

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.

Reimplemented from MemoryBlockInterface.

◆ getExpressionsInSelectedItems()

virtual std::vector< std::string > AddressBlockInterface::getExpressionsInSelectedItems ( std::vector< std::string > const & itemNames) const
finalvirtual

Get the expressions in the selected items.

Parameters
[in]itemNamesNames of the selected items.
Returns
The expressions of the selected items.

Implements MemoryBlockInterface.

◆ getRangeExpression()

std::string AddressBlockInterface::getRangeExpression ( std::string const & blockName) const

Get the range expression of the selected address block.

Parameters
[in]blockNameName of the selected address block.
Returns
Range expression of the selected address block.

◆ getRangeFormattedExpression()

std::string AddressBlockInterface::getRangeFormattedExpression ( std::string const & blockName) const

Get the formatted range expression of the selected address block.

Parameters
[in]blockNameName of the selected address block.
Returns
Formatted range expression of the selected address block.

◆ getSubInterface()

RegisterInterface * AddressBlockInterface::getSubInterface ( ) const

Get the sub interface.

Returns
Interface for accessing registers.

◆ getUsage()

General::Usage AddressBlockInterface::getUsage ( std::string const & blockName) const

Get the usage of the selected address block.

Parameters
[in]blockNameName of the selected address block.
Returns
Usage of the selected address block.

◆ getUsageString()

std::string AddressBlockInterface::getUsageString ( std::string const & blockName) const

Get the usage string of the selected address block.

Parameters
[in]blockNameName of the selected address block.
Returns
Usage string of the selected address block.

◆ getVolatile()

std::string AddressBlockInterface::getVolatile ( std::string const & blockName) const

Get the volatile value of the selected address block.

Parameters
[in]blockNameName of the selected address block.
Returns
Volatile value of the selected address block.

◆ getWidthExpression()

std::string AddressBlockInterface::getWidthExpression ( std::string const & blockName) const

Get the width expression of the selected address block.

Parameters
[in]blockNameName of the selected address block.
Returns
Width expression of the selected address block.

◆ getWidthFormattedExpression()

std::string AddressBlockInterface::getWidthFormattedExpression ( std::string const & blockName) const

Get the formatted width expression of the selected address block.

Parameters
[in]blockNameName of the selected address block.
Returns
Formatted width expression of the selected address block.

◆ getWidthValue()

std::string AddressBlockInterface::getWidthValue ( std::string const & blockName,
int const & baseNumber = 0 ) const

Get the calculated width value of the selected address block.

Parameters
[in]blockNameName of the selected address block.
[in]baseNumberBase for displaying the value.
Returns
Calculated width value of the selected address block.

◆ hasRegisters()

bool AddressBlockInterface::hasRegisters ( std::string const & blockName) const

Check if the selected address block contains registers.

Parameters
[in]blockNameName of the selected address block.
Returns
True, if the address block contains registers, false otherwise.

◆ hasValidRange()

bool AddressBlockInterface::hasValidRange ( std::string const & itemName) const

Check if the selected address block has a valid range.

Parameters
[in]itemNameName of the selected address block.
Returns
True, if the range is valid, false otherwise.

◆ hasValidUsage()

bool AddressBlockInterface::hasValidUsage ( std::string const & itemName) const

Check if the selected address block has a valid usage.

Parameters
[in]itemNameName of the selected address block.
Returns
True, if the usage is valid, false otherwise.

◆ hasValidWidth()

bool AddressBlockInterface::hasValidWidth ( std::string const & itemName) const

Check if the selected address block has a valid width.

Parameters
[in]itemNameName of the selected address block.
Returns
True, if the width is valid, false otherwise.

◆ setAccess()

bool AddressBlockInterface::setAccess ( std::string const & blockName,
std::string const & newAccess,
bool setAccessPolicyAccess = false ) const

Set a new access for the selected address block.

Parameters
[in]blockNameName of the selected address block.
[in]newAccessNew access value.
[in]getAccessPolicyAccessFlag indicating if access is set to access policy or directly to address block.
Returns
True, if successful, false otherwise.

◆ setRange()

bool AddressBlockInterface::setRange ( std::string const & blockName,
std::string const & newRange ) const

Set a new range value for the selected address block.

Parameters
[in]blockNameName of the selected address block.
[in]newRangeNew range value.
Returns
True, if successful, false otherwise.

◆ setUsage()

bool AddressBlockInterface::setUsage ( std::string const & blockName,
std::string const & newUsage ) const

Set a new usage value for the selected address block.

Parameters
[in]blockNameName of the selected address block.
[in]newUsageNew usage value.
Returns
True, if successful, false otherwise.

◆ setVolatile() [1/2]

bool AddressBlockInterface::setVolatile ( std::string const & blockName,
bool newVolatile ) const

Set a new volatile value for the selected address block.

Parameters
[in]blockNameName of the selected address block.
[in]newVolatileNew volatile value.
Returns
True, if successful, false otherwise.

◆ setVolatile() [2/2]

bool AddressBlockInterface::setVolatile ( std::string const & blockName,
std::string const & newVolatileValue )

Set a new volatile value for the selected address block.

Parameters
[in]blockNameName of the selected address block.
[in]newVolatileValueThe new volatile value.
Returns
True, if successful, false otherwise.

◆ setWidth()

bool AddressBlockInterface::setWidth ( std::string const & blockName,
std::string const & newWidth ) const

Set a new width value for the selected address block.

Parameters
[in]blockNameName of the selected address block.
[in]newWidthNew width value.
Returns
True, if successful, false otherwise.

◆ validateItems()

virtual bool AddressBlockInterface::validateItems ( ) const
finaloverridevirtual

Validates the contained items.

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

Implements MemoryBlockInterface.


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