Commit 9e6eaccf authored by snuverink_j's avatar snuverink_j
Browse files

add override keyword where needed (-Winconsistent-missing-override from clang)

parent 19584e8f
......@@ -43,19 +43,19 @@ class AlignWrapper: public ElementBase {
public:
/// Apply BeamlineVisitor.
virtual void accept(BeamlineVisitor &) const;
virtual void accept(BeamlineVisitor &) const override;
/// Return clone.
// Return an identical deep copy of the wrapper and its contents.
virtual AlignWrapper *clone() const;
virtual AlignWrapper *clone() const override;
/// Make structural copy.
virtual ElementBase *copyStructure();
virtual ElementBase *copyStructure() override;
/// Set sharable flag.
// The whole structure depending on [b]this[/b] is marked as sharable.
// After this call a [b]copyStructure()[/b] call reuses the element.
virtual void makeSharable();
virtual void makeSharable() override;
/// Get entrance patch.
......@@ -80,12 +80,12 @@ public:
/// Get geometry.
// Return the element geometry.
// Version for non-constant object.
virtual BGeometryBase &getGeometry();
virtual BGeometryBase &getGeometry() override;
/// Get geometry.
// Return the element geometry.
// Version for constant object.
virtual const BGeometryBase &getGeometry() const;
virtual const BGeometryBase &getGeometry() const override;
/// Return the offset.
// This method can be used to get or set the offset. The offset is
......@@ -95,44 +95,44 @@ public:
/// Get element type std::string.
// Returns the type std::string for the enclosed item.
virtual ElementBase::ElementBase::ElementType getType() const;
virtual ElementBase::ElementBase::ElementType getType() const override;
/// Disallow misalignment of an already misaligned object.
// This method returns [b]this[/b], since "this" is already an
// AlignWrapper.
virtual ElementBase *makeAlignWrapper();
virtual ElementBase *makeAlignWrapper() override;
/// Allow field errors.
// Wrap the contained element in a field wrapper, unless such a
// wrapper already exists.
virtual ElementBase *makeFieldWrapper();
virtual ElementBase *makeFieldWrapper() override;
/// Remove AlignWrapper.
// Return the element or field wrapper contained in "this".
// Version for non-const object.
virtual ElementBase *removeAlignWrapper();
virtual ElementBase *removeAlignWrapper() override;
/// Remove AlignWrapper.
// Return the element or field wrapper contained in "this".
// Version for const object.
virtual const ElementBase *removeAlignWrapper() const;
virtual const ElementBase *removeAlignWrapper() const override;
/// Remove field wrapper.
// Remove any field wrapper on the contained object.
virtual ElementBase *removeFieldWrapper();
virtual ElementBase *removeFieldWrapper() override;
/// Remove field wrapper.
// Remove the field wrapper for constant object.
virtual const ElementBase *removeFieldWrapper() const;
virtual const ElementBase *removeFieldWrapper() const override;
/// Return the design element.
// This method removes all wrappers on the contained object.
// Version for non-const object.
virtual ElementBase *removeWrappers();
virtual ElementBase *removeWrappers() override;
/// Return the design element.
// Version for const object.
virtual const ElementBase *removeWrappers() const;
virtual const ElementBase *removeWrappers() const override;
private:
......@@ -158,4 +158,4 @@ private:
mutable Euclid3D itsOffset;
};
#endif // CLASSIC_AlignWrapper_HH
\ No newline at end of file
#endif // CLASSIC_AlignWrapper_HH
......@@ -22,7 +22,7 @@ public:
virtual ~CCollimator();
/// Apply visitor to CCollimator.
virtual void accept(BeamlineVisitor &) const;
virtual void accept(BeamlineVisitor &) const override;
///@{ Override implementation of PluginElement
virtual void goOnline(const double &kineticEnergy) override;
virtual ElementBase::ElementType getType() const override;
......@@ -85,4 +85,4 @@ inline
double CCollimator::getWidth() {
return width_m;
}
#endif // CLASSIC_CCollimator_HH
\ No newline at end of file
#endif // CLASSIC_CCollimator_HH
......@@ -41,17 +41,17 @@ public:
virtual ~Diagnostic();
/// Apply visitor to Diagnostic.
virtual void accept(BeamlineVisitor &) const;
virtual void accept(BeamlineVisitor &) const override;
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField);
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) override;
virtual void finalise();
virtual void finalise() override;
virtual bool bends() const;
virtual bool bends() const override;
virtual ElementBase::ElementType getType() const;
virtual ElementBase::ElementType getType() const override;
virtual void getDimensions(double &zBegin, double &zEnd) const;
virtual void getDimensions(double &zBegin, double &zEnd) const override;
private:
......@@ -59,4 +59,4 @@ private:
void operator=(const Diagnostic &);
};
#endif // CLASSIC_Diagnostic_HH
\ No newline at end of file
#endif // CLASSIC_Diagnostic_HH
......@@ -42,17 +42,17 @@ public:
virtual ~Drift();
/// Apply visitor to Drift.
virtual void accept(BeamlineVisitor &) const;
virtual void accept(BeamlineVisitor &) const override;
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField);
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) override;
virtual void finalise();
virtual void finalise() override;
virtual bool bends() const;
virtual bool bends() const override;
virtual ElementBase::ElementType getType() const;
virtual ElementBase::ElementType getType() const override;
virtual void getDimensions(double &zBegin, double &zEnd) const;
virtual void getDimensions(double &zBegin, double &zEnd) const override;
//set number of slices for map tracking
void setNSlices(const std::size_t& nSlices); // Philippe was here
......
......@@ -26,29 +26,29 @@ public:
virtual ~FlexibleCollimator();
/// Apply visitor to FlexibleCollimator.
virtual void accept(BeamlineVisitor &) const;
virtual void accept(BeamlineVisitor &) const override;
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B);
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) override;
virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B);
virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override;
virtual bool checkCollimator(PartBunchBase<double, 3> *bunch, const int turnnumber, const double t, const double tstep);
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField);
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) override;
virtual void initialise(PartBunchBase<double, 3> *bunch);
virtual void finalise();
virtual void finalise() override;
virtual bool bends() const;
virtual bool bends() const override;
virtual void goOnline(const double &kineticEnergy);
virtual void goOnline(const double &kineticEnergy) override;
virtual void goOffline();
virtual void goOffline() override;
virtual ElementBase::ElementType getType() const;
virtual ElementBase::ElementType getType() const override;
virtual void getDimensions(double &zBegin, double &zEnd) const;
virtual void getDimensions(double &zBegin, double &zEnd) const override;
void print();
......@@ -108,4 +108,4 @@ std::string FlexibleCollimator::getDescription() const {
return description_m;
}
#endif // CLASSIC_FlexibleCollimator_HH
\ No newline at end of file
#endif // CLASSIC_FlexibleCollimator_HH
......@@ -42,17 +42,17 @@ public:
virtual ~Lambertson();
/// Apply visitor to Lambertson.
virtual void accept(BeamlineVisitor &) const;
virtual void accept(BeamlineVisitor &) const override;
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField);
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) override;
virtual void finalise();
virtual void finalise() override;
virtual bool bends() const;
virtual bool bends() const override;
virtual ElementBase::ElementType getType() const;
virtual ElementBase::ElementType getType() const override;
virtual void getDimensions(double &zBegin, double &zEnd) const;
virtual void getDimensions(double &zBegin, double &zEnd) const override;
private:
......@@ -60,4 +60,4 @@ private:
void operator=(const Lambertson &);
};
#endif // CLASSIC_Lambertson_HH
\ No newline at end of file
#endif // CLASSIC_Lambertson_HH
......@@ -41,17 +41,17 @@ public:
virtual ~Marker();
/// Apply visitor to Marker.
virtual void accept(BeamlineVisitor &) const;
virtual void accept(BeamlineVisitor &) const override;
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField);
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) override;
virtual void finalise();
virtual void finalise() override;
virtual bool bends() const;
virtual bool bends() const override;
virtual ElementBase::ElementType getType() const;
virtual ElementBase::ElementType getType() const override;
virtual void getDimensions(double &zBegin, double &zEnd) const;
virtual void getDimensions(double &zBegin, double &zEnd) const override;
private:
......@@ -59,4 +59,4 @@ private:
void operator=(const Marker &);
};
#endif // CLASSIC_Marker_HH
\ No newline at end of file
#endif // CLASSIC_Marker_HH
......@@ -67,38 +67,38 @@ public:
virtual ~Monitor();
/// Apply visitor to Monitor.
virtual void accept(BeamlineVisitor &) const;
virtual void accept(BeamlineVisitor &) const override;
/// Get geometry.
virtual StraightGeometry &getGeometry() = 0;
virtual StraightGeometry &getGeometry() override = 0;
/// Get geometry. Version for const object.
virtual const StraightGeometry &getGeometry() const = 0;
virtual const StraightGeometry &getGeometry() const override = 0;
/// Get plane on which monitor observes.
virtual Plane getPlane() const = 0;
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B);
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) override;
virtual bool applyToReferenceParticle(const Vector_t &R,
const Vector_t &P,
const double &t,
Vector_t &E,
Vector_t &B);
Vector_t &B) override;
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField);
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) override;
virtual void finalise();
virtual void finalise() override;
virtual bool bends() const;
virtual bool bends() const override;
virtual void goOnline(const double &kineticEnergy);
virtual void goOnline(const double &kineticEnergy) override;
virtual void goOffline();
virtual void goOffline() override;
virtual ElementBase::ElementType getType() const;
virtual ElementBase::ElementType getType() const override;
virtual void getDimensions(double &zBegin, double &zEnd) const;
virtual void getDimensions(double &zBegin, double &zEnd) const override;
void setOutputFN(std::string fn);
......@@ -124,4 +124,4 @@ void Monitor::setType(Monitor::Type type) {
type_m = type;
}
#endif // CLASSIC_Monitor_HH
\ No newline at end of file
#endif // CLASSIC_Monitor_HH
......@@ -55,14 +55,14 @@ public:
virtual ~Multipole();
/// Apply visitor to Multipole.
virtual void accept(BeamlineVisitor &) const;
virtual void accept(BeamlineVisitor &) const override;
/// Get multipole field.
virtual BMultipoleField &getField() = 0;
virtual BMultipoleField &getField() override = 0;
/// Get multipole field. Version for const object.
virtual const BMultipoleField &getField() const = 0;
virtual const BMultipoleField &getField() const override = 0;
/// Get normal component.
// Return the normal component of order [b]n[/b] in T/m**(n-1).
......@@ -106,32 +106,32 @@ public:
bool isFocusing(unsigned int component) const;
/// Get geometry.
virtual StraightGeometry &getGeometry() = 0;
virtual StraightGeometry &getGeometry() override = 0;
/// Get geometry.
virtual const StraightGeometry &getGeometry() const = 0;
virtual const StraightGeometry &getGeometry() const override = 0;
virtual void addKR(int i, double t, Vector_t &K);
virtual void addKR(int i, double t, Vector_t &K) override;
virtual void addKT(int i, double t, Vector_t &K);
virtual void addKT(int i, double t, Vector_t &K) override;
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B);
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) override;
virtual bool apply(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B);
virtual bool apply(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override;
virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B);
virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override;
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField);
virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField) override;
virtual void finalise();
virtual void finalise() override;
virtual bool bends() const;
virtual bool bends() const override;
virtual ElementBase::ElementType getType() const;
virtual ElementBase::ElementType getType() const override;
virtual void getDimensions(double &zBegin, double &zEnd) const;
virtual void getDimensions(double &zBegin, double &zEnd) const override;
virtual bool isInside(const Vector_t &r) const;
virtual bool isInside(const Vector_t &r) const override;
private:
void computeField(Vector_t R, Vector_t &E, Vector_t &B);
......
......@@ -97,13 +97,13 @@ public:
/** Destructor */
~MultipoleT();
/** Inheritable copy constructor */
ElementBase* clone() const;
ElementBase* clone() const override;
/** Return a dummy field value */
EMField &getField();
EMField &getField() override;
/** Return a dummy field value */
const EMField &getField() const;
const EMField &getField() const override;
/** Not implemented */
void getDimensions(double &zBegin, double &zEnd) const;
void getDimensions(double &zBegin, double &zEnd) const override;
/** Calculate the field at some arbitrary position
* If particle is outside field map true is returned,
* otherwise false is returned
......@@ -114,9 +114,9 @@ public:
* \param B -> Calculated magnetic field
*/
bool apply(const Vector_t &R, const Vector_t &P, const double &t,
Vector_t &E, Vector_t &B);
Vector_t &E, Vector_t &B) override;
/** Calculate the field at the position of the ith particle
* \param i -> Index of the particle event; field is calculated at this
* \param i -> Index of the particle event override; field is calculated at this
* position
* If particle is outside field map true is returned,
* otherwise false is returned
......@@ -124,7 +124,7 @@ public:
* \param E -> Calculated electric field - always 0 (no E-field)
* \param B -> Calculated magnetic field
*/
bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B);
bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) override;
/** Initialise the MultipoleT
* \param bunch -> Bunch the global bunch object
* \param startField -> Not used
......@@ -132,20 +132,20 @@ public:
*/
void initialise(PartBunchBase<double, 3>*,
double &startField,
double &endField);
double &endField) override;
/** Initialises the geometry */
void initialise();
/** Finalise the MultipoleT - sets bunch to NULL */
void finalise();
void finalise() override;
/** Return true if dipole component not zero */
bool bends() const;
bool bends() const override;
/** Return the cell geometry */
PlanarArcGeometry& getGeometry();
PlanarArcGeometry& getGeometry() override;
/** Return the cell geometry */
const PlanarArcGeometry& getGeometry() const;
const PlanarArcGeometry& getGeometry() const override;
/** Accept a beamline visitor */
void accept(BeamlineVisitor& visitor) const;
void accept(BeamlineVisitor& visitor) const override;
/** Get the dipole constant B_0 */
double getDipoleConstant() const;
/** Set the dipole constant B_0 */
......
......@@ -91,18 +91,18 @@ public:
/** Destructor */
~MultipoleTCurvedConstRadius();
/** Inheritable copy constructor */
virtual ElementBase* clone() const;
virtual ElementBase* clone() const override;
/** Accept a beamline visitor */
void accept(BeamlineVisitor &visitor) const;
void accept(BeamlineVisitor &visitor) const override;
/** Return the cell geometry */
PlanarArcGeometry& getGeometry();
PlanarArcGeometry& getGeometry() override;
/** Return the cell geometry */
const PlanarArcGeometry& getGeometry() const;
const PlanarArcGeometry& getGeometry() const override;
/** Set the number of terms used in calculation of field components \n
* Maximum power of z in Bz is 2 * maxOrder_m
* \param maxOrder -> Number of terms in expansion in z
*/
virtual void setMaxOrder(const std::size_t &maxOrder);
virtual void setMaxOrder(const std::size_t &maxOrder) override;
/** Get highest power of x in polynomial expansions */
std::size_t getMaxXOrder() const;
/** Set the number of terms used in polynomial expansions
......@@ -110,9 +110,9 @@ public:
*/
void setMaxXOrder(const std::size_t &maxXOrder);
/** Set the bending angle of the magnet */
virtual void setBendAngle(const double &angle);
virtual void setBendAngle(const double &angle) override;
/** Get the bending angle of the magnet */
virtual double getBendAngle() const;
virtual double getBendAngle() const override;
/** Initialise the MultipoleT
* \param bunch -> Bunch the global bunch object
* \param startField -> Not used
......@@ -120,7 +120,7 @@ public:
*/
virtual void initialise(PartBunchBase<double, 3>* bunch,
double &startField,
double &endField);
double &endField) override;
private:
MultipoleTCurvedConstRadius operator=(
const MultipoleTCurvedConstRadius &rhs);
......@@ -131,21 +131,21 @@ private:
/** Geometry */
PlanarArcGeometry planarArcGeometry_m;
/** Transform to Frenet-Serret coordinates for sector magnets */
virtual void transformCoords(Vector_t &R);
virtual void transformCoords(Vector_t &R) override;
/** Transform B-field from Frenet-Serret coordinates to lab coordinates */
virtual void transformBField(Vector_t &B, const Vector_t &R);
virtual void transformBField(Vector_t &B, const Vector_t &R) override;
double angle_m;
/** Radius of curvature \n
* If radius of curvature is infinite, -1 is returned \n
* @f$ \rho(s) = length_m / angle_m @f$
* \param s -> Coordinate s
*/
virtual double getRadius(const double &s);
virtual double getRadius(const double &s) override;
/** Returns the scale factor @f$ h_s = 1 + x / \rho @f$
* \param x -> Coordinate x
* \param s -> Coordinate s
*/
virtual double getScaleFactor(const double &x, const double &s);
virtual double getScaleFactor(const double &x, const double &s) override;
/** Calculate fn(x, s) by expanding the differential operator
* (from Laplacian and scalar potential) in terms of polynomials
* \param n -> nth derivative
......@@ -154,7 +154,7 @@ private:
*/
virtual double getFn(const std::size_t &n,
const double &x,
const double &s);
const double &s) override;
};
inline
......
......@@ -93,18 +93,18 @@ public:
/** Destructor */
~MultipoleTCurvedVarRadius();
/** Inheritable copy constructor */
virtual ElementBase* clone() const;
virtual ElementBase* clone() const override;
/** Accept a beamline visitor */
void accept(BeamlineVisitor &visitor) const;
void accept(BeamlineVisitor &visitor) const override;
/** Return the cell geometry */
VarRadiusGeometry& getGeometry();
VarRadiusGeometry& getGeometry() override;
/** Return the cell geometry */
const VarRadiusGeometry& getGeometry() const;
const VarRadiusGeometry& getGeometry() const override;
/** Set the number of terms used in calculation of field components \n
* Maximum power of z in Bz is 2 * maxOrder_m
* \param maxOrder -> Number of terms in expansion in z
*/
virtual void setMaxOrder(const std::size_t &maxOrder);
virtual void setMaxOrder(const std::size_t &maxOrder) override;
/** Get highest power of x in polynomial expansions */
std::size_t getMaxXOrder() const;
/** Set the number of terms used in polynomial expansions
......@@ -112,9 +112,9 @@ public:
*/
void setMaxXOrder(const std::size_t &maxXOrder);
/** Set the bending angle of the magnet */
virtual void setBendAngle(const double &angle);
virtual void setBendAngle(const double &angle) override;
/** Get the bending angle of the magnet */
virtual double getBendAngle() const;
virtual double getBendAngle() const override;
/** Initialise the MultipoleT
* \param bunch -> Bunch the global bunch object
* \param startField -> Not used
......@@ -122,7 +122,7 @@ public:
*/
virtual void initialise(PartBunchBase<double, 3>* bunch,
double &startField,
double &endField);
double &endField) override;
private:
MultipoleTCurvedVarRadius operator=(const MultipoleTCurvedVarRadius& rhs);
/** Highest order of polynomial expansions in x */
......@@ -132,9 +132,9 @@ private:
/** Geometry */
VarRadiusGeometry varRadiusGeometry_m;
/** Transform to Frenet-Serret coordinates for sector magnets */
virtual void transformCoords(Vector_t &R);
virtual void transformCoords(Vector_t &R) override;
/** Transform B-field from Frenet-Serret coordinates to lab coordinates */
virtual void transformBField(Vector_t &B, const Vector_t &R);
virtual void transformBField(Vector_t &B, const Vector_t &R) override;
double angle_m;