Skip to content

Commit

Permalink
[CLEANUP] Remove obsolete constructors in abstraction and bus definit…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
epekkar committed Nov 17, 2023
1 parent c850af0 commit 7e6f7f9
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 119 deletions.
12 changes: 2 additions & 10 deletions IPXACTmodels/AbstractionDefinition/AbstractionDefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,14 @@
#include <QStringList>
#include <QXmlStreamWriter>

//-----------------------------------------------------------------------------
// Function: AbstractionDefinition::AbstractionDefinition()
//-----------------------------------------------------------------------------
AbstractionDefinition::AbstractionDefinition():
Document()
{

}

//-----------------------------------------------------------------------------
// Function: AbstractionDefinition::AbstractionDefinition()
//-----------------------------------------------------------------------------
AbstractionDefinition::AbstractionDefinition(VLNV const& vlnv, Document::Revision revision):
Document(revision)
Document(vlnv, revision)
{
setVlnv(vlnv);

}

//-----------------------------------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions IPXACTmodels/AbstractionDefinition/AbstractionDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ class IPXACTMODELS_EXPORT AbstractionDefinition: public Document
{
public:

//! The default constructor.
AbstractionDefinition();

AbstractionDefinition(VLNV const& vlnv, Document::Revision revision);

//! Copy constructor.
Expand Down
9 changes: 0 additions & 9 deletions IPXACTmodels/BusDefinition/BusDefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@
#include <QStringList>
#include <QXmlStreamWriter>

//-----------------------------------------------------------------------------
// Function: BusDefinition::BusDefinition()
//-----------------------------------------------------------------------------
BusDefinition::BusDefinition():
Document()
{

}

//-----------------------------------------------------------------------------
// Function: BusDefinition::BusDefinition()
//-----------------------------------------------------------------------------
Expand Down
5 changes: 1 addition & 4 deletions IPXACTmodels/BusDefinition/BusDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ class IPXACTMODELS_EXPORT BusDefinition: public Document
{
public:

//! The default constructor.
BusDefinition();

BusDefinition(VLNV const& vlnv, Document::Revision revision);

//! Copy constructor.
Expand All @@ -50,7 +47,7 @@ class IPXACTMODELS_EXPORT BusDefinition: public Document
BusDefinition &operator=(BusDefinition const& other);

//! The destructor.
virtual ~BusDefinition();
~BusDefinition() final;

/*!
* Creates a perfect copy of the Bus Definition.
Expand Down
4 changes: 0 additions & 4 deletions IPXACTmodels/IPXACTmodels.pri
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
# This file is generated by the Qt Visual Studio Tools.
# ------------------------------------------------------

# This is a reminder that you are using a generated .pro file.
# Remove it when you are finished editing this file.
message("You are running qmake on a generated .pro file. This may not work!")


HEADERS += ./generaldeclarations.h \
./ipxactmodels_global.h \
Expand Down
2 changes: 1 addition & 1 deletion IPXACTmodels/common/DirectionTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//-----------------------------------------------------------------------------
// Function: DirectionTypes::convert2Mirrored()
//-----------------------------------------------------------------------------
constexpr DirectionTypes::Direction DirectionTypes::convert2Mirrored(Direction originalDirection )
DirectionTypes::Direction DirectionTypes::convert2Mirrored(Direction originalDirection )
{
if (originalDirection == DirectionTypes::IN)
{
Expand Down
2 changes: 1 addition & 1 deletion IPXACTmodels/common/DirectionTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace DirectionTypes
*
* @return The mirrored direction.
*/
IPXACTMODELS_EXPORT constexpr DirectionTypes::Direction convert2Mirrored(
IPXACTMODELS_EXPORT DirectionTypes::Direction convert2Mirrored(
DirectionTypes::Direction originalDirection);

/*!
Expand Down
58 changes: 11 additions & 47 deletions IPXACTmodels/common/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <IPXACTmodels/common/GenericVendorExtension.h>
#include <IPXACTmodels/common/VLNV.h>

#include <IPXACTmodels/utilities/Copy.h>

#include <IPXACTmodels/generaldeclarations.h>

#include <IPXACTmodels/kactusExtensions/Kactus2Group.h>
Expand All @@ -24,18 +26,6 @@
#include <QList>
#include <QStringList>

//-----------------------------------------------------------------------------
// Function: Document::Document()
//-----------------------------------------------------------------------------
Document::Document(Revision revision):
Extendable(),

revision_(revision)
{
addDefaultNameSpaces(revision);
setSchemaLocation(revision);
}

//-----------------------------------------------------------------------------
// Function: Document::Document()
//-----------------------------------------------------------------------------
Expand All @@ -60,8 +50,8 @@ Extendable(other),
xmlNameSpaces_(other.xmlNameSpaces_),
xmlSchemaLocation_(other.xmlSchemaLocation_)
{
copyParameters(other);
copyAssertions(other);
Copy::copyList(other.parameters_, parameters_);
Copy::copyList(other.assertions_, assertions_);
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -89,8 +79,11 @@ Document & Document::operator=( const Document &other )
xmlNameSpaces_ = other.xmlNameSpaces_;
xmlSchemaLocation_ = other.xmlSchemaLocation_;

copyParameters(other);
copyAssertions(other);
parameters_->clear();
Copy::copyList(other.parameters_, parameters_);

assertions_->clear();
Copy::copyList(other.assertions_, assertions_);

}
return *this;
Expand Down Expand Up @@ -190,7 +183,7 @@ QSharedPointer<QList<QSharedPointer<Assertion> > > Document::getAssertions() con
//-----------------------------------------------------------------------------
void Document::setTopComments(QString const& comment)
{
topComments_ = comment.split(QStringLiteral("\n"));
topComments_ = comment.split(QLatin1Char('\n'));
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -265,7 +258,7 @@ void Document::setSchemaLocation(Document::Revision revision)
}
else
{
xmlSchemaLocation_ = QStringLiteral("");
xmlSchemaLocation_ = QString();
}
}

Expand Down Expand Up @@ -584,35 +577,6 @@ void Document::addDefaultNameSpaces(Revision revision)
xmlNameSpaces_.append(qMakePair(QStringLiteral("kactus2"), QStringLiteral("http://kactus2.cs.tut.fi")));
}

//-----------------------------------------------------------------------------
// Function: Document::copyParameters()
//-----------------------------------------------------------------------------
void Document::copyParameters(Document const& other)
{
parameters_->reserve(other.parameters_->count());
for (QSharedPointer<Parameter> parameter : *other.parameters_)
{
QSharedPointer<Parameter> copy = QSharedPointer<Parameter>(new Parameter(*parameter.data()));
parameters_->append(copy);
}
}

//-----------------------------------------------------------------------------
// Function: Document::copyAssertions()
//-----------------------------------------------------------------------------
void Document::copyAssertions(Document const& other)
{
assertions_->reserve(other.assertions_->count());
for (QSharedPointer<Assertion> assertion : *other.assertions_)
{
if (assertion)
{
QSharedPointer<Assertion> copy = QSharedPointer<Assertion>(new Assertion(*assertion.data()));
assertions_->append(copy);
}
}
}

//-----------------------------------------------------------------------------
// Function: Document::getTags()
//-----------------------------------------------------------------------------
Expand Down
24 changes: 0 additions & 24 deletions IPXACTmodels/common/Document.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ class IPXACTMODELS_EXPORT Document : public Extendable
Std14, Std22, Unknown
};

//! The default constructor.
explicit Document(Revision revision = Revision::Unknown);

/*!
* The constructor.
*
Expand Down Expand Up @@ -369,27 +366,6 @@ class IPXACTMODELS_EXPORT Document : public Extendable
* Add the default namespaces to the list of namespaces.
*/
void addDefaultNameSpaces(Revision revision);

/*!
* Copies parameters from another document.
*
* @param [in] other The document to copy parameters from.
*/
void copyParameters(Document const& other);

/*!
* Copies assertions from another document.
*
* @param [in] other The document to copy assertions from.
*/
void copyAssertions(Document const& other);

/*!
* Copies vendor extensions from another document.
*
* @param [in] other The document to copy extensions from.
*/
void copyVendorExtensions(const Document & other);

/*!
* Get the group container for document tags.
Expand Down
8 changes: 3 additions & 5 deletions editors/ComponentEditor/ports/portseditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ void PortsEditor::onCreateNewInteface(QStringList const& selectedPorts)
}

// Create a bus definition.
QSharedPointer<BusDefinition> busDef(new BusDefinition());
busDef->setVlnv(busVLNV);
QSharedPointer<BusDefinition> busDef(new BusDefinition(busVLNV, component_->getRevision()));

// Create the file for the bus definition.
if (!handler_->writeModelToFile(absDirectory, busDef))
Expand All @@ -287,9 +286,8 @@ void PortsEditor::onCreateNewInteface(QStringList const& selectedPorts)
}

// create an abstraction definition
QSharedPointer<AbstractionDefinition> absDef(new AbstractionDefinition());
absDef->setVlnv(absVLNV);

QSharedPointer<AbstractionDefinition> absDef(new AbstractionDefinition(absVLNV, component_->getRevision()));

// set reference from abstraction definition to bus definition
absDef->setBusType(busVLNV);

Expand Down
4 changes: 2 additions & 2 deletions mainwindow/DockWidgetHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ void DockWidgetHandler::setupLibraryDock()
connect(this, SIGNAL(generateIntegrityReport()), libraryWidget_,
SLOT(onGenerateIntegrityReport()), Qt::UniqueConnection);

connect(libraryWidget_, SIGNAL(createAbsDef(const VLNV&, const QString&)),
mainWindow_, SLOT(createAbsDef(const VLNV&, const QString&)), Qt::UniqueConnection);
connect(libraryWidget_, SIGNAL(createAbsDef(const VLNV&, Document::Revision, const QString&)),
mainWindow_, SLOT(createAbsDef(const VLNV&, Document::Revision, const QString&)), Qt::UniqueConnection);

connect(libraryWidget_, SIGNAL(createDesignForExistingComponent(const VLNV&)),
mainWindow_, SLOT(createDesignForExistingComponent(const VLNV&)), Qt::UniqueConnection);
Expand Down
5 changes: 3 additions & 2 deletions mainwindow/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2195,6 +2195,8 @@ void MainWindow::createAbsDef( const VLNV& busDefVLNV, const QString& directory
Q_ASSERT(busDefVLNV.isValid());
Q_ASSERT(!directory.isEmpty());

auto busDef = libraryHandler_->getModelReadOnly(busDefVLNV);

VLNV absVLNV = busDefVLNV;

// remove the possible .busDef from the end of the name field
Expand Down Expand Up @@ -2222,8 +2224,7 @@ void MainWindow::createAbsDef( const VLNV& busDefVLNV, const QString& directory
}

// create an abstraction definition
QSharedPointer<AbstractionDefinition> absDef = QSharedPointer<AbstractionDefinition>(new AbstractionDefinition());
absDef->setVlnv(absVLNV);
auto absDef = QSharedPointer<AbstractionDefinition>(new AbstractionDefinition(absVLNV, busDef->getRevision()));
absDef->setVersion(VersionHelper::versionFileStr());

// set reference from abstraction definition to bus definition
Expand Down
14 changes: 7 additions & 7 deletions version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
#ifndef VERSIONNO__H
#define VERSIONNO__H

#define VERSION_FULL 3.12.992.0
#define VERSION_FULL 3.12.993.0

#define VERSION_BASEYEAR 0
#define VERSION_DATE "2023-11-17"
#define VERSION_TIME "14:03:13"
#define VERSION_TIME "14:35:14"

#define VERSION_MAJOR 3
#define VERSION_MINOR 12
#define VERSION_BUILDNO 992
#define VERSION_BUILDNO 993
#define VERSION_EXTEND 0

#define VERSION_FILE 3,12,992,0
#define VERSION_PRODUCT 3,12,992,0
#define VERSION_FILESTR "3,12,992,0"
#define VERSION_PRODUCTSTR "3,12,992,0"
#define VERSION_FILE 3,12,993,0
#define VERSION_PRODUCT 3,12,993,0
#define VERSION_FILESTR "3,12,993,0"
#define VERSION_PRODUCTSTR "3,12,993,0"

#endif

0 comments on commit 7e6f7f9

Please sign in to comment.