Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove using namespace from header files #35

Merged
merged 2 commits into from
Mar 23, 2018
Merged

Conversation

petricm
Copy link
Contributor

@petricm petricm commented Jul 4, 2017

BEGINRELEASENOTES

  • Remove using namespace from header files

ENDRELEASENOTES

@andresailer
Copy link
Contributor

Which package does this not break?

@petricm
Copy link
Contributor Author

petricm commented Jul 4, 2017

Probably all, but we should at one point resolve this.

@gaede
Copy link
Contributor

gaede commented Jul 4, 2017

Yes, should at one point resolve this - but now is the worst time, as we are in the middle of preparing an iLCSoft release.

@petricm
Copy link
Contributor Author

petricm commented Jul 4, 2017

That's the beauty of a PR, you can merge it at the time you see fit.

@gaede gaede changed the title Remove using namespace from header files DONT MERGE NOW: Remove using namespace from header files Jul 4, 2017
@gaede
Copy link
Contributor

gaede commented Jan 11, 2018

@andresailer @petricm should we merge this now ?
We are trying to get rif of all warnings in ilcsoft and need to touch many packages anyways ...

@andresailer
Copy link
Contributor

One should apply these changes locally and fix the other packages before merging this. Otherwise too many things will be broken.

@petricm
Copy link
Contributor Author

petricm commented Mar 12, 2018

I have compiled everything with this change and made appropriate PRs if everything merged this PR should work. The only thing I was not able to fix is Garlic since it's in DESY SVN and I don't have access.

@gaede can you please apply the following patch to Garlic

Index: include/GarlicClusterVarsGenericObject.hh
===================================================================
--- include/GarlicClusterVarsGenericObject.hh	(revision 111)
+++ include/GarlicClusterVarsGenericObject.hh	(working copy)
@@ -11,7 +11,7 @@
 
 public:
   GarlicClusterVarsGenericObject() {
-    _genObj = new LCGenericObjectImpl(NINT, NFLOAT, 0);
+    _genObj = new lcio::LCGenericObjectImpl(NINT, NFLOAT, 0);
     for (int i=0; i<NINT; i++) _genObj->setIntVal(i, -999);
     for (int i=0; i<NFLOAT; i++) _genObj->setFloatVal(i, -999);
   }
@@ -20,7 +20,7 @@
     assert(obj->getNInt()==NINT);
     assert(obj->getNFloat()==NFLOAT);
     assert(obj->getNDouble()==0);
-    _genObj = new LCGenericObjectImpl(NINT, NFLOAT, 0);
+    _genObj = new lcio::LCGenericObjectImpl(NINT, NFLOAT, 0);
     for (int i=0; i<NINT; i++) _genObj->setIntVal( i, obj->getIntVal(i) );
     for (int i=0; i<NFLOAT; i++) _genObj->setFloatVal( i, obj->getFloatVal(i) );
   }
Index: include/GarlicAlgorithmParameters.hh
===================================================================
--- include/GarlicAlgorithmParameters.hh	(revision 111)
+++ include/GarlicAlgorithmParameters.hh	(working copy)
@@ -7,6 +7,7 @@
 
 #include "GarlicClusterSelector.hh"
 
+using namespace std;
 
 using std::vector;
 
Index: include/GarlicGeometryParameters.hh
===================================================================
--- include/GarlicGeometryParameters.hh	(revision 111)
+++ include/GarlicGeometryParameters.hh	(working copy)
@@ -55,7 +55,7 @@
   }
 
   void Set_barrelStaveDir (std::vector< std::vector < float > > gg) {_barrelStaveDir=gg;}
-  void Set_defaultDecoder (CellIDDecoder<CalorimeterHit>* dec) {_defaultDecoder=dec;}
+  void Set_defaultDecoder (lcio::CellIDDecoder<lcio::CalorimeterHit>* dec) {_defaultDecoder=dec;}
 
   void Set_absorberRadiationLength (float x0) {_absorberRadiationLength=x0;}
 
@@ -94,7 +94,7 @@
   float * Get_positionEndcapLayer () {return _positionEndcapLayer;}
 
   std::vector< std::vector < float > > Get_barrelStaveDir () {return _barrelStaveDir;}
-  CellIDDecoder<CalorimeterHit>* Get_defaultDecoder () {return _defaultDecoder;}
+  lcio::CellIDDecoder<lcio::CalorimeterHit>* Get_defaultDecoder () {return _defaultDecoder;}
 
 private:
 
@@ -136,7 +136,7 @@
 
   std::vector< std::vector < float > > _barrelStaveDir;
 
-  CellIDDecoder<CalorimeterHit>* _defaultDecoder;
+  lcio::CellIDDecoder<lcio::CalorimeterHit>* _defaultDecoder;
 
   void init() {
     _rOfBarrel=-999;
Index: src/GarlicExtendedCluster.cc
===================================================================
--- src/GarlicExtendedCluster.cc	(revision 111)
+++ src/GarlicExtendedCluster.cc	(working copy)
@@ -32,6 +32,8 @@
 using std::cout;
 using std::endl;
 
+using namespace lcio;
+
 int GarlicExtendedCluster::counter=0;
 
 
Index: src/GarlicClusterAlgos.cc
===================================================================
--- src/GarlicClusterAlgos.cc	(revision 111)
+++ src/GarlicClusterAlgos.cc	(working copy)
@@ -25,6 +25,8 @@
 #include "GarlicExtendedCluster.hh"
 #include "GarlicExtendedHit.hh"
 
+using namespace lcio;
+
 std::map <CalorimeterHit*, bool> GarlicClusterAlgos::getSeeds(GarlicExtendedCluster* preClus) {
 
   float energyCutMip = GarlicAlgorithmParameters::Instance().GetSeedHitEnergyCut();

@gaede
Copy link
Contributor

gaede commented Mar 13, 2018

I could of course do this - but this might be a good chance to move Garlic also to the iLCSoft Github.
@danieljeans would you agree to move Garlic to the iLCSoft Github - or any other Github repository ?

@petricm
Copy link
Contributor Author

petricm commented Mar 13, 2018

I am always happy to move stuff to git, I took the liberty and made a copy https://github.com/iLCSoft/Garlic

@rete
Copy link
Contributor

rete commented Mar 22, 2018

All packages have been updated to cope with this PR.
@gaede Should we merge this ?

@gaede gaede changed the title DONT MERGE NOW: Remove using namespace from header files Remove using namespace from header files Mar 23, 2018
@gaede gaede merged commit 333bc17 into iLCSoft:master Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants