Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/asan-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true
# install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
submodules: true
# install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
os: [macos-15, macos-14, macos-13]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true
# install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/naja_app_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/najaeda-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/najaeda-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v2
2 changes: 1 addition & 1 deletion .github/workflows/snl_python_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
os: [ubuntu-24.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true
# install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
Expand Down
30 changes: 16 additions & 14 deletions src/core/NajaCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class NajaSingletonCollection: public NajaBaseCollection<Type*> {
class NajaSingletonCollectionIterator: public NajaBaseIterator<Type*> {
public:
NajaSingletonCollectionIterator(const NajaSingletonCollectionIterator&) = default;
NajaSingletonCollectionIterator(Type* object, bool beginOrEnd=true): object_(object) {
explicit NajaSingletonCollectionIterator(Type* object, bool beginOrEnd=true): object_(object) {
if (object_) {
if (beginOrEnd) {
begin_ = true;
Expand Down Expand Up @@ -94,7 +94,7 @@ class NajaSingletonCollection: public NajaBaseCollection<Type*> {
NajaSingletonCollection() = delete;
NajaSingletonCollection(const NajaSingletonCollection&) = delete;
NajaSingletonCollection(NajaSingletonCollection&&) = delete;
NajaSingletonCollection(Type* object): super(), object_(object) {}
explicit NajaSingletonCollection(Type* object): super(), object_(object) {}

NajaBaseCollection<Type*>* clone() const override {
return new NajaSingletonCollection(object_);
Expand Down Expand Up @@ -123,7 +123,7 @@ class NajaIntrusiveSetCollection: public NajaBaseCollection<typename Set::value_
public:
using SetIterator = typename Set::const_iterator;
NajaIntrusiveSetCollectionIterator(const NajaIntrusiveSetCollectionIterator&) = default;
NajaIntrusiveSetCollectionIterator(const Set* set, bool beginOrEnd=true): set_(set) {
explicit NajaIntrusiveSetCollectionIterator(const Set* set, bool beginOrEnd=true): set_(set) {
if (set_) {
if (beginOrEnd) {
it_ = set->begin();
Expand Down Expand Up @@ -162,7 +162,7 @@ class NajaIntrusiveSetCollection: public NajaBaseCollection<typename Set::value_
NajaIntrusiveSetCollection() = delete;
NajaIntrusiveSetCollection(const NajaIntrusiveSetCollection&) = delete;
NajaIntrusiveSetCollection(NajaIntrusiveSetCollection&&) = delete;
NajaIntrusiveSetCollection(const Set* set): super(), set_(set) {}
explicit NajaIntrusiveSetCollection(const Set* set): super(), set_(set) {}

NajaBaseCollection<Type*>* clone() const override {
return new NajaIntrusiveSetCollection(set_);
Expand All @@ -188,7 +188,7 @@ class NajaSTLCollection: public NajaBaseCollection<typename STLType::value_type>
using STLTypeIterator = typename STLType::const_iterator;

NajaSTLCollectionIterator(NajaSTLCollectionIterator&) = default;
NajaSTLCollectionIterator(const STLType* container, bool beginOrEnd=true): container_(container) {
explicit NajaSTLCollectionIterator(const STLType* container, bool beginOrEnd=true): container_(container) {
if (container_) {
if (beginOrEnd) {
it_ = container_->begin();
Expand Down Expand Up @@ -221,7 +221,7 @@ class NajaSTLCollection: public NajaBaseCollection<typename STLType::value_type>
NajaSTLCollection() = delete;
NajaSTLCollection(const NajaSTLCollection&) = delete;
NajaSTLCollection(NajaSTLCollection&&) = delete;
NajaSTLCollection(const STLType* container): super(), container_(container) {}
explicit NajaSTLCollection(const STLType* container): super(), container_(container) {}
NajaBaseCollection<typename STLType::value_type>* clone() const override {
return new NajaSTLCollection(container_);
}
Expand Down Expand Up @@ -253,7 +253,7 @@ class NajaSTLMapCollection: public NajaBaseCollection<typename STLMapType::mappe
using STLMapTypeIterator = typename STLMapType::const_iterator;

NajaSTLMapCollectionIterator(NajaSTLMapCollectionIterator&) = default;
NajaSTLMapCollectionIterator(const STLMapType* container, bool beginOrEnd=true): container_(container) {
explicit NajaSTLMapCollectionIterator(const STLMapType* container, bool beginOrEnd=true): container_(container) {
if (container_) {
if (beginOrEnd) {
it_ = container_->begin();
Expand Down Expand Up @@ -286,7 +286,7 @@ class NajaSTLMapCollection: public NajaBaseCollection<typename STLMapType::mappe
NajaSTLMapCollection() = delete;
NajaSTLMapCollection(const NajaSTLMapCollection&) = delete;
NajaSTLMapCollection(NajaSTLMapCollection&&) = delete;
NajaSTLMapCollection(const STLMapType* container): super(), container_(container) {}
explicit NajaSTLMapCollection(const STLMapType* container): super(), container_(container) {}
NajaBaseCollection<typename STLMapType::mapped_type>* clone() const override {
return new NajaSTLMapCollection(container_);
}
Expand Down Expand Up @@ -315,7 +315,7 @@ template<class Type, class ParentType> class NajaParentTypeCollection: public Na
class NajaParentTypeCollectionIterator: public NajaBaseIterator<ParentType> {
public:
using super = NajaBaseIterator<ParentType>;
NajaParentTypeCollectionIterator(const NajaBaseCollection<Type>* collection, bool beginOrEnd=true):
explicit NajaParentTypeCollectionIterator(const NajaBaseCollection<Type>* collection, bool beginOrEnd=true):
super() {
if (collection) {
endIt_ = collection->end();
Expand Down Expand Up @@ -369,7 +369,7 @@ template<class Type, class ParentType> class NajaParentTypeCollection: public Na
NajaParentTypeCollection(const NajaParentTypeCollection&) = delete;
NajaParentTypeCollection& operator=(const NajaParentTypeCollection&) = delete;
NajaParentTypeCollection(const NajaParentTypeCollection&&) = delete;
NajaParentTypeCollection(const NajaBaseCollection<Type>* collection):
explicit NajaParentTypeCollection(const NajaBaseCollection<Type>* collection):
super(), collection_(collection)
{}
~NajaParentTypeCollection() {
Expand Down Expand Up @@ -408,15 +408,16 @@ template<class Type, class SubType> class NajaSubTypeCollection: public NajaBase
class NajaSubTypeCollectionIterator: public NajaBaseIterator<SubType> {
public:
using super = NajaBaseIterator<SubType>;
NajaSubTypeCollectionIterator(const NajaBaseCollection<Type>* collection, bool beginOrEnd=true):
explicit NajaSubTypeCollectionIterator(const NajaBaseCollection<Type>* collection, bool beginOrEnd=true):
super() {
if (collection) {
endIt_ = collection->end();
if (not beginOrEnd) {
it_ = endIt_;
} else {
it_ = collection->begin();
while (isValid() and not dynamic_cast<SubType>(it_->getElement())) {
while (NajaSubTypeCollectionIterator::isValid()
and not dynamic_cast<SubType>(it_->getElement())) {
it_->progress();
}
}
Expand Down Expand Up @@ -467,7 +468,7 @@ template<class Type, class SubType> class NajaSubTypeCollection: public NajaBase
NajaSubTypeCollection(const NajaSubTypeCollection&) = delete;
NajaSubTypeCollection& operator=(const NajaSubTypeCollection&) = delete;
NajaSubTypeCollection(const NajaSubTypeCollection&&) = delete;
NajaSubTypeCollection(const NajaBaseCollection<Type>* collection):
explicit NajaSubTypeCollection(const NajaBaseCollection<Type>* collection):
super(), collection_(collection)
{}
~NajaSubTypeCollection() {
Expand Down Expand Up @@ -519,7 +520,8 @@ template<class Type, typename Filter> class NajaFilteredCollection: public NajaB
it_ = endIt_;
} else {
it_ = collection->begin();
while (isValid() and not filter_(it_->getElement())) {
while (NajaFilteredCollectionIterator::isValid()
and not filter_(it_->getElement())) {
it_->progress();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/NajaObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class NajaObject {
virtual ~NajaObject() = default;

static void preCreate() {}
void postCreate() {}
virtual void postCreate() {}
virtual void preDestroy();

private:
Expand Down
1 change: 1 addition & 0 deletions src/nl/nl/nl/NLDesign.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class NLDesign {
enum CompareTypeEnum {
Complete, IgnoreID, IgnoreIDAndName
};
// cppcheck-suppress noExplicitConstructor
CompareType(const CompareTypeEnum& typeEnum);
CompareType(const CompareType& type) = default;
operator const CompareTypeEnum&() const {return typeEnum_;}
Expand Down
6 changes: 3 additions & 3 deletions src/nl/nl/nl/NLID.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct NLID final {

DesignReference() = delete;
DesignReference(const DesignReference&) = default;
DesignReference(const NLID& id):
explicit DesignReference(const NLID& id):
dbID_(id.dbID_),
libraryID_(id.libraryID_),
designID_(id.designID_)
Expand Down Expand Up @@ -99,7 +99,7 @@ struct NLID final {

DesignObjectReference() = delete;
DesignObjectReference(const DesignObjectReference&) = default;
DesignObjectReference(const NLID& id):
explicit DesignObjectReference(const NLID& id):
dbID_(id.dbID_),
libraryID_(id.libraryID_),
designID_(id.designID_),
Expand Down Expand Up @@ -224,7 +224,7 @@ struct NLID final {
NLID() = delete;

///Special constructor for SNLDB
NLID(DBID dbID):
explicit NLID(DBID dbID):
type_(NLID::Type::DB),
dbID_(dbID)
{}
Expand Down
2 changes: 1 addition & 1 deletion src/nl/nl/nl/NLLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class NLLibrary final: public NLObject {
static void preCreate(NLLibrary* parent, NLID::LibraryID id, Type type, const NLName& name);
void destroyFromDB();
void destroyFromParentLibrary();
void postCreate();
void postCreate() override;
void postCreateAndSetID();
void commonPreDestroy();
void preDestroy() override;
Expand Down
3 changes: 2 additions & 1 deletion src/nl/nl/nl/NLName.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace naja { namespace NL {

class NLName {
public:
explicit NLName(const std::string& name = std::string()):
// cppcheck-suppress noExplicitConstructor
NLName(const std::string& name = std::string()):
string_(name)
{}

Expand Down
4 changes: 3 additions & 1 deletion src/nl/nl/nl/NLObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ class NLObject: public NajaObject {
virtual void debugDump(size_t indent, bool recursive=true, std::ostream& stream=std::cerr) const = 0;

protected:
// cppcheck-suppress duplInheritedMember
static void preCreate();
void postCreate();

void postCreate() override;
void preDestroy() override;
};

Expand Down
2 changes: 1 addition & 1 deletion src/nl/nl/nl/NLUniverse.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class NLUniverse final: public NLObject {
private:
NLUniverse() = default;
static void preCreate();
void postCreate();
void postCreate() override;
void preDestroy() override;

void addDBAndSetID(NLDB* db);
Expand Down
2 changes: 1 addition & 1 deletion src/nl/nl/pnl/PNLBitNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PNLBitNet: public PNLNet {
protected:
PNLBitNet() = default;
static void preCreate();
void postCreate();
void postCreate() override;
void preDestroy() override;
//void cloneComponents(PNLBitNet* newNet) const;

Expand Down
2 changes: 1 addition & 1 deletion src/nl/nl/pnl/PNLBitTerm.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PNLBitTerm: public PNLTerm {
protected:
PNLBitTerm() = default;
static void preCreate();
void postCreate();
void postCreate() override;
void preDestroy() override;
private:
PNLBitNet* net_ { nullptr };
Expand Down
2 changes: 1 addition & 1 deletion src/nl/nl/pnl/PNLDesignObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PNLDesignObject: public NL::NLObject {
PNLDesignObject() = default;

static void preCreate();
void postCreate();
void postCreate() override;
};

}} // namespace NL // namespace naja
Expand Down
2 changes: 1 addition & 1 deletion src/nl/nl/pnl/PNLInstTerm.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PNLInstTerm final: public PNLNetComponent {
PNLInstTerm(PNLInstance* instance, PNLBitTerm* term);
static PNLInstTerm* create(PNLInstance* instance, PNLBitTerm* term);
static void preCreate(const PNLInstance* instance, const PNLBitTerm* term);
void postCreate();
void postCreate() override;
void preDestroy() override;
void destroyFromInstance();

Expand Down
19 changes: 8 additions & 11 deletions src/nl/nl/pnl/PNLInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,27 @@
namespace naja {
namespace NL {

PNLInstance::PNLInstance(PNLDesign* design,
PNLDesign* model,
const NLName& name)
: super(), design_(design), model_(model), name_(name) {}
PNLInstance::PNLInstance(PNLDesign* design, PNLDesign* model, const NLName& name):
super(),
design_(design),
model_(model),
name_(name)
{}

void PNLInstance::postCreateAndSetID() {
super::postCreate();
getDesign()->addInstanceAndSetID(this);
commonPostCreate();
}

PNLInstance* PNLInstance::create(PNLDesign* design,
PNLDesign* model,
const NLName& name) {

PNLInstance* PNLInstance::create(PNLDesign* design, PNLDesign* model, const NLName& name) {
preCreate(design, model, name);
auto instance = new PNLInstance(design, model, name);
instance->postCreateAndSetID();
return instance;
}

void PNLInstance::preCreate(PNLDesign* design,
const PNLDesign* model,
const NLName& name) {
void PNLInstance::preCreate(PNLDesign* design, const PNLDesign* model, const NLName& name) {
super::preCreate();
if (not design) {
std::ostringstream reason;
Expand Down
Loading
Loading