Skip to content

Commit

Permalink
Merge branch 'std-update' of github.com:kactus2/kactus2dev into std-u…
Browse files Browse the repository at this point in the history
…pdate
  • Loading branch information
epekkar committed Nov 29, 2023
2 parents bebec6f + 0fad6f8 commit a65d198
Show file tree
Hide file tree
Showing 39 changed files with 680 additions and 478 deletions.
57 changes: 22 additions & 35 deletions IPXACTmodels/Component/ComponentGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,14 @@

#include "ComponentGenerator.h"

#include <IPXACTmodels/utilities/Copy.h>

#include <IPXACTmodels/common/Parameter.h>

#include <QList>
#include <QSharedPointer>
#include <QString>

//-----------------------------------------------------------------------------
// Function: ComponentGenerator::ComponentGenerator()
//-----------------------------------------------------------------------------
ComponentGenerator::ComponentGenerator():
NameGroup(),
Extendable(),
hidden_(),
scope_(ComponentGenerator::NO_SCOPE),
phase_(),
parameters_(new QList<QSharedPointer<Parameter> >()),
apiType_(ComponentGenerator::EMPTY_API_TYPE),
transportMethods_(),
generatorExe_(),
groups_()
{
}

//-----------------------------------------------------------------------------
// Function: ComponentGenerator::ComponentGenerator()
//-----------------------------------------------------------------------------
Expand All @@ -43,17 +28,13 @@ Extendable(other),
hidden_(other.hidden_),
scope_(other.scope_),
phase_(other.phase_),
parameters_(new QList<QSharedPointer<Parameter> >()),
apiType_(other.apiType_),
apiService_(other.apiService_),
transportMethods_(other.transportMethods_),
generatorExe_(other.generatorExe_),
groups_(other.groups_)
{
foreach (QSharedPointer<Parameter> parameter, *other.parameters_)
{
QSharedPointer<Parameter> copy = QSharedPointer<Parameter>(new Parameter(*parameter.data()));
parameters_->append(copy);
}
Copy::copyList(other.parameters_, parameters_);
}

//-----------------------------------------------------------------------------
Expand All @@ -69,27 +50,17 @@ ComponentGenerator& ComponentGenerator::operator=(ComponentGenerator const& othe
scope_ = other.scope_;
phase_ = other.phase_;
apiType_ = other.apiType_;
apiService_ = other.apiService_;
generatorExe_ = other.generatorExe_;
groups_ = other.groups_;

parameters_->clear();
foreach (QSharedPointer<Parameter> parameter, *other.parameters_)
{
QSharedPointer<Parameter> copy = QSharedPointer<Parameter>(new Parameter(*parameter.data()));
parameters_->append(copy);
}
Copy::copyList(other.parameters_, parameters_);
}

return *this;
}

//-----------------------------------------------------------------------------
// Function: ComponentGenerator::~ComponentGenerator()
//-----------------------------------------------------------------------------
ComponentGenerator::~ComponentGenerator()
{
}

//-----------------------------------------------------------------------------
// Function: ComponentGenerator::setHidden()
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -208,3 +179,19 @@ QStringList ComponentGenerator::getGroups() const
{
return groups_;
}

//-----------------------------------------------------------------------------
// Function: ComponentGenerator::getApiService()
//-----------------------------------------------------------------------------
QString ComponentGenerator::getApiService() const
{
return apiService_;
}

//-----------------------------------------------------------------------------
// Function: ComponentGenerator::setApiService()
//-----------------------------------------------------------------------------
void ComponentGenerator::setApiService(QString const& newApiService)
{
apiService_ = newApiService;
}
38 changes: 29 additions & 9 deletions IPXACTmodels/Component/ComponentGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ class IPXACTMODELS_EXPORT ComponentGenerator : public NameGroup, public Extendab
public:

//! Indicates the type of API used by the generator.
enum ApiType
{
enum class ApiType
{
TGI_2022_BASE,
TBGI_2022_EXTENDED,
TGI_2014_BASE,
TGI_2014_EXTENDED,
TGI_2009,
Expand All @@ -43,15 +45,15 @@ class IPXACTMODELS_EXPORT ComponentGenerator : public NameGroup, public Extendab
};

//! Specifies if the generator shall be run once for all instances or once for each instance of this component.
enum Scope
enum class Scope
{
INSTANCE,
ENTITY,
NO_SCOPE
};

//! The constructor.
ComponentGenerator();
ComponentGenerator() = default;

//! Copy constructor.
ComponentGenerator(const ComponentGenerator &other);
Expand All @@ -60,9 +62,9 @@ class IPXACTMODELS_EXPORT ComponentGenerator : public NameGroup, public Extendab
ComponentGenerator &operator=(const ComponentGenerator &other);

//! The destructor.
~ComponentGenerator();
~ComponentGenerator() override = default;

/*! Set the hidden setting for this component generator.
/*! Set the hidden setting for this component generator.
*
* @param [in] hidden The hidden value to set.
*/
Expand Down Expand Up @@ -151,23 +153,41 @@ class IPXACTMODELS_EXPORT ComponentGenerator : public NameGroup, public Extendab
* @return The names of the groups this generator belongs to.
*/
QStringList getGroups() const;

/*!
* Get the component generator transport service.
*
* @return The transport service used by the component generator.
*/
QString getApiService() const;

/*!
* Set the component generator transport service.
*
* @param [in] newApiService The transport service to set.
*/
void setApiService(QString const& newApiService);

private:

//! Specifies if this generator can be run as standalone or if it must be run as part of a generator chain.
BooleanValue hidden_;

//! Indicates if the generator shall be run once for all instances or once for each instance of this component.
Scope scope_;
Scope scope_ = ComponentGenerator::Scope::NO_SCOPE;

//! Determines the generator phase in a sequence of generator runs.
QString phase_;

// Specifies any component generator specific parameters.
QSharedPointer<QList<QSharedPointer<Parameter> > > parameters_;
QSharedPointer<QList<QSharedPointer<Parameter> > > parameters_ =
QSharedPointer<QList<QSharedPointer<Parameter> > >(new QList<QSharedPointer<Parameter> >());

//! Indicates the type of API used by the generator.
ApiType apiType_;
ApiType apiType_ = ComponentGenerator::ApiType::EMPTY_API_TYPE;

//! Indicates which transport service is used.
QString apiService_;

//! The alternate SOAP transport protocols supported by the component generator.
QStringList transportMethods_;
Expand Down
Loading

0 comments on commit a65d198

Please sign in to comment.