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

Minor clean of the constructors

parent 1e926f17
No related branches found
No related tags found
No related merge requests found
Pipeline #10956664 failed
Showing
with 80 additions and 125 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 *); virtual void handlePhysVol (const GeoPhysVol *);
...@@ -29,10 +29,8 @@ class GeoCountVolAction : public GeoNodeAction ...@@ -29,10 +29,8 @@ 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{0};
}; };
inline unsigned int GeoCountVolAction::getCount () const inline unsigned int GeoCountVolAction::getCount () const
......
...@@ -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,10 +27,7 @@ class GeoCountVolAndSTAction : public GeoNodeAction ...@@ -27,10 +27,7 @@ class GeoCountVolAndSTAction : public GeoNodeAction
unsigned int getCount() const; unsigned int getCount() const;
private: private:
GeoCountVolAndSTAction(const GeoCountVolAndSTAction &right); unsigned int m_count{0};
const GeoCountVolAndSTAction & operator=(const GeoCountVolAndSTAction &right);
unsigned int m_count;
}; };
inline unsigned int GeoCountVolAndSTAction::getCount() const inline unsigned int GeoCountVolAndSTAction::getCount() const
......
...@@ -138,16 +138,16 @@ class GeoShapeAction ...@@ -138,16 +138,16 @@ 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.
std::optional<unsigned int> m_depth; std::optional<unsigned int> m_depth{std::nullopt};
// Termination flag; causes an abortion of action execution. // Termination flag; causes an abortion of action execution.
bool m_terminate; bool m_terminate{false};
GeoShapePath m_path; GeoShapePath m_path{};
}; };
......
...@@ -48,21 +48,21 @@ class GeoSurfaceCursor final : public GeoNodeAction ...@@ -48,21 +48,21 @@ class GeoSurfaceCursor final : public GeoNodeAction
/// Ressucitate (undo terminate) /// Ressucitate (undo terminate)
void resuscitate(); void resuscitate();
PVConstLink m_parent; PVConstLink m_parent{nullptr};
PVConstLink m_volume; PVConstLink m_volume{nullptr};
VSConstLink m_surface; VSConstLink m_surface{nullptr};
GeoTrf::Transform3D m_transform; GeoTrf::Transform3D m_transform{GeoTrf::Transform3D::Identity()};
GeoTrf::Transform3D m_defTransform; GeoTrf::Transform3D m_defTransform{GeoTrf::Transform3D::Identity()};
unsigned int m_majorIndex; unsigned int m_majorIndex{0};
unsigned int m_volCount; unsigned int m_volCount{0};
unsigned int m_surfCount; unsigned int m_surfCount{0};
std::vector<const GeoTransform *> m_pendingTransformList; std::vector<const GeoTransform *> m_pendingTransformList{};
bool m_hasAlignTrans{}; bool m_hasAlignTrans{};
GeoVAlignmentStore *m_alignStore; GeoVAlignmentStore *m_alignStore{nullptr};
}; };
#endif #endif
...@@ -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);
}; };
......
...@@ -28,8 +28,11 @@ class GeoVDetectorElement; ...@@ -28,8 +28,11 @@ class GeoVDetectorElement;
class GeoVDetectorManager class GeoVDetectorManager
{ {
public: public:
GeoVDetectorManager(); GeoVDetectorManager() = default;
virtual ~GeoVDetectorManager(); virtual ~GeoVDetectorManager() = default;
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)
...@@ -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,17 +50,15 @@ class GeoVolumeAction ...@@ -50,17 +50,15 @@ 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.
Type m_type; Type m_type{Type::TOP_DOWN};
// Termination flag; causes an abortion of action execution. // Termination flag; causes an abortion of action execution.
bool m_terminate; bool m_terminate{false};
GeoTraversalState m_traversalState; GeoTraversalState m_traversalState{};
}; };
......
...@@ -17,10 +17,7 @@ class GeoVolumeCursor final : public GeoNodeAction ...@@ -17,10 +17,7 @@ class GeoVolumeCursor final : public GeoNodeAction
public: public:
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();
...@@ -79,29 +76,28 @@ class GeoVolumeCursor final : public GeoNodeAction ...@@ -79,29 +76,28 @@ class GeoVolumeCursor final : public GeoNodeAction
/// Ressucitate (undo terminate) /// Ressucitate (undo terminate)
void resuscitate(); void resuscitate();
PVConstLink m_parent{nullptr};
PVConstLink m_parent; PVConstLink m_volume{nullptr};
PVConstLink m_volume; VSConstLink m_surface{nullptr};
VSConstLink m_surface; GeoTrf::Transform3D m_transform{GeoTrf::Transform3D::Identity()};
GeoTrf::Transform3D m_transform; GeoTrf::Transform3D m_defTransform{GeoTrf::Transform3D::Identity()};
GeoTrf::Transform3D m_defTransform;
unsigned int m_majorIndex; unsigned int m_majorIndex{0};
unsigned int m_minorIndex; unsigned int m_minorIndex{0};
unsigned int m_minorLimit; unsigned int m_minorLimit{0};
const GeoSerialTransformer *m_serialTransformer; const GeoSerialTransformer* m_serialTransformer{nullptr};
const GeoNameTag *m_nameTag; const GeoNameTag* m_nameTag{nullptr};
const GeoSerialDenominator *m_serialDenominator; const GeoSerialDenominator* m_serialDenominator{nullptr};
const GeoIdentifierTag *m_idTag; const GeoIdentifierTag* m_idTag{nullptr};
std::vector<const GeoTransform *> m_pendingTransformList; std::vector<const GeoTransform *> m_pendingTransformList{};
unsigned int m_serialDenomPosition; unsigned int m_serialDenomPosition{0};
const GeoSerialIdentifier *m_serialIdentifier; const GeoSerialIdentifier* m_serialIdentifier{nullptr};
unsigned int m_serialIdentPosition; unsigned int m_serialIdentPosition{0};
unsigned int m_volCount; unsigned int m_volCount{0};
bool m_hasAlignTrans; bool m_hasAlignTrans{false};
GeoVAlignmentStore *m_alignStore; GeoVAlignmentStore* m_alignStore{};
}; };
#endif #endif
...@@ -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.
......
...@@ -5,14 +5,10 @@ ...@@ -5,14 +5,10 @@
#include "GeoModelKernel/GeoCountVolAction.h" #include "GeoModelKernel/GeoCountVolAction.h"
GeoCountVolAction::GeoCountVolAction () GeoCountVolAction::GeoCountVolAction ()
: m_count (0)
{ {
setDepthLimit (1); setDepthLimit (1);
} }
GeoCountVolAction::~GeoCountVolAction()
{
}
void GeoCountVolAction::handlePhysVol (const GeoPhysVol *) void GeoCountVolAction::handlePhysVol (const GeoPhysVol *)
{ {
...@@ -20,7 +16,7 @@ void GeoCountVolAction::handlePhysVol (const GeoPhysVol *) ...@@ -20,7 +16,7 @@ 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 *)
...@@ -29,13 +25,13 @@ void GeoCountVolAction::handleFullPhysVol (const GeoFullPhysVol *) ...@@ -29,13 +25,13 @@ 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;
} }
......
...@@ -4,15 +4,10 @@ ...@@ -4,15 +4,10 @@
#include "GeoModelKernel/GeoCountVolAndSTAction.h" #include "GeoModelKernel/GeoCountVolAndSTAction.h"
GeoCountVolAndSTAction::GeoCountVolAndSTAction() GeoCountVolAndSTAction::GeoCountVolAndSTAction() {
:m_count (0)
{
setDepthLimit (1); setDepthLimit (1);
} }
GeoCountVolAndSTAction::~GeoCountVolAndSTAction()
{
}
void GeoCountVolAndSTAction::handlePhysVol(const GeoPhysVol*) void GeoCountVolAndSTAction::handlePhysVol(const GeoPhysVol*)
{ {
...@@ -20,7 +15,7 @@ void GeoCountVolAndSTAction::handlePhysVol(const GeoPhysVol*) ...@@ -20,7 +15,7 @@ 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*)
...@@ -29,12 +24,11 @@ void GeoCountVolAndSTAction::handleFullPhysVol(const GeoFullPhysVol*) ...@@ -29,12 +24,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 ++;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment