Skip to content
Snippets Groups Projects
Commit a7979e68 authored by Johannes Junggeburth's avatar Johannes Junggeburth :dog2:
Browse files

Minor constructor clean up

parent 00a850fa
No related branches found
No related tags found
1 merge request!447Revert "Revert "Minor clean of the constructors""
Pipeline #12064719 passed
Showing
with 42 additions and 82 deletions
...@@ -24,7 +24,7 @@ class GeoAccessSurfaceAction final : public GeoNodeAction ...@@ -24,7 +24,7 @@ class GeoAccessSurfaceAction final : public GeoNodeAction
{ {
public: public:
GeoAccessSurfaceAction (unsigned int Index, const GeoVAlignmentStore* store); GeoAccessSurfaceAction (unsigned int Index, const GeoVAlignmentStore* store);
virtual ~GeoAccessSurfaceAction() override; virtual ~GeoAccessSurfaceAction() = default;
/// Handles a Transform. /// Handles a Transform.
virtual void handleTransform (const GeoTransform *xform) override; virtual void handleTransform (const GeoTransform *xform) override;
...@@ -48,10 +48,6 @@ class GeoAccessSurfaceAction final : public GeoNodeAction ...@@ -48,10 +48,6 @@ class GeoAccessSurfaceAction final : public GeoNodeAction
const GeoTrf::Transform3D & getDefTransform () const; const GeoTrf::Transform3D & getDefTransform () const;
private: private:
GeoAccessSurfaceAction(const GeoAccessSurfaceAction &right);
GeoAccessSurfaceAction & operator=(const GeoAccessSurfaceAction &right);
/// Returns a pointer to the ith virtual surface under this one. /// Returns a pointer to the ith virtual surface under this one.
VSConstLink m_surface{}; VSConstLink m_surface{};
......
...@@ -46,9 +46,6 @@ class GeoAccessVolAndSTAction final : public GeoNodeAction { ...@@ -46,9 +46,6 @@ class GeoAccessVolAndSTAction final : public GeoNodeAction {
std::optional<unsigned int> getId() const; std::optional<unsigned int> getId() const;
private: private:
GeoAccessVolAndSTAction(const GeoAccessVolAndSTAction &right);
const GeoAccessVolAndSTAction & operator=(const GeoAccessVolAndSTAction &right);
/// A pointer to the ith physical volume under this one. /// A pointer to the ith physical volume under this one.
PVConstLink m_volume{}; PVConstLink m_volume{};
......
...@@ -16,18 +16,15 @@ ...@@ -16,18 +16,15 @@
#include "GeoModelKernel/GeoNodeAction.h" #include "GeoModelKernel/GeoNodeAction.h"
class GeoClearAbsPosAction : public GeoNodeAction class GeoClearAbsPosAction : public GeoNodeAction {
{
public: public:
GeoClearAbsPosAction(); GeoClearAbsPosAction() = default;
virtual ~GeoClearAbsPosAction(); virtual ~GeoClearAbsPosAction() = default;
// Handles a physical volume. // Handles a physical volume.
virtual void handleFullPhysVol (const GeoFullPhysVol *vol); virtual void handleFullPhysVol (const GeoFullPhysVol *vol) override;
private: private:
GeoClearAbsPosAction(const GeoClearAbsPosAction &right);
GeoClearAbsPosAction & operator=(const GeoClearAbsPosAction &right);
}; };
......
...@@ -11,7 +11,7 @@ class GeoCountSurfaceAction final: public GeoNodeAction ...@@ -11,7 +11,7 @@ class GeoCountSurfaceAction final: public GeoNodeAction
{ {
public: public:
GeoCountSurfaceAction (); GeoCountSurfaceAction ();
virtual ~GeoCountSurfaceAction(); virtual ~GeoCountSurfaceAction() = default;
// Handles a virtual surface. // Handles a virtual surface.
virtual void handleVSurface (const GeoVSurface *) override; virtual void handleVSurface (const GeoVSurface *) override;
......
...@@ -11,7 +11,7 @@ class GeoCountVolAction : public GeoNodeAction ...@@ -11,7 +11,7 @@ class GeoCountVolAction : public GeoNodeAction
{ {
public: public:
GeoCountVolAction (); GeoCountVolAction ();
virtual ~GeoCountVolAction(); virtual ~GeoCountVolAction() = default;
// Handles a physical volume. // Handles a physical volume.
virtual void handlePhysVol (const GeoPhysVol *) override; virtual void handlePhysVol (const GeoPhysVol *) override;
...@@ -29,8 +29,6 @@ class GeoCountVolAction : public GeoNodeAction ...@@ -29,8 +29,6 @@ class GeoCountVolAction : public GeoNodeAction
unsigned int getCount () const; unsigned int getCount () const;
private: private:
GeoCountVolAction(const GeoCountVolAction &right);
GeoCountVolAction & operator=(const GeoCountVolAction &right);
unsigned int m_count{}; unsigned int m_count{};
}; };
......
...@@ -18,7 +18,7 @@ class GeoCountVolAndSTAction : public GeoNodeAction ...@@ -18,7 +18,7 @@ class GeoCountVolAndSTAction : public GeoNodeAction
{ {
public: public:
GeoCountVolAndSTAction(); GeoCountVolAndSTAction();
virtual ~GeoCountVolAndSTAction(); virtual ~GeoCountVolAndSTAction() = default;
virtual void handlePhysVol(const GeoPhysVol*); virtual void handlePhysVol(const GeoPhysVol*);
virtual void handleFullPhysVol(const GeoFullPhysVol*); virtual void handleFullPhysVol(const GeoFullPhysVol*);
...@@ -27,9 +27,6 @@ class GeoCountVolAndSTAction : public GeoNodeAction ...@@ -27,9 +27,6 @@ class GeoCountVolAndSTAction : public GeoNodeAction
unsigned int getCount() const; unsigned int getCount() const;
private: private:
GeoCountVolAndSTAction(const GeoCountVolAndSTAction &right);
const GeoCountVolAndSTAction & operator=(const GeoCountVolAndSTAction &right);
unsigned int m_count{}; unsigned int m_count{};
}; };
......
...@@ -138,8 +138,8 @@ class GeoShapeAction ...@@ -138,8 +138,8 @@ class GeoShapeAction
private: private:
GeoShapeAction(const GeoShapeAction &right); GeoShapeAction(const GeoShapeAction &right) = delete;
GeoShapeAction & operator=(const GeoShapeAction &right); GeoShapeAction & operator=(const GeoShapeAction &right) = delete;
// A limit may be placed upon the depth to which the action // A limit may be placed upon the depth to which the action
// descends. 0 = self. 1 = self and children. // descends. 0 = self. 1 = self and children.
...@@ -147,7 +147,7 @@ class GeoShapeAction ...@@ -147,7 +147,7 @@ class GeoShapeAction
// Termination flag; causes an abortion of action execution. // Termination flag; causes an abortion of action execution.
bool m_terminate{}; bool m_terminate{};
GeoShapePath m_path; GeoShapePath m_path{};
}; };
......
...@@ -61,7 +61,7 @@ class GeoSurfaceCursor final : public GeoNodeAction ...@@ -61,7 +61,7 @@ class GeoSurfaceCursor final : public GeoNodeAction
unsigned int m_volCount{}; unsigned int m_volCount{};
unsigned int m_surfCount{}; unsigned int m_surfCount{};
std::vector<const GeoTransform *> m_pendingTransformList; std::vector<const GeoTransform *> m_pendingTransformList{};
bool m_hasAlignTrans{}; bool m_hasAlignTrans{};
GeoVAlignmentStore *m_alignStore{}; GeoVAlignmentStore *m_alignStore{};
......
...@@ -22,8 +22,11 @@ class GeoVDetectorManager; ...@@ -22,8 +22,11 @@ class GeoVDetectorManager;
class GeoVDetectorFactory class GeoVDetectorFactory
{ {
public: public:
GeoVDetectorFactory(); GeoVDetectorFactory() = default;
virtual ~GeoVDetectorFactory(); virtual ~GeoVDetectorFactory() = default;
GeoVDetectorFactory(const GeoVDetectorFactory &right) = delete;
GeoVDetectorFactory & operator=(const GeoVDetectorFactory &right) = delete;
// Create the system. // Create the system.
virtual void create (GeoPhysVol* world) = 0; virtual void create (GeoPhysVol* world) = 0;
...@@ -33,8 +36,6 @@ class GeoVDetectorFactory ...@@ -33,8 +36,6 @@ class GeoVDetectorFactory
virtual const GeoVDetectorManager* getDetectorManager () const = 0; virtual const GeoVDetectorManager* getDetectorManager () const = 0;
private: private:
GeoVDetectorFactory(const GeoVDetectorFactory &right);
GeoVDetectorFactory & operator=(const GeoVDetectorFactory &right);
}; };
......
...@@ -31,6 +31,9 @@ class GeoVDetectorManager ...@@ -31,6 +31,9 @@ class GeoVDetectorManager
GeoVDetectorManager(); GeoVDetectorManager();
virtual ~GeoVDetectorManager(); virtual ~GeoVDetectorManager();
GeoVDetectorManager(const GeoVDetectorManager &right) = delete;
GeoVDetectorManager & operator=(const GeoVDetectorManager &right) = delete;
// Returns the number of Tree Tops (Top Level Physicsl // Returns the number of Tree Tops (Top Level Physicsl
// Volumes) // Volumes)
virtual unsigned int getNumTreeTops () const = 0; virtual unsigned int getNumTreeTops () const = 0;
...@@ -42,10 +45,8 @@ class GeoVDetectorManager ...@@ -42,10 +45,8 @@ class GeoVDetectorManager
void setName(const std::string & name); void setName(const std::string & name);
private: private:
GeoVDetectorManager(const GeoVDetectorManager &right);
GeoVDetectorManager & operator=(const GeoVDetectorManager &right);
std::string m_name; std::string m_name{};
}; };
......
...@@ -19,9 +19,9 @@ class GeoVG4ExtensionSolid ...@@ -19,9 +19,9 @@ class GeoVG4ExtensionSolid
public: public:
//! Default constructor. //! Default constructor.
GeoVG4ExtensionSolid() {} GeoVG4ExtensionSolid() = default;
virtual ~GeoVG4ExtensionSolid() {} virtual ~GeoVG4ExtensionSolid() = default;
//! Create the specified solid. . //! Create the specified solid. .
virtual G4VSolid *newG4Solid(const GeoUnidentifiedShape *shape) const=0; virtual G4VSolid *newG4Solid(const GeoUnidentifiedShape *shape) const=0;
......
...@@ -29,6 +29,9 @@ class GeoVGeometryPlugin ...@@ -29,6 +29,9 @@ class GeoVGeometryPlugin
GeoVGeometryPlugin(const std::string& name) : GeoVGeometryPlugin(const std::string& name) :
m_pluginName{name} { m_publisher->setName(m_pluginName); } m_pluginName{name} { m_publisher->setName(m_pluginName); }
/// We prohibit copy constructor, and assignment operator
GeoVGeometryPlugin(const GeoVGeometryPlugin &right)=delete;
GeoVGeometryPlugin & operator=(const GeoVGeometryPlugin &right)=delete;
virtual ~GeoVGeometryPlugin() = default; virtual ~GeoVGeometryPlugin() = default;
...@@ -48,14 +51,8 @@ class GeoVGeometryPlugin ...@@ -48,14 +51,8 @@ class GeoVGeometryPlugin
std::unique_ptr<GeoPublisher> m_publisher{std::make_unique<GeoPublisher>()}; std::unique_ptr<GeoPublisher> m_publisher{std::make_unique<GeoPublisher>()};
private: private:
/// We prohibit copy constructor, and assignment operator
GeoVGeometryPlugin(const GeoVGeometryPlugin &right)=delete;
GeoVGeometryPlugin & operator=(const GeoVGeometryPlugin &right)=delete;
//! The name of the plugin, used to store plugin's published nodes. //! The name of the plugin, used to store plugin's published nodes.
std::string m_pluginName; std::string m_pluginName{};
}; };
......
...@@ -26,7 +26,7 @@ class GeoVolumeAction ...@@ -26,7 +26,7 @@ class GeoVolumeAction
public: public:
GeoVolumeAction (Type type = TOP_DOWN); GeoVolumeAction (Type type = TOP_DOWN);
virtual ~GeoVolumeAction(); virtual ~GeoVolumeAction() = default;
// Callback method. Overriden by users. // Callback method. Overriden by users.
virtual void handleVPhysVol (const GeoVPhysVol *); virtual void handleVPhysVol (const GeoVPhysVol *);
...@@ -50,8 +50,6 @@ class GeoVolumeAction ...@@ -50,8 +50,6 @@ class GeoVolumeAction
GeoVolumeAction::Type getType () const; GeoVolumeAction::Type getType () const;
private: private:
GeoVolumeAction(const GeoVolumeAction &right);
GeoVolumeAction & operator=(const GeoVolumeAction &right);
// This type specifies that the action should be carried // This type specifies that the action should be carried
// out from the bottom up or from the top down. // out from the bottom up or from the top down.
...@@ -60,7 +58,7 @@ class GeoVolumeAction ...@@ -60,7 +58,7 @@ class GeoVolumeAction
// Termination flag; causes an abortion of action execution. // Termination flag; causes an abortion of action execution.
bool m_terminate{}; bool m_terminate{};
GeoTraversalState m_traversalState; GeoTraversalState m_traversalState{};
}; };
......
...@@ -19,10 +19,7 @@ class GeoVolumeCursor final : public GeoNodeAction ...@@ -19,10 +19,7 @@ class GeoVolumeCursor final : public GeoNodeAction
friend GeoVolumeCursorTest; friend GeoVolumeCursorTest;
using VSConstLink = GeoVSurface::VSConstLink; using VSConstLink = GeoVSurface::VSConstLink;
GeoVolumeCursor (PVConstLink parent, GeoVAlignmentStore* store=nullptr); GeoVolumeCursor (PVConstLink parent, GeoVAlignmentStore* store=nullptr);
virtual ~GeoVolumeCursor() override; virtual ~GeoVolumeCursor() = default;
GeoVolumeCursor(const GeoVolumeCursor &right) = delete;
GeoVolumeCursor & operator=(const GeoVolumeCursor &right) = delete;
/// Advance /// Advance
void next(); void next();
......
...@@ -4,21 +4,20 @@ ...@@ -4,21 +4,20 @@
#include <map> #include <map>
#include "GeoModelKernel/GeoVPhysVol.h" #include "GeoModelKernel/GeoVPhysVol.h"
#define volumeTags std::map<std::string, GeoVPhysVol* > #define volumeTags std::map<std::string, PVLink >
#define tagCatalog std::map<std::string, volumeTags > #define tagCatalog std::map<std::string, volumeTags >
class GeoVolumeTagCatalog { class GeoVolumeTagCatalog {
public: public:
void addTaggedVolume(std::string category, std::string tag, GeoVPhysVol* v) void addTaggedVolume(const std::string& category, const std::string& tag, PVLink v) {
{
theTags[category][tag]=v; theTags[category][tag]=v;
} }
GeoVPhysVol* getTaggedVolume(std::string category, std::string tag) GeoVPhysVol* getTaggedVolume(const std::string& category, const std::string& tag)
{ {
return theTags[category][tag]; return theTags[category][tag];
} }
GeoVolumeTagCatalog() {} GeoVolumeTagCatalog() = default;
static GeoVolumeTagCatalog* VolumeTagCatalog() { static GeoVolumeTagCatalog* VolumeTagCatalog() {
static GeoVolumeTagCatalog* theCatalog=new GeoVolumeTagCatalog; static GeoVolumeTagCatalog* theCatalog=new GeoVolumeTagCatalog;
return theCatalog; return theCatalog;
......
...@@ -16,8 +16,6 @@ GeoAccessSurfaceAction::GeoAccessSurfaceAction(unsigned int Index, const GeoVAli ...@@ -16,8 +16,6 @@ GeoAccessSurfaceAction::GeoAccessSurfaceAction(unsigned int Index, const GeoVAli
m_pendingTransformList.reserve(1); m_pendingTransformList.reserve(1);
} }
GeoAccessSurfaceAction::~GeoAccessSurfaceAction() = default;
void GeoAccessSurfaceAction::handleTransform (const GeoTransform *xform) void GeoAccessSurfaceAction::handleTransform (const GeoTransform *xform)
{ {
m_pendingTransformList.push_back (xform); m_pendingTransformList.push_back (xform);
......
...@@ -4,15 +4,7 @@ ...@@ -4,15 +4,7 @@
#include "GeoModelKernel/GeoClearAbsPosAction.h" #include "GeoModelKernel/GeoClearAbsPosAction.h"
GeoClearAbsPosAction::GeoClearAbsPosAction()
{
}
GeoClearAbsPosAction::~GeoClearAbsPosAction()
{
}
void GeoClearAbsPosAction::handleFullPhysVol (const GeoFullPhysVol *vol) void GeoClearAbsPosAction::handleFullPhysVol (const GeoFullPhysVol *vol) {
{ vol->clearPositionInfo();
vol->clearPositionInfo ();
} }
...@@ -9,8 +9,6 @@ GeoCountSurfaceAction::GeoCountSurfaceAction () ...@@ -9,8 +9,6 @@ GeoCountSurfaceAction::GeoCountSurfaceAction ()
setDepthLimit (1); setDepthLimit (1);
} }
GeoCountSurfaceAction::~GeoCountSurfaceAction() = default;
void GeoCountSurfaceAction::handleVSurface (const GeoVSurface *) void GeoCountSurfaceAction::handleVSurface (const GeoVSurface *)
{ {
// count the number of all virtual surfaces. // count the number of all virtual surfaces.
......
...@@ -8,15 +8,12 @@ GeoCountVolAction::GeoCountVolAction (){ ...@@ -8,15 +8,12 @@ GeoCountVolAction::GeoCountVolAction (){
setDepthLimit (1); setDepthLimit (1);
} }
GeoCountVolAction::~GeoCountVolAction(){
}
void GeoCountVolAction::handlePhysVol (const GeoPhysVol *){ void GeoCountVolAction::handlePhysVol (const GeoPhysVol *){
// //
// Do not count the top volume, this action counts only children! // Do not count the top volume, this action counts only children!
// //
if (getPath ()->getLength () > 1) if (getPath ()->getLength () > 1)
m_count++; ++m_count;
} }
void GeoCountVolAction::handleFullPhysVol (const GeoFullPhysVol *){ void GeoCountVolAction::handleFullPhysVol (const GeoFullPhysVol *){
...@@ -24,12 +21,12 @@ void GeoCountVolAction::handleFullPhysVol (const GeoFullPhysVol *){ ...@@ -24,12 +21,12 @@ void GeoCountVolAction::handleFullPhysVol (const GeoFullPhysVol *){
// Do not count the top volume, this action counts only children! // Do not count the top volume, this action counts only children!
// //
if (getPath ()->getLength () > 1) if (getPath ()->getLength () > 1)
m_count++; ++m_count;
} }
void GeoCountVolAction::handleVSurface (const GeoVSurface *){ void GeoCountVolAction::handleVSurface (const GeoVSurface *){
// Virtual Surface is always child of Physical Volume // Virtual Surface is always child of Physical Volume
m_count++; ++m_count;
} }
......
...@@ -8,15 +8,12 @@ GeoCountVolAndSTAction::GeoCountVolAndSTAction(){ ...@@ -8,15 +8,12 @@ GeoCountVolAndSTAction::GeoCountVolAndSTAction(){
setDepthLimit (1); setDepthLimit (1);
} }
GeoCountVolAndSTAction::~GeoCountVolAndSTAction(){
}
void GeoCountVolAndSTAction::handlePhysVol(const GeoPhysVol*){ void GeoCountVolAndSTAction::handlePhysVol(const GeoPhysVol*){
// //
// Do not count the top volume, this action counts only children! // Do not count the top volume, this action counts only children!
// //
if (getPath ()->getLength () > 1) if (getPath ()->getLength () > 1)
m_count++; ++m_count;
} }
void GeoCountVolAndSTAction::handleFullPhysVol(const GeoFullPhysVol*){ void GeoCountVolAndSTAction::handleFullPhysVol(const GeoFullPhysVol*){
...@@ -24,11 +21,11 @@ void GeoCountVolAndSTAction::handleFullPhysVol(const GeoFullPhysVol*){ ...@@ -24,11 +21,11 @@ void GeoCountVolAndSTAction::handleFullPhysVol(const GeoFullPhysVol*){
// Do not count the top volume, this action counts only children! // Do not count the top volume, this action counts only children!
// //
if (getPath ()->getLength () > 1) if (getPath ()->getLength () > 1)
m_count++; ++m_count;
} }
void GeoCountVolAndSTAction::handleSerialTransformer(const GeoSerialTransformer *){ void GeoCountVolAndSTAction::handleSerialTransformer(const GeoSerialTransformer *){
m_count ++; ++m_count;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment