From 351759e40a3a48be04874531d8a78a4f7f17d170 Mon Sep 17 00:00:00 2001 From: Andre Sailer <andre.philippe.sailer@cern.ch> Date: Tue, 31 Mar 2015 09:49:15 +0000 Subject: [PATCH] DDSegmentation: Fixes for warnings in doxygen some missing characters missmatch in function signatures due to using std::string --- .../include/DDSegmentation/BitField64.h | 5 ++-- DDSegmentation/src/CartesianGrid.cpp | 4 +--- DDSegmentation/src/CartesianGridXY.cpp | 4 +--- DDSegmentation/src/CartesianGridXYZ.cpp | 4 +--- DDSegmentation/src/CartesianGridXZ.cpp | 3 +-- DDSegmentation/src/CartesianGridYZ.cpp | 4 +--- .../src/CylindricalSegmentation.cpp | 4 +--- DDSegmentation/src/PolarGrid.cpp | 4 +--- DDSegmentation/src/PolarGridRPhi.cpp | 4 +--- DDSegmentation/src/ProjectiveCylinder.cpp | 3 +-- DDSegmentation/src/Segmentation.cpp | 23 +++++++++---------- DDSegmentation/src/SegmentationFactory.cpp | 15 ++++++------ DDSegmentation/src/TiledLayerSegmentation.cpp | 5 ++-- 13 files changed, 32 insertions(+), 50 deletions(-) diff --git a/DDSegmentation/include/DDSegmentation/BitField64.h b/DDSegmentation/include/DDSegmentation/BitField64.h index 7c8ade2ed..9cdaf24ee 100644 --- a/DDSegmentation/include/DDSegmentation/BitField64.h +++ b/DDSegmentation/include/DDSegmentation/BitField64.h @@ -33,7 +33,7 @@ namespace DDSegmentation { * ... <br> * int theta = b["theta"] ; <br> * ... <br> - * unsigned phiIndex = b.index("phi) ; <br> + * unsigned phiIndex = b.index("phi") ; <br> * int phi = b[ phiIndex ] ; <br> * * @author F.Gaede, DESY @@ -52,7 +52,7 @@ namespace DDSegmentation { virtual ~BitField64(); // clean up /** The c'tor takes an initialization string of the form:<br> - * <fieldDesc>[,<fieldDesc>...]<br> + * \<fieldDesc\>[,\<fieldDesc\>...]<br> * fieldDesc = name:[start]:[-]length<br> * where:<br> * name: The name of the field<br> @@ -229,6 +229,7 @@ namespace DDSegmentation { /** The default c'tor. * @param bitfield reference to the 64bit bitfield + * @param name name of the field * @param offset offset of field * @param signedWidth width of field, negative if field is signed */ diff --git a/DDSegmentation/src/CartesianGrid.cpp b/DDSegmentation/src/CartesianGrid.cpp index 6e9d97947..bc81ba2eb 100644 --- a/DDSegmentation/src/CartesianGrid.cpp +++ b/DDSegmentation/src/CartesianGrid.cpp @@ -10,10 +10,8 @@ namespace DD4hep { namespace DDSegmentation { -using std::string; - /// Default constructor used by derived classes passing the encoding string -CartesianGrid::CartesianGrid(const string& cellEncoding) : +CartesianGrid::CartesianGrid(const std::string& cellEncoding) : Segmentation(cellEncoding) { } diff --git a/DDSegmentation/src/CartesianGridXY.cpp b/DDSegmentation/src/CartesianGridXY.cpp index 4c9e8867c..20f17e4fb 100644 --- a/DDSegmentation/src/CartesianGridXY.cpp +++ b/DDSegmentation/src/CartesianGridXY.cpp @@ -10,10 +10,8 @@ namespace DD4hep { namespace DDSegmentation { -using std::string; - /// default constructor using an encoding string -CartesianGridXY::CartesianGridXY(const string& cellEncoding) : +CartesianGridXY::CartesianGridXY(const std::string& cellEncoding) : CartesianGrid(cellEncoding) { // define type and description _type = "CartesianGridXY"; diff --git a/DDSegmentation/src/CartesianGridXYZ.cpp b/DDSegmentation/src/CartesianGridXYZ.cpp index 5d4b62e54..20d1f7834 100644 --- a/DDSegmentation/src/CartesianGridXYZ.cpp +++ b/DDSegmentation/src/CartesianGridXYZ.cpp @@ -10,10 +10,8 @@ namespace DD4hep { namespace DDSegmentation { -using std::string; - /// default constructor using an encoding string -CartesianGridXYZ::CartesianGridXYZ(const string& cellEncoding) : +CartesianGridXYZ::CartesianGridXYZ(const std::string& cellEncoding) : CartesianGridXY(cellEncoding) { // define type and description _type = "CartesianGridXYZ"; diff --git a/DDSegmentation/src/CartesianGridXZ.cpp b/DDSegmentation/src/CartesianGridXZ.cpp index 5a4043ad3..e21e3118f 100644 --- a/DDSegmentation/src/CartesianGridXZ.cpp +++ b/DDSegmentation/src/CartesianGridXZ.cpp @@ -11,11 +11,10 @@ namespace DD4hep { namespace DDSegmentation { using std::make_pair; -using std::string; using std::vector; /// default constructor using an encoding string -CartesianGridXZ::CartesianGridXZ(const string& cellEncoding) : +CartesianGridXZ::CartesianGridXZ(const std::string& cellEncoding) : CartesianGrid(cellEncoding) { // define type and description _type = "CartesianGridXZ"; diff --git a/DDSegmentation/src/CartesianGridYZ.cpp b/DDSegmentation/src/CartesianGridYZ.cpp index 42515bd3e..44b104824 100644 --- a/DDSegmentation/src/CartesianGridYZ.cpp +++ b/DDSegmentation/src/CartesianGridYZ.cpp @@ -11,10 +11,8 @@ namespace DD4hep { namespace DDSegmentation { -using std::string; - /// default constructor using an encoding string -CartesianGridYZ::CartesianGridYZ(const string& cellEncoding) : +CartesianGridYZ::CartesianGridYZ(const std::string& cellEncoding) : CartesianGrid(cellEncoding) { // define type and description _type = "CartesianGridYZ"; diff --git a/DDSegmentation/src/CylindricalSegmentation.cpp b/DDSegmentation/src/CylindricalSegmentation.cpp index f14443cc6..ffe5da2e6 100644 --- a/DDSegmentation/src/CylindricalSegmentation.cpp +++ b/DDSegmentation/src/CylindricalSegmentation.cpp @@ -7,13 +7,11 @@ #include "DDSegmentation/CylindricalSegmentation.h" -using std::string; - namespace DD4hep { namespace DDSegmentation { /// default constructor using an encoding string -CylindricalSegmentation::CylindricalSegmentation(const string& cellEncoding) : +CylindricalSegmentation::CylindricalSegmentation(const std::string& cellEncoding) : Segmentation(cellEncoding) { } diff --git a/DDSegmentation/src/PolarGrid.cpp b/DDSegmentation/src/PolarGrid.cpp index 286e94e4e..32a2bc92a 100644 --- a/DDSegmentation/src/PolarGrid.cpp +++ b/DDSegmentation/src/PolarGrid.cpp @@ -10,10 +10,8 @@ namespace DD4hep { namespace DDSegmentation { -using std::string; - /// Default constructor used by derived classes passing the encoding string -PolarGrid::PolarGrid(const string& cellEncoding) : +PolarGrid::PolarGrid(const std::string& cellEncoding) : Segmentation(cellEncoding) { } diff --git a/DDSegmentation/src/PolarGridRPhi.cpp b/DDSegmentation/src/PolarGridRPhi.cpp index dbf0bcf9c..250a62f52 100644 --- a/DDSegmentation/src/PolarGridRPhi.cpp +++ b/DDSegmentation/src/PolarGridRPhi.cpp @@ -10,10 +10,8 @@ namespace DD4hep { namespace DDSegmentation { -using std::string; - /// default constructor using an encoding string -PolarGridRPhi::PolarGridRPhi(const string& cellEncoding) : +PolarGridRPhi::PolarGridRPhi(const std::string& cellEncoding) : PolarGrid(cellEncoding) { // define type and description _type = "PolarGridRPhi"; diff --git a/DDSegmentation/src/ProjectiveCylinder.cpp b/DDSegmentation/src/ProjectiveCylinder.cpp index 84fcfd2e4..47883b91c 100644 --- a/DDSegmentation/src/ProjectiveCylinder.cpp +++ b/DDSegmentation/src/ProjectiveCylinder.cpp @@ -14,12 +14,11 @@ namespace DD4hep { namespace DDSegmentation { -using std::string; using Util::thetaFromXYZ; using Util::phiFromXYZ; /// default constructor using an encoding string -ProjectiveCylinder::ProjectiveCylinder(const string& cellEncoding) : +ProjectiveCylinder::ProjectiveCylinder(const std::string& cellEncoding) : CylindricalSegmentation(cellEncoding) { // define type and description _type = "ProjectiveCylinder"; diff --git a/DDSegmentation/src/Segmentation.cpp b/DDSegmentation/src/Segmentation.cpp index 6f3dbf6f5..c38abe05a 100644 --- a/DDSegmentation/src/Segmentation.cpp +++ b/DDSegmentation/src/Segmentation.cpp @@ -21,12 +21,11 @@ using std::cerr; using std::endl; using std::map; using std::runtime_error; -using std::string; using std::stringstream; using std::vector; /// Default constructor used by derived classes passing the encoding string -Segmentation::Segmentation(const string& cellEncoding) : +Segmentation::Segmentation(const std::string& cellEncoding) : _name("Segmentation"), _type("Segmentation"), _decoder(new BitField64(cellEncoding)), _ownsDecoder(true) { } @@ -40,7 +39,7 @@ Segmentation::~Segmentation() { if (_ownsDecoder and _decoder != 0) { delete _decoder; } - map<string, SegmentationParameter*>::iterator it; + map<std::string, SegmentationParameter*>::iterator it; for (it = _parameters.begin(); it != _parameters.end(); ++it) { SegmentationParameter* p = it->second; if (p) { @@ -52,10 +51,10 @@ Segmentation::~Segmentation() { /// Determine the volume ID from the full cell ID by removing all local fields VolumeID Segmentation::volumeID(const CellID& cID) const { - map<string, StringParameter>::const_iterator it; + map<std::string, StringParameter>::const_iterator it; _decoder->setValue(cID); for (it = _indexIdentifiers.begin(); it != _indexIdentifiers.end(); ++it) { - string identifier = it->second->typedValue(); + std::string identifier = it->second->typedValue(); (*_decoder)[identifier] = 0; } return _decoder->getValue(); @@ -63,9 +62,9 @@ VolumeID Segmentation::volumeID(const CellID& cID) const { /// Calculates the neighbours of the given cell ID and adds them to the list of neighbours void Segmentation::neighbours(const CellID& cID, std::set<CellID>& cellNeighbours) const { - map<string, StringParameter>::const_iterator it; + map<std::string, StringParameter>::const_iterator it; for (it = _indexIdentifiers.begin(); it != _indexIdentifiers.end(); ++it) { - string identifier = it->second->typedValue(); + const std::string& identifier = it->second->typedValue(); _decoder->setValue(cID); int currentValue = (*_decoder)[identifier]; // add both neighbouring cell IDs, don't add out of bound indices @@ -96,7 +95,7 @@ void Segmentation::setDecoder(BitField64* newDecoder) { /// Access to parameter by name Parameter Segmentation::parameter(const std::string& parameterName) const { - map<string, Parameter>::const_iterator it; + map<std::string, Parameter>::const_iterator it; it = _parameters.find(parameterName); if (it != _parameters.end()) { return it->second; @@ -109,7 +108,7 @@ Parameter Segmentation::parameter(const std::string& parameterName) const { /// Access to all parameters Parameters Segmentation::parameters() const { Parameters pars; - map<string, Parameter>::const_iterator it; + map<std::string, Parameter>::const_iterator it; for (it = _parameters.begin(); it != _parameters.end(); ++it) { pars.push_back(it->second); } @@ -126,10 +125,10 @@ void Segmentation::setParameters(const Parameters& pars) { } /// Add a cell identifier to this segmentation. Used by derived classes to define their required identifiers -void Segmentation::registerIdentifier(const string& idName, const string& idDescription, string& identifier, - const string& defaultValue) { +void Segmentation::registerIdentifier(const std::string& idName, const std::string& idDescription, std::string& identifier, + const std::string& defaultValue) { StringParameter idParameter = - new TypedSegmentationParameter<string>(idName, idDescription, identifier, defaultValue, + new TypedSegmentationParameter<std::string>(idName, idDescription, identifier, defaultValue, SegmentationParameter::NoUnit, true); _parameters[idName] = idParameter; _indexIdentifiers[idName] = idParameter; diff --git a/DDSegmentation/src/SegmentationFactory.cpp b/DDSegmentation/src/SegmentationFactory.cpp index 8ce2cb994..92091997f 100644 --- a/DDSegmentation/src/SegmentationFactory.cpp +++ b/DDSegmentation/src/SegmentationFactory.cpp @@ -12,10 +12,9 @@ namespace DDSegmentation { using std::map; using std::vector; -using std::string; /// Default constructor. Takes the class name as argument and takes care of registration with the factory -SegmentationCreatorBase::SegmentationCreatorBase(const string& name) { +SegmentationCreatorBase::SegmentationCreatorBase(const std::string& name) { SegmentationFactory::instance()->registerSegmentation(name, this); } @@ -31,8 +30,8 @@ SegmentationFactory* SegmentationFactory::instance() { } /// Create a new segmentation object with the given type name. Returns NULL if type name is unknown. -Segmentation* SegmentationFactory::create(const string& name, const string& identifier) const { - map<string, SegmentationCreatorBase*>::const_iterator it; +Segmentation* SegmentationFactory::create(const std::string& name, const std::string& identifier) const { + map<std::string, SegmentationCreatorBase*>::const_iterator it; it = _segmentations.find(name); if (it != _segmentations.end()) { return it->second->create(identifier); @@ -41,9 +40,9 @@ Segmentation* SegmentationFactory::create(const string& name, const string& iden } /// Access to the list of registered segmentations -vector<string> SegmentationFactory::registeredSegmentations() const { - vector<string> segmentationNames; - map<string, SegmentationCreatorBase*>::const_iterator it; +vector<std::string> SegmentationFactory::registeredSegmentations() const { + vector<std::string> segmentationNames; + map<std::string, SegmentationCreatorBase*>::const_iterator it; for (it = _segmentations.begin(); it != _segmentations.end(); ++ it) { segmentationNames.push_back(it->first); } @@ -51,7 +50,7 @@ vector<string> SegmentationFactory::registeredSegmentations() const { } /// Registers a new SegmentationCreator with the factory -void SegmentationFactory::registerSegmentation(const string& name, SegmentationCreatorBase* creator) { +void SegmentationFactory::registerSegmentation(const std::string& name, SegmentationCreatorBase* creator) { _segmentations[name] = creator; } diff --git a/DDSegmentation/src/TiledLayerSegmentation.cpp b/DDSegmentation/src/TiledLayerSegmentation.cpp index 9b6a82911..ab0c6c544 100644 --- a/DDSegmentation/src/TiledLayerSegmentation.cpp +++ b/DDSegmentation/src/TiledLayerSegmentation.cpp @@ -17,11 +17,10 @@ namespace DDSegmentation { using std::find; using std::runtime_error; -using std::string; using std::stringstream; using std::vector; -TiledLayerSegmentation::TiledLayerSegmentation(const string& cellEncoding) : +TiledLayerSegmentation::TiledLayerSegmentation(const std::string& cellEncoding) : Segmentation(cellEncoding) { _type = "TiledLayerSegmentation"; _description = "Cartesian segmentation using optimal tiling depending on the layer dimensions"; @@ -31,7 +30,7 @@ TiledLayerSegmentation::TiledLayerSegmentation(const string& cellEncoding) : registerParameter("grid_size_y", "Default cell size in Y", _gridSizeY, 1., SegmentationParameter::LengthUnit); registerIdentifier("identifier_x", "Cell encoding identifier for X", _identifierX, "x"); registerIdentifier("identifier_y", "Cell encoding identifier for Y", _identifierY, "y"); - registerParameter("identifier_layer", "Cell encoding identifier for layer", _identifierLayer, string("layer"), + registerParameter("identifier_layer", "Cell encoding identifier for layer", _identifierLayer, std::string("layer"), SegmentationParameter::NoUnit, true); registerParameter("layer_identifiers", "List of valid layer identifiers", _layerIndices, vector<int>(), SegmentationParameter::NoUnit, true); -- GitLab