Kactus2
Kactus2 reference guide
Loading...
Searching...
No Matches
AbstractionTypeInterface.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// File: AbstractionTypeInterface.h
3//-----------------------------------------------------------------------------
4// Project: Kactus2
5// Author: Mikko Teuho
6// Date: 01.03.2021
7//
8// Description:
9// Interface for accessing abstraction types.
10//-----------------------------------------------------------------------------
11
12#ifndef ABSTRACTIONTYPEINTERFACE_H
13#define ABSTRACTIONTYPEINTERFACE_H
14
15#include <IPXACTmodels/generaldeclarations.h>
16
17#include "KactusAPI/KactusAPIGlobal.h"
18
19#include <CommonInterface.h>
20
21#include <QSharedPointer>
22
23class AbstractionDefinition;
24class AbstractionType;
25class AbstractionTypeValidator;
26class Component;
27class ConfigurableVLNVReference;
30
31//-----------------------------------------------------------------------------
33//-----------------------------------------------------------------------------
35{
36public:
37
46 QSharedPointer<AbstractionTypeValidator> validator, LibraryInterface* library);
47
51 virtual ~AbstractionTypeInterface() = default;
52
60 void setAbstractionTypes(QSharedPointer<QList<QSharedPointer<AbstractionType> > > newAbstractions,
61 General::InterfaceMode busMode, QString const& systemGroup);
62
68 void setBusMode(General::InterfaceMode busMode);
69
75 void setSystemGroup(QString const& systemGroup);
76
84 QSharedPointer<AbstractionType> getAbstraction(int const& abstractionIndex) const;
85
93 bool setupAbstractionTypeForPortMapInterface(int const& abstractionTypeIndex);
94
102 bool setupAbstractionDefinitionForPortMapInterface(int const& abstractionTypeIndex);
103
111 std::string getIndexedAbstraction(int const& itemIndex) const;
112
120 QSharedPointer<ConfigurableVLNVReference> getAbstractionReference(int const& typeIndex) const;
121
127 std::string getAbstractionReferenceString() const;
128
134 std::vector<std::string> getAbstractionReferences() const;
135
143 bool hasAbstractionReference(int const& typeIndex) const;
144
150 virtual int itemCount() const override final;
151
157 virtual std::vector<std::string> getItemNames() const override final;
158
170 bool setAbstraction(int const& abstractionIndex, std::string const& newVendor, std::string const& newLibrary,
171 std::string const& newName, std::string const& newVersion);
172
180 std::vector<std::string> getViewReferences(int const& abstractionIndex) const;
181
189 std::string getCombinedViews(int const& abstractionIndex) const;
190
199 bool setViewReferences(int const& abstractionIndex, std::vector<std::string> newViews);
200
208 std::vector<std::string> getPhysicalPortsFromPortMaps(int const& abstractionIndex) const;
209
215 virtual bool validateItems() const override final;
216
224 bool hasValidAbstractionReference(int const& typeIndex) const;
225
233 bool hasValidViewReferences(int const& typeIndex) const;
234
240 void addAbstraction(int const& typeIndex);
241
250 void addAbstractionType(std::string const& newVendor, std::string const& newLibrary,
251 std::string const& newName, std::string const& newVersion) const;
252
260 bool removeAbstraction(int const& typeIndex);
261
268
271 AbstractionTypeInterface& operator=(const AbstractionTypeInterface& other) = delete;
272
273private:
274
275 //-----------------------------------------------------------------------------
276 // Data.
277 //-----------------------------------------------------------------------------
278
280 QSharedPointer<QList<QSharedPointer<AbstractionType> > > abstractions_{ nullptr };
281
283 PortMapInterface* portMapInterface_;
284
286 QSharedPointer<AbstractionTypeValidator> validator_;
287
289 LibraryInterface* library_;
290};
291
292#endif // BUSINTERFACEINTERFACE_H
std::vector< std::string > getViewReferences(int const &abstractionIndex) const
void setBusMode(General::InterfaceMode busMode)
std::string getCombinedViews(int const &abstractionIndex) const
virtual bool validateItems() const override final
virtual int itemCount() const override final
void setSystemGroup(QString const &systemGroup)
bool removeAbstraction(int const &typeIndex)
bool hasValidViewReferences(int const &typeIndex) const
void addAbstractionType(std::string const &newVendor, std::string const &newLibrary, std::string const &newName, std::string const &newVersion) const
std::vector< std::string > getAbstractionReferences() const
PortMapInterface * getPortMapInterface() const
QSharedPointer< AbstractionType > getAbstraction(int const &abstractionIndex) const
bool setAbstraction(int const &abstractionIndex, std::string const &newVendor, std::string const &newLibrary, std::string const &newName, std::string const &newVersion)
std::string getIndexedAbstraction(int const &itemIndex) const
void addAbstraction(int const &typeIndex)
bool hasValidAbstractionReference(int const &typeIndex) const
QSharedPointer< ConfigurableVLNVReference > getAbstractionReference(int const &typeIndex) const
bool setupAbstractionDefinitionForPortMapInterface(int const &abstractionTypeIndex)
virtual ~AbstractionTypeInterface()=default
AbstractionTypeInterface(PortMapInterface *portMapInterface, QSharedPointer< AbstractionTypeValidator > validator, LibraryInterface *library)
bool setupAbstractionTypeForPortMapInterface(int const &abstractionTypeIndex)
virtual std::vector< std::string > getItemNames() const override final
std::string getAbstractionReferenceString() const
void setAbstractionTypes(QSharedPointer< QList< QSharedPointer< AbstractionType > > > newAbstractions, General::InterfaceMode busMode, QString const &systemGroup)
bool hasAbstractionReference(int const &typeIndex) const
std::vector< std::string > getPhysicalPortsFromPortMaps(int const &abstractionIndex) const
bool setViewReferences(int const &abstractionIndex, std::vector< std::string > newViews)
CommonInterface()=default
LibraryInterface defines an interface to operate the IP-XACT-library.
Interface for editing port maps.