Skip to content

Commit

Permalink
*ContFact: Drop setAllContainers
Browse files Browse the repository at this point in the history
The constructor of nearly all "Container Factories" calls a
private member function called setAllContainers. And it's
the only call. And that member function is called from
nowhere else.

So move the contents into the constructor.

(cherry picked from commit 1f3511b)
  • Loading branch information
ChristianTackeGSI authored and karabowi committed Feb 3, 2023
1 parent 393178b commit 65b6434
Show file tree
Hide file tree
Showing 32 changed files with 32 additions and 145 deletions.
6 changes: 1 addition & 5 deletions base/sim/FairBaseContFact.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand Down Expand Up @@ -31,11 +31,7 @@ FairBaseContFact::FairBaseContFact()
: FairContFact("FairBaseContFact", "Factory for parameter containers in libSts")
{
// Constructor (called when the library is loaded)
setAllContainers();
}

void FairBaseContFact::setAllContainers()
{
/** Creates the Container objects with all accepted contexts and adds them to
* the list of containers for the base library.*/
FairContainer* pTest = new FairContainer("FairBaseParSet", "class for parameter io", "DefaultContext");
Expand Down
5 changes: 1 addition & 4 deletions base/sim/FairBaseContFact.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -17,9 +17,6 @@ class FairParSet;
class FairBaseContFact : public FairContFact
{
/** Factory for all Base parameter containers */
private:
void setAllContainers();

public:
/**default ctor*/
FairBaseContFact();
Expand Down
7 changes: 1 addition & 6 deletions examples/MQ/parameters/FairMQExParamsContFact.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -16,11 +16,6 @@ static FairMQExParamsContFact gFairMQExParamsContFact;

FairMQExParamsContFact::FairMQExParamsContFact()
: FairContFact("FairMQExParamsContFact", "Factory for parameter containers in FairMQ Example 7")
{
setAllContainers();
}

void FairMQExParamsContFact::setAllContainers()
{
FairContainer* container =
new FairContainer("FairMQExParamsParOne", "FairMQExParamsParOne Parameters", "TestDefaultContext");
Expand Down
5 changes: 1 addition & 4 deletions examples/MQ/parameters/FairMQExParamsContFact.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -15,9 +15,6 @@ class FairParSet;

class FairMQExParamsContFact : public FairContFact
{
private:
void setAllContainers();

public:
FairMQExParamsContFact();
~FairMQExParamsContFact() override = default;
Expand Down
6 changes: 1 addition & 5 deletions examples/MQ/pixelDetector/src/PixelContFact.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -25,11 +25,7 @@ PixelContFact::PixelContFact()
: FairContFact("PixelContFact", "Factory for parameter containers in libPixel")
{
/** Constructor (called when the library is loaded) */
setAllContainers();
}

void PixelContFact::setAllContainers()
{
/** Creates the Container objects with all accepted
contexts and adds them to
the list of containers for the Pixel library.
Expand Down
5 changes: 1 addition & 4 deletions examples/MQ/pixelDetector/src/PixelContFact.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -14,9 +14,6 @@

class PixelContFact : public FairContFact
{
private:
void setAllContainers();

public:
PixelContFact();
~PixelContFact() override = default;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -24,11 +24,7 @@ FairTestDetectorContFact::FairTestDetectorContFact()
: FairContFact("FairTestDetectorContFact", "Factory for parameter containers in libFairTestDetector")
{
/** Constructor (called when the library is loaded) */
setAllContainers();
}

void FairTestDetectorContFact::setAllContainers()
{
/** Creates the Container objects with all accepted
contexts and adds them to
the list of containers for the FairTestDetector library.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -16,9 +16,6 @@ class FairParSet;

class FairTestDetectorContFact : public FairContFact
{
private:
void setAllContainers();

public:
FairTestDetectorContFact();
~FairTestDetectorContFact() override = default;
Expand Down
6 changes: 1 addition & 5 deletions examples/advanced/propagator/src/FairTutPropContFact.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2019-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2019-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -21,11 +21,7 @@ FairTutPropContFact::FairTutPropContFact()
: FairContFact("FairTutPropContFact", "Factory for parameter containers in libFairTutProp")
{
/** Constructor (called when the library is loaded) */
setAllContainers();
}

void FairTutPropContFact::setAllContainers()
{
/** Creates the Container objects with all accepted
contexts and adds them to
the list of containers for the FairTutProp library.
Expand Down
5 changes: 1 addition & 4 deletions examples/advanced/propagator/src/FairTutPropContFact.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2019-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2019-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -15,9 +15,6 @@ class FairParSet;

class FairTutPropContFact : public FairContFact
{
private:
void setAllContainers();

public:
FairTutPropContFact();
~FairTutPropContFact() override = default;
Expand Down
6 changes: 1 addition & 5 deletions examples/common/passive/FairPassiveContFact.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand Down Expand Up @@ -33,11 +33,7 @@ FairPassiveContFact::FairPassiveContFact()
: FairContFact("FairPassiveContFact", "Factory for parameter containers in libPassive")
{
// Constructor (called when the library is loaded)
setAllContainers();
}

void FairPassiveContFact::setAllContainers()
{
/** Creates the Container objects with all accepted contexts and adds them to
* the list of containers for the STS library.*/

Expand Down
5 changes: 1 addition & 4 deletions examples/common/passive/FairPassiveContFact.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -16,9 +16,6 @@ class FairParSet;

class FairPassiveContFact : public FairContFact
{
private:
void setAllContainers();

public:
FairPassiveContFact();
~FairPassiveContFact() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -23,11 +23,7 @@ FairTutorialDet1ContFact::FairTutorialDet1ContFact()
: FairContFact("FairTutorialDet1ContFact", "Factory for parameter containers in libTutorial1")
{
/** Constructor (called when the library is loaded) */
setAllContainers();
}

void FairTutorialDet1ContFact::setAllContainers()
{
/** Creates the Container objects with all accepted
contexts and adds them to
the list of containers for the Tutorial1 library.
Expand Down
5 changes: 1 addition & 4 deletions examples/simulation/Tutorial1/src/FairTutorialDet1ContFact.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -16,9 +16,6 @@ class FairParSet;

class FairTutorialDet1ContFact : public FairContFact
{
private:
void setAllContainers();

public:
FairTutorialDet1ContFact();
~FairTutorialDet1ContFact() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -20,11 +20,7 @@ FairTutorialDet2ContFact::FairTutorialDet2ContFact()
: FairContFact("FairTutorialDet2ContFact", "Factory for parameter containers in libTutorial1")
{
/** Constructor (called when the library is loaded) */
setAllContainers();
}

void FairTutorialDet2ContFact::setAllContainers()
{
/** Creates the Container objects with all accepted
contexts and adds them to
the list of containers for the Tutorial1 library.
Expand Down
5 changes: 1 addition & 4 deletions examples/simulation/Tutorial2/src/FairTutorialDet2ContFact.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -16,9 +16,6 @@ class FairParSet;

class FairTutorialDet2ContFact : public FairContFact
{
private:
void setAllContainers();

public:
FairTutorialDet2ContFact();
~FairTutorialDet2ContFact() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -24,11 +24,7 @@ FairTutorialDet4ContFact::FairTutorialDet4ContFact()
: FairContFact("FairTutorialDet4ContFact", "Factory for parameter containers in libTutorial1")
{
/** Constructor (called when the library is loaded) */
setAllContainers();
}

void FairTutorialDet4ContFact::setAllContainers()
{
/** Creates the Container objects with all accepted
contexts and adds them to
the list of containers for the Tutorial1 library.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -16,9 +16,6 @@ class FairParSet;

class FairTutorialDet4ContFact : public FairContFact
{
private:
void setAllContainers();

public:
FairTutorialDet4ContFact();
~FairTutorialDet4ContFact() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -23,11 +23,7 @@ FairRutherfordContFact::FairRutherfordContFact()
: FairContFact("FairRutherfordContFact", "Factory for parameter containers in libFairRutherford")
{
/** Constructor (called when the library is loaded) */
setAllContainers();
}

void FairRutherfordContFact::setAllContainers()
{
/** Creates the Container objects with all accepted
contexts and adds them to
the list of containers for the FairRutherford library.
Expand Down
5 changes: 1 addition & 4 deletions examples/simulation/rutherford/src/FairRutherfordContFact.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -16,9 +16,6 @@ class FairParSet;

class FairRutherfordContFact : public FairContFact
{
private:
void setAllContainers();

public:
FairRutherfordContFact();
~FairRutherfordContFact() override {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -19,11 +19,7 @@ NewDetectorContFact::NewDetectorContFact()
: FairContFact("NewDetectorContFact", "Factory for parameter containers in libNewDetector")
{
/** Constructor (called when the library is loaded) */
setAllContainers();
}

void NewDetectorContFact::setAllContainers()
{
/** Creates the Container objects with all accepted
contexts and adds them to
the list of containers for the NewDetector library.
Expand Down
5 changes: 1 addition & 4 deletions templates/NewDetector_root_containers/NewDetectorContFact.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -14,9 +14,6 @@ class FairContainer;

class NewDetectorContFact : public FairContFact
{
private:
void setAllContainers();

public:
NewDetectorContFact();
~NewDetectorContFact() {}
Expand Down
Loading

0 comments on commit 65b6434

Please sign in to comment.