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

Parent interface for editing memory blocks. More...

#include <MemoryBlockInterface.h>

Inheritance diagram for MemoryBlockInterface:
ParameterizableInterface NameGroupInterface CommonInterface AddressBlockInterface SubspaceMapInterface

Public Member Functions

 MemoryBlockInterface (QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter, BusInterfaceInterface *busInterface, ParametersInterface *parameterInterface)
 
virtual ~MemoryBlockInterface ()=default
 
virtual bool acceptBlock (std::string const &blockName) const =0
 
virtual void addBlock (int const &row, std::string const &newBlockName=std::string(""))=0
 
virtual void addBlock (std::string const &newBlockName=std::string(""))
 
void copyRows (std::vector< int > selectedRows)
 
virtual int getAllReferencesToIdInItem (const std::string &itemName, std::string const &valueID) const override
 
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
 
virtual std::vector< std::string > getExpressionsInSelectedItems (std::vector< std::string > const &itemNames) const =0
 
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)
 
virtual bool validateItems () const override=0
 
- 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
 

Protected Member Functions

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

Parent interface for editing memory blocks.

Definition at line 34 of file MemoryBlockInterface.h.

Constructor & Destructor Documentation

◆ MemoryBlockInterface()

MemoryBlockInterface::MemoryBlockInterface ( QSharedPointer< ExpressionParser > expressionParser,
QSharedPointer< ExpressionFormatter > expressionFormatter,
BusInterfaceInterface * busInterface,
ParametersInterface * parameterInterface )

The constructor.

Parameters
[in]expressionParserParser for expressions.
[in]expressionFormatterFormatter for expressions.
[in]busInterfaceInterface for accessing bus interfaces.
[in]parameterInterfaceInterface for accessing parameters.

◆ ~MemoryBlockInterface()

virtual MemoryBlockInterface::~MemoryBlockInterface ( )
virtualdefault

The destructor.

Member Function Documentation

◆ acceptBlock()

virtual bool MemoryBlockInterface::acceptBlock ( std::string const & blockName) const
pure virtual

Check if the selected memory block is accepted.

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

Implemented in AddressBlockInterface, and SubspaceMapInterface.

◆ addBlock() [1/2]

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

Add a new memory block, inserting it to specified position given by row.

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

Implemented in AddressBlockInterface, and SubspaceMapInterface.

◆ addBlock() [2/2]

virtual void MemoryBlockInterface::addBlock ( std::string const & newBlockName = std::string(""))
virtual

Add a new memory block. This overload should be preferred when using Python.

Parameters
[in]newBlockNameName of the new memory block.

◆ copyRows()

void MemoryBlockInterface::copyRows ( std::vector< int > selectedRows)

Copy the selected items.

Parameters
[in]selectedRowsIndexes of the selected items.

◆ getAddressUnitBits()

QString MemoryBlockInterface::getAddressUnitBits ( ) const
protected

Get the address unit bits.

Returns
The address unit bits.

◆ getAllReferencesToIdInItem()

virtual int MemoryBlockInterface::getAllReferencesToIdInItem ( const std::string & itemName,
std::string const & valueID ) const
overridevirtual

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.

Reimplemented in AddressBlockInterface.

◆ getBaseAddressExpression()

std::string MemoryBlockInterface::getBaseAddressExpression ( std::string const & blockName) const

Get the base address expression of the selected memory block.

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

◆ getBaseAddressFormattedExpression()

std::string MemoryBlockInterface::getBaseAddressFormattedExpression ( std::string const & blockName) const

Get the formatted base address expression of the selected memory block.

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

◆ getBaseAddressValue()

std::string MemoryBlockInterface::getBaseAddressValue ( std::string const & blockName,
int const & baseNumber = 0 ) const

Get the calculated base address value of the selected memory block.

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

◆ getBlock()

QSharedPointer< MemoryBlockBase > MemoryBlockInterface::getBlock ( std::string const & itemName) const
protected

Get the selected memory block.

Parameters
[in]blockNameName of the selected memory block.
Returns
The selected memory block.

◆ getBlocksData()

QSharedPointer< QList< QSharedPointer< MemoryBlockBase > > > MemoryBlockInterface::getBlocksData ( )
protected

Get the available memory blocks.

Returns
List of available memory blocks.

◆ getBusInterface()

BusInterfaceInterface * MemoryBlockInterface::getBusInterface ( ) const

Get the interface for accessing bus interfaces.

Returns
Interface for accessing bus interfaces.

◆ getExpressionsInSelectedItems()

virtual std::vector< std::string > MemoryBlockInterface::getExpressionsInSelectedItems ( std::vector< std::string > const & itemNames) const
pure virtual

Get the expressions in the selected items.

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

Implemented in AddressBlockInterface, and SubspaceMapInterface.

◆ getIndexedItemName()

std::string MemoryBlockInterface::getIndexedItemName ( int itemIndex) const
finalvirtual

Get name of the indexed item.

Parameters
[in]itemIndexIndex of the selected item.
Returns
Name of the selected item.

Implements NameGroupInterface.

◆ getIsPresentExpression()

std::string MemoryBlockInterface::getIsPresentExpression ( std::string const & blockName) const

Get the is present expression of the selected memory block.

Parameters
[in]blockNameName of the selected memory block.
Returns
Is present expression of the selected memory block.

◆ getIsPresentFormattedExpression()

std::string MemoryBlockInterface::getIsPresentFormattedExpression ( std::string const & blockName) const

Get the formatted is present expression of the selected memory block.

Parameters
[in]blockNameName of the selected memory block.
Returns
Formatted is present expression of the selected memory block.

◆ getIsPresentValue()

std::string MemoryBlockInterface::getIsPresentValue ( std::string const & blockName,
int const & baseNumber = 0 ) const

Get the calculated is present value of the selected memory block.

Parameters
[in]blockNameName of the selected memory block.
[in]baseNumberBase for displaying the value.
Returns
Calculated is present value of the selected memory block.

◆ getItemIndex()

virtual int MemoryBlockInterface::getItemIndex ( std::string const & itemName) const
finaloverridevirtual

Get index of the selected item.

Parameters
[in]itemNameName of the selected item.
Returns
Index of the selected item.

Implements NameGroupInterface.

◆ getItemNames()

virtual std::vector< std::string > MemoryBlockInterface::getItemNames ( ) const
finaloverridevirtual

Get the names of the available items.

Returns
Names of the available items.

Implements CommonInterface.

◆ getNewBlockBaseAddress()

QString MemoryBlockInterface::getNewBlockBaseAddress ( ) const
protected

Get the base address for a new memory block.

Returns
Base address for a new memory block.

◆ getPasteRowCount()

int MemoryBlockInterface::getPasteRowCount ( ) const

Get the number of pasted items.

Returns
Number of the pasted items.

◆ getRangeValue()

std::string MemoryBlockInterface::getRangeValue ( std::string const & blockName,
int const & baseNumber = 0 ) const

Get the calculated range value of the selected memory block.

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

◆ getReferencedAddressSpace()

QSharedPointer< AddressSpace > MemoryBlockInterface::getReferencedAddressSpace ( QString const & masterBusReference) const
protected

Get the address space within the selected bus interface.

Parameters
[in]masterBusReferenceName of the selected bus interface.
Returns
Address space within the selected bus interface.

◆ hasValidBaseAddress()

bool MemoryBlockInterface::hasValidBaseAddress ( std::string const & itemName) const

Check if the selected memory block has a valid base address.

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

◆ hasValidIsPresent()

bool MemoryBlockInterface::hasValidIsPresent ( std::string const & itemName) const

Check if the selected memory block has a valid is present value.

Parameters
[in]itemNameName of the selected memory block.
Returns
True, if the is present value is valid, false otherwise.

◆ itemCount()

virtual int MemoryBlockInterface::itemCount ( ) const
finaloverridevirtual

Get the number of available items.

Returns
Number of available items.

Implements CommonInterface.

◆ itemHasValidName()

bool MemoryBlockInterface::itemHasValidName ( std::string const & itemName) const
virtual

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.

◆ pasteRows()

std::vector< std::string > MemoryBlockInterface::pasteRows ( )

Paste the selected items.

Returns
Names of the pasted items.

◆ removeBlock()

bool MemoryBlockInterface::removeBlock ( std::string const & blockName)

Remove the selected memory block.

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

◆ setAddressUnitBits()

void MemoryBlockInterface::setAddressUnitBits ( std::string const & newAddressUnitbits)

Change the value for address unit bits.

Parameters
[in]newAddressUnitbitsThe new value for address unit bits.

◆ setBaseAddress()

bool MemoryBlockInterface::setBaseAddress ( std::string const & blockName,
std::string const & newBaseAdress ) const

Set a new base address value for the selected memory block.

Parameters
[in]blockNameName of the selected memory block.
[in]newBaseAddressNew base memory value.
Returns
True, if successful, false otherwise.

◆ setIsPresent()

bool MemoryBlockInterface::setIsPresent ( std::string const & blockName,
std::string const & newIsPresent ) const

Set a new is present value for the selected memory block.

Parameters
[in]blockNameName of the selected memory block.
[in]newIsPresentNew is present value.
Returns
True, if successful, false otherwise.

◆ setMemoryBlocks()

void MemoryBlockInterface::setMemoryBlocks ( QSharedPointer< QList< QSharedPointer< MemoryBlockBase > > > newMemoryBlocks)

Set available memory blocks.

Parameters
[in]newMemoryBlocksThe new memory block data.

◆ setName()

virtual bool MemoryBlockInterface::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.

◆ setupSubInterfaces()

void MemoryBlockInterface::setupSubInterfaces ( QSharedPointer< Component > newComponent)

Setup the sub interfaces.

Parameters
[in]newComponentComponent containing the available items.

◆ validateItems()

virtual bool MemoryBlockInterface::validateItems ( ) const
overridepure virtual

Validates the contained items.

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

Implements CommonInterface.

Implemented in AddressBlockInterface, and SubspaceMapInterface.


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