Skip to content

Commit

Permalink
*ContFact: Use AddContainer
Browse files Browse the repository at this point in the history
Instead of modifying `containers` directly, use
AddContainer().
  • Loading branch information
ChristianTackeGSI authored and karabowi committed Jan 26, 2023
1 parent 1f3511b commit 87e07ed
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 48 deletions.
8 changes: 4 additions & 4 deletions base/sim/FairBaseContFact.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ FairBaseContFact::FairBaseContFact()

/** 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");
containers->Add(pTest);
auto pTest = new FairContainer("FairBaseParSet", "class for parameter io", "DefaultContext");
AddContainer(pTest);

FairContainer* pGeo = new FairContainer("FairGeoParSet", "class for Geo parameter", "DefaultContext");
containers->Add(pGeo);
auto pGeo = new FairContainer("FairGeoParSet", "class for Geo parameter", "DefaultContext");
AddContainer(pGeo);
}

FairParSet* FairBaseContFact::createContainer(FairContainer* c)
Expand Down
5 changes: 2 additions & 3 deletions examples/MQ/parameters/FairMQExParamsContFact.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ static FairMQExParamsContFact gFairMQExParamsContFact;
FairMQExParamsContFact::FairMQExParamsContFact()
: FairContFact("FairMQExParamsContFact", "Factory for parameter containers in FairMQ Example 7")
{
FairContainer* container =
new FairContainer("FairMQExParamsParOne", "FairMQExParamsParOne Parameters", "TestDefaultContext");
containers->Add(container);
auto container = new FairContainer("FairMQExParamsParOne", "FairMQExParamsParOne Parameters", "TestDefaultContext");
AddContainer(container);
}

FairParSet* FairMQExParamsContFact::createContainer(FairContainer* container)
Expand Down
8 changes: 4 additions & 4 deletions examples/MQ/pixelDetector/src/PixelContFact.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ PixelContFact::PixelContFact()
the list of containers for the Pixel library.
*/

FairContainer* p = new FairContainer("PixelGeoPar", "Pixel Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("PixelGeoPar", "Pixel Geometry Parameters", "TestDefaultContext");
AddContainer(p);

FairContainer* p2 = new FairContainer("PixelDigiParameters", "Pixel digi parameters", "TestDefaultContext");
containers->Add(p2);
auto p2 = new FairContainer("PixelDigiParameters", "Pixel digi parameters", "TestDefaultContext");
AddContainer(p2);
}

FairParSet* PixelContFact::createContainer(FairContainer* c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ FairTestDetectorContFact::FairTestDetectorContFact()
the list of containers for the FairTestDetector library.
*/

FairContainer* p =
new FairContainer("FairTestDetectorGeoPar", "FairTestDetector Geometry Parameters", "TestDefaultContext");
auto p = new FairContainer("FairTestDetectorGeoPar", "FairTestDetector Geometry Parameters", "TestDefaultContext");
AddContainer(p);

FairContainer* p1 = new FairContainer("FairConstPar", "Constant Field Parameters", "TestDefaultContext");

containers->Add(p);
containers->Add(p1);
auto p1 = new FairContainer("FairConstPar", "Constant Field Parameters", "TestDefaultContext");
AddContainer(p1);
}

FairParSet* FairTestDetectorContFact::createContainer(FairContainer* c)
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/propagator/src/FairTutPropContFact.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ FairTutPropContFact::FairTutPropContFact()
the list of containers for the FairTutProp library.
*/

FairContainer* p = new FairContainer("FairTutPropGeoPar", "FairTutProp Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("FairTutPropGeoPar", "FairTutProp Geometry Parameters", "TestDefaultContext");
AddContainer(p);
}

FairParSet* FairTutPropContFact::createContainer(FairContainer* c)
Expand Down
4 changes: 2 additions & 2 deletions examples/common/passive/FairPassiveContFact.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ FairPassiveContFact::FairPassiveContFact()
/** Creates the Container objects with all accepted contexts and adds them to
* the list of containers for the STS library.*/

FairContainer* p = new FairContainer("FairGeoPassivePar", "Passive Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("FairGeoPassivePar", "Passive Geometry Parameters", "TestDefaultContext");
AddContainer(p);
}

FairParSet* FairPassiveContFact::createContainer(FairContainer* c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ FairTutorialDet1ContFact::FairTutorialDet1ContFact()
the list of containers for the Tutorial1 library.
*/

FairContainer* p =
new FairContainer("FairTutorialDet1GeoPar", "FairTutorialDet1 Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("FairTutorialDet1GeoPar", "FairTutorialDet1 Geometry Parameters", "TestDefaultContext");
AddContainer(p);
}

FairParSet* FairTutorialDet1ContFact::createContainer(FairContainer* c)
Expand Down
10 changes: 4 additions & 6 deletions examples/simulation/Tutorial2/src/FairTutorialDet2ContFact.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ FairTutorialDet2ContFact::FairTutorialDet2ContFact()
the list of containers for the Tutorial1 library.
*/

FairContainer* p1 =
new FairContainer("FairTutorialDet2GeoPar", "FairTutorialDet2 Geometry Parameters", "TestDefaultContext");
containers->Add(p1);
auto p1 = new FairContainer("FairTutorialDet2GeoPar", "FairTutorialDet2 Geometry Parameters", "TestDefaultContext");
AddContainer(p1);

FairContainer* p2 =
new FairContainer("FairTutorialDet2DigiPar", "Tutorial Det Digi Parameters", "TestDefaultContext");
containers->Add(p2);
auto p2 = new FairContainer("FairTutorialDet2DigiPar", "Tutorial Det Digi Parameters", "TestDefaultContext");
AddContainer(p2);
}

FairParSet* FairTutorialDet2ContFact::createContainer(FairContainer* c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ FairTutorialDet4ContFact::FairTutorialDet4ContFact()
the list of containers for the Tutorial1 library.
*/

FairContainer* p =
new FairContainer("FairTutorialDet4GeoPar", "FairTutorialDet4 Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("FairTutorialDet4GeoPar", "FairTutorialDet4 Geometry Parameters", "TestDefaultContext");
AddContainer(p);

FairContainer* p1 = new FairContainer(
auto p1 = new FairContainer(
"FairTutorialDet4MissallignPar", "FairTutorialDet4 Missallignment Parameters", "TestDefaultContext");
containers->Add(p1);
AddContainer(p1);
}

FairParSet* FairTutorialDet4ContFact::createContainer(FairContainer* c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FairRutherfordContFact::FairRutherfordContFact()
*/

auto p = new FairContainer("FairRutherfordGeoPar", "FairRutherford Geometry Parameters", "TestDefaultContext");
containers->Add(p);
AddContainer(p);
}

FairParSet* FairRutherfordContFact::createContainer(FairContainer* c)
Expand Down
4 changes: 2 additions & 2 deletions templates/NewDetector_root_containers/NewDetectorContFact.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ NewDetectorContFact::NewDetectorContFact()
the list of containers for the NewDetector library.
*/

FairContainer* p = new FairContainer("NewDetectorGeoPar", "NewDetector Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("NewDetectorGeoPar", "NewDetector Geometry Parameters", "TestDefaultContext");
AddContainer(p);
}

FairParSet* NewDetectorContFact::createContainer(FairContainer* c)
Expand Down
4 changes: 2 additions & 2 deletions templates/NewDetector_stl_containers/NewDetectorContFact.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ NewDetectorContFact::NewDetectorContFact()
the list of containers for the NewDetector library.
*/

FairContainer* p = new FairContainer("NewDetectorGeoPar", "NewDetector Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("NewDetectorGeoPar", "NewDetector Geometry Parameters", "TestDefaultContext");
AddContainer(p);
}

FairParSet* NewDetectorContFact::createContainer(FairContainer* c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ NewDetectorContFact::NewDetectorContFact()
the list of containers for the NewDetector library.
*/

FairContainer* p = new FairContainer("NewDetectorGeoPar", "NewDetector Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("NewDetectorGeoPar", "NewDetector Geometry Parameters", "TestDefaultContext");
AddContainer(p);
}

FairParSet* NewDetectorContFact::createContainer(FairContainer* c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ MyPassiveContFact::MyPassiveContFact()
/** Creates the Container objects with all accepted contexts and adds them to
* the list of containers for the STS library.*/

FairContainer* p = new FairContainer("FairGeoPassivePar", "Passive Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("FairGeoPassivePar", "Passive Geometry Parameters", "TestDefaultContext");
AddContainer(p);
}

FairParSet* MyPassiveContFact::createContainer(FairContainer* c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ NewDetectorContFact::NewDetectorContFact()
the list of containers for the NewDetector library.
*/

FairContainer* p = new FairContainer("NewDetectorGeoPar", "NewDetector Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("NewDetectorGeoPar", "NewDetector Geometry Parameters", "TestDefaultContext");
AddContainer(p);
}

FairParSet* NewDetectorContFact::createContainer(FairContainer* c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ MyPassiveContFact::MyPassiveContFact()
/** Creates the Container objects with all accepted contexts and adds them to
* the list of containers for the STS library.*/

FairContainer* p = new FairContainer("FairGeoPassivePar", "Passive Geometry Parameters", "TestDefaultContext");
containers->Add(p);
auto p = new FairContainer("FairGeoPassivePar", "Passive Geometry Parameters", "TestDefaultContext");
AddContainer(p);
}

FairParSet* MyPassiveContFact::createContainer(FairContainer* c)
Expand Down

0 comments on commit 87e07ed

Please sign in to comment.