-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CORRECTIVE] Working version with MemoryMapInterface inherited from I…
…temNamesGetterInterface (that is inherited from NameGroupInterface). The commit is only for saving the working version of the program.
- Loading branch information
1 parent
7cd90e5
commit a0ff034
Showing
18 changed files
with
199 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
|
||
#ifndef ADDRESSSPACEINTERFACE_H | ||
#define ADDRESSSPACEINTERFACE_H | ||
|
||
#include <KactusAPI/KactusAPIGlobal.h> | ||
|
||
#include <MemoryBlockInterface.h> | ||
|
||
#include <IPXACTmodels/generaldeclarations.h> | ||
#include <IPXACTmodels/common/AccessTypes.h> | ||
|
||
class AddressBlock; | ||
class MemoryBlockBase; | ||
class AddressBlockValidator; | ||
class RegisterInterface; | ||
class BusInterfaceInterface; | ||
|
||
#include <QVector> | ||
#include <QMap> | ||
#include <ItemNamesGetterInterface.h> | ||
|
||
template <typename T> | ||
class KACTUS2_API AddressSpaceInterface : public ItemNamesGetterInterface<T> | ||
{ | ||
|
||
public: | ||
AddressSpaceInterface(); | ||
using ItemNamesGetterInterface<T>::ItemNamesGetterInterface; | ||
|
||
virtual int getItemIndex(std::string const& itemName) const override final; | ||
|
||
}; | ||
|
||
#endif // ADDRESSSPACEINTERFACE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,31 @@ | ||
#ifndef ITEMNAMESGETTER_H | ||
#define ITEMNAMESGETTER_H | ||
#include "CommonInterface.h" | ||
#include "NameGroupInterface.h" | ||
#include <QSharedPointer> | ||
#include <QList> | ||
template <typename T> | ||
class KACTUS2_API ItemNamesGetterInterface : public CommonInterface | ||
class KACTUS2_API ItemNamesGetterInterface : public NameGroupInterface | ||
{ | ||
public: | ||
ItemNamesGetterInterface(QSharedPointer<QList<QSharedPointer<T>>> reservedNames); | ||
ItemNamesGetterInterface(QSharedPointer<QList<QSharedPointer<T>>> existingItems); | ||
ItemNamesGetterInterface(); | ||
virtual ~ItemNamesGetterInterface() = default; | ||
|
||
std::vector<std::string> getItemNames() const override; | ||
|
||
int itemCount() const override; | ||
int itemCount() const override; // Implemented only as a placeholder to make a class not abstract | ||
|
||
bool validateItems() const override; | ||
bool validateItems() const override; // Implemented only as a placeholder to make a class not abstract | ||
|
||
int getItemIndex(std::string const& itemName) const override; // Implemented only as a placeholder to make a class not abstract | ||
std::string getIndexedItemName(int itemIndex) const override; // Implemented only as a placeholder to make a class not abstract | ||
bool setName(std::string const& currentName, std::string const& newName) override; // Implemented only as a placeholder to make a class not abstract | ||
|
||
bool itemHasValidName(std::string const& itemName) const override; | ||
protected: | ||
QSharedPointer<QList<QSharedPointer<T>>> existingItems_; | ||
private: | ||
QSharedPointer<QList<QSharedPointer<T>>> reservedNames_; | ||
QSharedPointer<NameGroup> getItem(std::string const& itemName) const override; | ||
}; | ||
#endif // ITEMNAMESGETTER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
#include "AddressSpaceInterface.h" | ||
|
||
#include <AddressBlockExpressionsGatherer.h> | ||
|
||
#include <IPXACTmodels/Component/MemoryBlockBase.h> | ||
#include <IPXACTmodels/Component/AddressBlock.h> | ||
#include <IPXACTmodels/Component/AccessPolicy.h> | ||
#include <IPXACTmodels/Component/validators/AddressBlockValidator.h> | ||
|
||
template <typename T> | ||
AddressSpaceInterface<T>::AddressSpaceInterface() { | ||
|
||
} | ||
|
||
template <typename T> | ||
int AddressSpaceInterface<T>::getItemIndex(std::string const& itemName) const | ||
{ | ||
QString itemNameQ = QString::fromStdString(itemName); | ||
|
||
int index = 0; | ||
for (const auto& item : *this->existingItems_) { | ||
if (item->getName() == itemNameQ) { | ||
return index; | ||
} | ||
++index; | ||
} | ||
|
||
return -1; | ||
} |
Oops, something went wrong.