![]() |
Kactus2
Kactus2 reference guide
|
Interface for editing memory maps and remaps. More...
#include <MemoryMapInterface.h>
Public Member Functions | |
MemoryMapInterface (QSharedPointer< MemoryMapValidator > mapValidator, QSharedPointer< ExpressionParser > expressionParser, QSharedPointer< ExpressionFormatter > expressionFormatter) | |
virtual | ~MemoryMapInterface ()=default |
void | addMemoryMap (int const &row, std::string const &newMapName=std::string("")) |
void | addMemoryMap (std::string const &newMapName=std::string("")) |
void | addMemoryRemap (std::string const &mapName, std::string const &newRemapName=std::string("")) |
bool | addRemapModeReference (std::string const &mapName, std::string const &remapName) |
void | copyRows (std::vector< std::string > const &selectedRows) |
AddressBlockInterface * | getAddressBlockInterface () const |
std::string | getAddressUnitBitsExpression (std::string const &mapName) const |
std::string | getAddressUnitBitsFormattedExpression (std::string const &mapName) const |
std::string | getAddressUnitBitsValue (std::string const &mapName, int const &baseNumber=0) const |
virtual int | getAllReferencesToIdInItem (const std::string &itemName, std::string const &valueID) const override final |
int | getAllReferencesToIdInRemapItem (std::string const &mapName, std::string const &remapName, std::string const &valueID) const |
std::vector< std::string > | getAssociatedSlaveInterfaces (std::string const &mapName) const |
std::string | getIndexedItemName (int itemIndex) const final |
std::string | getIndexedRemapName (std::string mapName, int const &itemIndex) const |
std::string | getInterfaceBinding (std::string const &mapName) const |
std::string | getIsPresentExpression (std::string const &mapName, std::string const &remapName="") const |
std::string | getIsPresentFormattedExpression (std::string const &mapName, std::string const &remapName="") const |
std::string | getIsPresentValue (std::string const &mapName, std::string const &remapName="", 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::vector< std::string > | getMapExpressions (std::string const &mapName, std::string const &remapName) const |
MemoryMap * | getMapPointer (std::string const &mapName) const |
int | getMemoryRemapIndex (std::string const &mapName, std::string const &remapName) const |
ModeReferenceInterface * | getModeReferenceInterface () const |
std::string | getRemapDescription (std::string const &mapName, std::string const &remapName) const |
int | getRemapModeReferenceCount (std::string const &mapName, std::string const &remapName) const |
std::vector< std::pair< unsigned int, std::string > > | getRemapModeReferences (std::string const &mapName, std::string const &remapName) const |
std::vector< std::pair< unsigned int, std::string > > | getRemapModeReferencesExcludingRemap (std::string const &mapName, std::string const &remapName) const |
std::string | getRemapModeReferenceString (std::string const &mapName, std::string const &remapName) const |
std::vector< std::string > | getRemapNames (std::string const &mapName) const |
MemoryRemap * | getRemapPointer (std::string const &mapName, std::string const &remapName) const |
std::string | getRemapState (std::string const &mapName, std::string const &remapName="") const |
SubspaceMapInterface * | getSubspaceMapInterface () const |
virtual int | itemCount () const override final |
bool | itemHasValidIsPresent (std::string const &mapName, std::string const &remapName="") const |
virtual bool | itemHasValidName (std::string const &itemName) const override final |
bool | memoryMapHasValidAddressUnitBits (std::string const &mapName) const |
std::vector< std::string > | pasteMemoryMaps () |
std::vector< std::string > | pasteMemoryRemaps (std::string const &memoryMapName) |
int | remapCount (std::string const &mapName) const |
bool | remapHasValidName (std::string const &mapName, std::string const &itemName) const |
bool | remapHasValidRemapState (std::string const &mapName, std::string const &itemName) const |
bool | removeMap (std::string const &mapName) |
bool | removeRemap (std::string const &mapName, std::string remapName) |
bool | removeRemapModeReference (std::string const &mapName, std::string const &remapName, int modeReferenceIndex) |
void | setAddressBlockInterface (AddressBlockInterface *blockInterface) |
bool | setAddressUnitBits (std::string const &mapName, std::string const &newAddressUnitBits) const |
bool | setIsPresent (std::string const &mapName, std::string const &newIsPresent, std::string const &remapName="") |
void | setMemoryMaps (QSharedPointer< Component > component) |
void | setModeReferenceInterface (ModeReferenceInterface *modeRefInterface) |
virtual bool | setName (std::string const ¤tName, std::string const &newName) override final |
bool | setRemapDescription (std::string const &mapName, std::string const &itemName, std::string const &newDescription) |
bool | setRemapModeReferences (std::string const &mapName, std::string const &remapName, std::vector< std::pair< unsigned int, std::string > > const &newModeRefs) |
bool | setRemapName (std::string const &mapName, std::string const ¤tName, std::string const &newName) |
bool | setRemapState (std::string const &mapName, std::string const &remapName, std::string const &newRemapState) |
void | setSubspaceMapInterface (SubspaceMapInterface *submapInterface) |
virtual bool | validateItems () const override final |
![]() | |
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 |
![]() | |
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 |
![]() | |
CommonInterface ()=default | |
CommonInterface (const CommonInterface &other)=delete | |
No copying. No assignment. | |
virtual | ~CommonInterface ()=default |
CommonInterface & | operator= (const CommonInterface &other)=delete |
Additional Inherited Members | |
![]() | |
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 |
![]() | |
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 memory maps and remaps.
Definition at line 33 of file MemoryMapInterface.h.
MemoryMapInterface::MemoryMapInterface | ( | QSharedPointer< MemoryMapValidator > | mapValidator, |
QSharedPointer< ExpressionParser > | expressionParser, | ||
QSharedPointer< ExpressionFormatter > | expressionFormatter ) |
The constructor.
[in] | mapValidator | Validator for memory maps. |
[in] | expressionParser | Parser for expressions. |
[in] | expressionFormatter | Formatter for expressions. |
|
virtualdefault |
The destructor.
void MemoryMapInterface::addMemoryMap | ( | int const & | row, |
std::string const & | newMapName = std::string("") ) |
Add a new memory map, inserting it to specific position given by row.
[in] | row | Row of the new memory map. |
[in] | newMapName | Name of the new memory map. |
void MemoryMapInterface::addMemoryMap | ( | std::string const & | newMapName = std::string("") | ) |
Add a new memory map. This overload should be preferred when using Python.
[in] | newMapName | Name of the new memory map. |
void MemoryMapInterface::addMemoryRemap | ( | std::string const & | mapName, |
std::string const & | newRemapName = std::string("") ) |
Add a new memory remap.
[in] | mapName | Name of the memory map containing the new memory remap. |
[in] | newRemapName | Name of the new memory map. |
bool MemoryMapInterface::addRemapModeReference | ( | std::string const & | mapName, |
std::string const & | remapName ) |
Add a new mode reference to a selected remap.
[in] | mapName | The containing memory map. |
[in] | remapName | The name of the remap to add a mode reference to. |
void MemoryMapInterface::copyRows | ( | std::vector< std::string > const & | selectedRows | ) |
Copy the selected items.
[in] | selectedRows | Indexes of the selected items. |
AddressBlockInterface * MemoryMapInterface::getAddressBlockInterface | ( | ) | const |
Get the address block interface.
std::string MemoryMapInterface::getAddressUnitBitsExpression | ( | std::string const & | mapName | ) | const |
Get the address unit bits expression of the selected memory map.
[in] | mapName | Name of the selected memory map. |
std::string MemoryMapInterface::getAddressUnitBitsFormattedExpression | ( | std::string const & | mapName | ) | const |
Get the formatted address unit bits expression of the selected memory map.
[in] | mapName | Name of the selected memory map. |
std::string MemoryMapInterface::getAddressUnitBitsValue | ( | std::string const & | mapName, |
int const & | baseNumber = 0 ) const |
Get the address unit bits value of the selected memory map.
[in] | mapName | Name of the selected memory map. |
|
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.
int MemoryMapInterface::getAllReferencesToIdInRemapItem | ( | std::string const & | mapName, |
std::string const & | remapName, | ||
std::string const & | valueID ) const |
Get the number of references made to the selected parameter in the selected memory remap.
[in] | mapName | Name of the selected memory map. |
[in] | remapName | Name of the selected memory remap. |
[in] | valueID | ID of the selected parameter. |
std::vector< std::string > MemoryMapInterface::getAssociatedSlaveInterfaces | ( | std::string const & | mapName | ) | const |
Get the associated slave interface of the selected memory map.
[in] | mapName | Name of the selected memory map. |
|
finalvirtual |
Get name of the indexed memory map.
[in] | itemIndex | Index of the selected memory map. |
Implements NameGroupInterface.
std::string MemoryMapInterface::getIndexedRemapName | ( | std::string | mapName, |
int const & | itemIndex ) const |
std::string MemoryMapInterface::getInterfaceBinding | ( | std::string const & | mapName | ) | const |
Get the slave interface binding of the selected memory map.
[in] | mapName | Name of the selected memory map. |
std::string MemoryMapInterface::getIsPresentExpression | ( | std::string const & | mapName, |
std::string const & | remapName = "" ) const |
Get the is present expression of the selected item.
[in] | mapName | Name of the selected memory map. |
[in] | remapName | Name of the selected memory remap. |
std::string MemoryMapInterface::getIsPresentFormattedExpression | ( | std::string const & | mapName, |
std::string const & | remapName = "" ) const |
Get the formatted is present expression of the selected item.
[in] | mapName | Name of the selected memory map. |
[in] | remapName | Name of the selected memory remap. |
std::string MemoryMapInterface::getIsPresentValue | ( | std::string const & | mapName, |
std::string const & | remapName = "", | ||
int const & | baseNumber = 0 ) const |
Get the calculated is present value of the selected item.
[in] | mapName | Name of the selected memory map. |
[in] | remapName | Name of the selected memory remap. |
[in] | baseNumber | Base for displaying the value. |
|
finaloverridevirtual |
Get index of the selected memory map.
[in] | itemName | Name of the selected item. |
Implements NameGroupInterface.
|
finaloverridevirtual |
Get the names of the available items.
Implements CommonInterface.
std::vector< std::string > MemoryMapInterface::getMapExpressions | ( | std::string const & | mapName, |
std::string const & | remapName ) const |
Get the expressions in the selected memory item.
[in] | mapName | Name of the selected memory map. |
[in] | remapName | Name of the selected memory remap. |
MemoryMap * MemoryMapInterface::getMapPointer | ( | std::string const & | mapName | ) | const |
Get a pointer to the selected memory map (for index construction).
[in] | mapName | Name of the selected memory map. |
int MemoryMapInterface::getMemoryRemapIndex | ( | std::string const & | mapName, |
std::string const & | remapName ) const |
Get index of the selected memory remap.
[in] | mapName | Name of the memory map containing the selected memory remap. |
[in] | remapName | Name of the selected memory remap. |
ModeReferenceInterface * MemoryMapInterface::getModeReferenceInterface | ( | ) | const |
Get the mode reference interface used for accessing remap mode references.
@return The mode reference interface.
std::string MemoryMapInterface::getRemapDescription | ( | std::string const & | mapName, |
std::string const & | remapName ) const |
Get the description of the selected memory remap.
[in] | mapName | Name of the memory map containing the selected memory remap. |
[in] | remapName | Name of the selected memory remap. |
int MemoryMapInterface::getRemapModeReferenceCount | ( | std::string const & | mapName, |
std::string const & | remapName ) const |
Get the number of mode references for a selected remap.
[in] | mapName | Memory map containing the remap. |
[in] | remapName | The name of the remap. |
std::vector< std::pair< unsigned int, std::string > > MemoryMapInterface::getRemapModeReferences | ( | std::string const & | mapName, |
std::string const & | remapName ) const |
Get the mode references of a selected remap.
[in] | mapName | The containing memory map. |
[in] | remapName | The name of the remap. |
std::vector< std::pair< unsigned int, std::string > > MemoryMapInterface::getRemapModeReferencesExcludingRemap | ( | std::string const & | mapName, |
std::string const & | remapName ) const |
Get the mode references of all remaps in memory map (excluding selected remap) as a list of priority, reference pairs.
[in] | mapName | The containing memory map. |
[in] | remapName | The name of the remap to exclude from the mode ref list. |
std::string MemoryMapInterface::getRemapModeReferenceString | ( | std::string const & | mapName, |
std::string const & | remapName ) const |
Get string to display in mode references editor, depending on if remap has no mode references, one mode reference or multiple mode references. Returns an empty string if remap is not found.
[in] | mapName | The containing memory map. |
[in] | remapName | The name of the remap. |
std::vector< std::string > MemoryMapInterface::getRemapNames | ( | std::string const & | mapName | ) | const |
Get the names of available memory remaps in the selected memory map.
[in] | mapName | Name of the selected memory map. |
MemoryRemap * MemoryMapInterface::getRemapPointer | ( | std::string const & | mapName, |
std::string const & | remapName ) const |
Get a pointer to the selected memory remap (for index construction).
[in] | mapName | Name of the memory map containing the selected memory remap. |
[in] | remapName | Name of the selected memory remap. |
std::string MemoryMapInterface::getRemapState | ( | std::string const & | mapName, |
std::string const & | remapName = "" ) const |
Get the remap state of the selected item.
[in] | mapName | Name of the selected memory map. |
[in] | remapName | Name of the selected memory remap. |
SubspaceMapInterface * MemoryMapInterface::getSubspaceMapInterface | ( | ) | const |
Get the subspace map interface.
|
finaloverridevirtual |
bool MemoryMapInterface::itemHasValidIsPresent | ( | std::string const & | mapName, |
std::string const & | remapName = "" ) const |
Check if the selected memory item has a valid is present.
[in] | mapName | Name of the memory map containing the selected memory remap. |
[in] | remapName | Name of the selected memory remap. |
|
finaloverridevirtual |
Check if the selected item has a valid name.
[in] | itemName | Name of the selected item. |
Implements NameGroupInterface.
bool MemoryMapInterface::memoryMapHasValidAddressUnitBits | ( | std::string const & | mapName | ) | const |
Check if the selected memory map has a valid address unit bits value.
[in] | mapName | Name of the selected memory map. |
std::vector< std::string > MemoryMapInterface::pasteMemoryMaps | ( | ) |
Paste the selected memory maps.
std::vector< std::string > MemoryMapInterface::pasteMemoryRemaps | ( | std::string const & | memoryMapName | ) |
Paste the selected memory remaps.
[in] | memoryMapName | Name of the memory map containing the pasted memory remaps. |
int MemoryMapInterface::remapCount | ( | std::string const & | mapName | ) | const |
Get the number of available memory remaps in the selected memory map.
[in] | mapName | Name of the selected memory map. |
bool MemoryMapInterface::remapHasValidName | ( | std::string const & | mapName, |
std::string const & | itemName ) const |
Check if the selected memory remap has a valid name.
[in] | mapName | Name of the memory map containing the selected memory remap. |
[in] | itemName | Name of the selected memory remap. |
bool MemoryMapInterface::remapHasValidRemapState | ( | std::string const & | mapName, |
std::string const & | itemName ) const |
Check if the selected memory remap has a valid remap state.
[in] | mapName | Name of the memory map containing the selected memory remap. |
[in] | itemName | Name of the selected memory remap. |
bool MemoryMapInterface::removeMap | ( | std::string const & | mapName | ) |
Remove the selected memory map.
[in] | mapName | Name of the selected memory map. |
bool MemoryMapInterface::removeRemap | ( | std::string const & | mapName, |
std::string | remapName ) |
Remove the selected memory remap.
[in] | mapName | Name of the memory map containing the selected memory remap. |
[in] | remapName | Name of the selected memory remap. |
bool MemoryMapInterface::removeRemapModeReference | ( | std::string const & | mapName, |
std::string const & | remapName, | ||
int | modeReferenceIndex ) |
Remove a selected mode reference of a given remap.
[in] | mapName | The containing memory map. |
[in] | remapName | The name of the remap to remove a mode reference of. |
[in] | modeReferenceIndex | The index of the mode reference to be removed. |
void MemoryMapInterface::setAddressBlockInterface | ( | AddressBlockInterface * | blockInterface | ) |
Set a new address block interface.
[in] | blockInterface | The new address block interface. |
bool MemoryMapInterface::setAddressUnitBits | ( | std::string const & | mapName, |
std::string const & | newAddressUnitBits ) const |
Set the address unit bits for the selected memory map.
[in] | mapName | Name of the selected memory map. |
[in] | newAddressUnitBits | New address unit bits. |
bool MemoryMapInterface::setIsPresent | ( | std::string const & | mapName, |
std::string const & | newIsPresent, | ||
std::string const & | remapName = "" ) |
Set a new is present value for the selected item.
[in] | mapName | Name of the selected memory map. |
[in] | remapName | Name of the selected memory remap. |
[in] | newIsPresent | New is present value. |
void MemoryMapInterface::setMemoryMaps | ( | QSharedPointer< Component > | component | ) |
Set available memory maps.
[in] | component | Component containing the memory maps. |
void MemoryMapInterface::setModeReferenceInterface | ( | ModeReferenceInterface * | modeRefInterface | ) |
Set the mode reference interface used for accessing remap mode references.
[in] | modeRefInterface | Description |
|
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 MemoryMapInterface::setRemapDescription | ( | std::string const & | mapName, |
std::string const & | itemName, | ||
std::string const & | newDescription ) |
Set a new description for the selected memory remap.
[in] | mapName | Name of the memory map containing the selected memory remap. |
[in] | itemName | Name of the selected memory remap. |
[in] | newDescription | New description. |
bool MemoryMapInterface::setRemapModeReferences | ( | std::string const & | mapName, |
std::string const & | remapName, | ||
std::vector< std::pair< unsigned int, std::string > > const & | newModeRefs ) |
Set the mode references of given remap.
[in] | mapName | The containing memory map. |
[in] | remapName | The name of the remap whose mode references are set. |
[in] | newModeRefs | The mode references to set. |
bool MemoryMapInterface::setRemapName | ( | std::string const & | mapName, |
std::string const & | currentName, | ||
std::string const & | newName ) |
Set a new name for the selected memory remap.
[in] | mapName | Name of the memory map containing the selected memory remap. |
[in] | currentName | Name of the selected memory remap. |
[in] | newName | New name for the memory remap. |
bool MemoryMapInterface::setRemapState | ( | std::string const & | mapName, |
std::string const & | remapName, | ||
std::string const & | newRemapState ) |
Set the remap state for the selected item.
[in] | mapName | Name of the selected memory map. |
[in] | remapName | Name of the selected memory remap. |
[in] | newRemapState | New remap state. |
void MemoryMapInterface::setSubspaceMapInterface | ( | SubspaceMapInterface * | submapInterface | ) |
Set a new subspace map interface.
[in] | submapInterface | The new subspace map interface. |
|
finaloverridevirtual |
Validates the contained items.
Implements CommonInterface.