Commit 22f51d1d authored by Jens Wehner's avatar Jens Wehner

changed syntax of default constructors

parent 681ced14
Pipeline #89462499 failed with stages
in 340 minutes and 48 seconds
......@@ -43,7 +43,7 @@ class BaseBead {
/**
* destructor
*/
virtual ~BaseBead() {}
virtual ~BaseBead() = default;
/// Gets the id of the bead
int getId() const { return id_.getId(); }
......
......@@ -48,7 +48,7 @@ class Bead : public BaseBead {
/**
* destructor
*/
~Bead() override {}
~Bead() override = default;
/**
* get the residu number of the bead
......
......@@ -119,7 +119,8 @@ class BeadMotif : public BeadStructure<BaseBead> {
undefined
};
BeadMotif(){};
BeadMotif() = default;
;
BeadMotif(const BeadStructure &structure) : BeadStructure(structure){};
......
......@@ -33,7 +33,7 @@ namespace csg {
class BeadPair {
public:
BeadPair() {}
BeadPair() = default;
BeadPair(Bead *bead1, Bead *bead2, Eigen::Vector3d r)
: _pair(std::pair<Bead *, Bead *>(bead1, bead2)),
_r(r),
......
......@@ -53,7 +53,7 @@ namespace csg {
template <class T>
class BeadStructure {
public:
~BeadStructure() {}
~BeadStructure() = default;
/**
* \brief Determine if the bead structure consists of a single connected
......
......@@ -33,7 +33,7 @@ namespace csg {
class BeadTriple : public std::tuple<Bead *, Bead *, Bead *> {
public:
BeadTriple() {}
BeadTriple() = default;
BeadTriple(Bead *bead1, Bead *bead2, Bead *bead3, Eigen::Vector3d r12,
Eigen::Vector3d r13, Eigen::Vector3d r23)
: std::tuple<Bead *, Bead *, Bead *>(bead1, bead2, bead3),
......@@ -44,7 +44,7 @@ class BeadTriple : public std::tuple<Bead *, Bead *, Bead *> {
_dist13(r13.norm()),
_dist23(r23.norm()) {}
virtual ~BeadTriple() {}
virtual ~BeadTriple() = default;
/// \brief return the beads
const Bead *bead1() { return std::get<0>(*this); }
......
......@@ -26,7 +26,8 @@ namespace csg {
class BoundaryCondition {
public:
virtual ~BoundaryCondition(){};
virtual ~BoundaryCondition() = default;
;
/**
* set the simulation box
......
......@@ -43,7 +43,7 @@ namespace csg {
*/
class CGMoleculeDef {
public:
CGMoleculeDef() {}
CGMoleculeDef() = default;
~CGMoleculeDef();
Molecule *CreateMolecule(Topology &top);
......
......@@ -31,8 +31,10 @@ namespace csg {
class CsgApplication : public tools::Application {
public:
CsgApplication(){};
~CsgApplication() override{};
CsgApplication() = default;
;
~CsgApplication() override = default;
;
void Initialize() override;
bool EvaluateOptions() override;
......@@ -99,7 +101,8 @@ class CsgApplication : public tools::Application {
*/
class Worker : public tools::Thread {
public:
Worker(){};
Worker() = default;
;
~Worker() override;
/// \brief overload with the actual computation
......
......@@ -34,7 +34,7 @@ class Bead;
class ExclusionList {
public:
ExclusionList() {}
ExclusionList() = default;
~ExclusionList() { Clear(); }
void Clear(void);
......
......@@ -30,7 +30,7 @@ namespace TOOLS = votca::tools;
template <typename T>
class FileFormatFactory : public TOOLS::ObjectFactory<std::string, T> {
public:
FileFormatFactory() {}
FileFormatFactory() = default;
T *Create(const std::string &file);
};
......
......@@ -39,7 +39,7 @@ class Interaction {
public:
Interaction() : _index(-1), _group(""), _group_id(-1), _name(""), _mol(-1){};
virtual ~Interaction() {}
virtual ~Interaction() = default;
virtual double EvaluateVar(const Topology &top) = 0;
std::string getName() const { return _name; }
......
......@@ -49,7 +49,8 @@ class Map {
*******************************************************/
class BeadMap {
public:
virtual ~BeadMap(){};
virtual ~BeadMap() = default;
;
virtual void Apply() = 0;
virtual void Initialize(Molecule *in, Bead *out, tools::Property *opts_map,
tools::Property *opts_bead);
......@@ -75,7 +76,7 @@ inline void BeadMap::Initialize(Molecule *in, Bead *out,
*******************************************************/
class Map_Sphere : public BeadMap {
public:
Map_Sphere() {}
Map_Sphere() = default;
void Apply() override;
void Initialize(Molecule *in, Bead *out, tools::Property *opts_bead,
......@@ -105,7 +106,7 @@ inline void Map_Sphere::AddElem(Bead *in, double weight, double force_weight) {
*******************************************************/
class Map_Ellipsoid : public Map_Sphere {
public:
Map_Ellipsoid() {}
Map_Ellipsoid() = default;
void Apply() override;
protected:
......
......@@ -27,7 +27,7 @@ class Molecule;
class MoleculeItem {
public:
virtual ~MoleculeItem() {}
virtual ~MoleculeItem() = default;
/**
* Returns the molecule the pointer points at
......
......@@ -110,10 +110,11 @@ class NBList : public PairList<Bead *, BeadPair> {
/// functions
class Functor {
public:
Functor() {}
Functor() = default;
virtual bool operator()(Bead *, Bead *, const Eigen::Vector3d &,
const double dist) = 0;
virtual ~Functor(){};
virtual ~Functor() = default;
;
};
/// Functor for member functions
......
......@@ -136,12 +136,13 @@ class NBList_3Body : public TripleList<Bead *, BeadTriple> {
/// functions
class Functor {
public:
Functor() {}
Functor() = default;
virtual bool operator()(Bead *, Bead *, Bead *, const Eigen::Vector3d &,
const Eigen::Vector3d &, const Eigen::Vector3d &,
const double dist12, const double dist13,
const double dist23) = 0;
virtual ~Functor(){};
virtual ~Functor() = default;
;
};
/// Functor for member functions
......
......@@ -26,8 +26,8 @@ namespace csg {
class NematicOrder {
public:
NematicOrder() {}
~NematicOrder() {}
NematicOrder() = default;
~NematicOrder() = default;
void Process(Topology &top, const std::string &filter = "*");
......
......@@ -27,7 +27,7 @@ namespace csg {
template <typename element_type, typename pair_type>
class PairList {
public:
PairList() {}
PairList() = default;
virtual ~PairList() { Cleanup(); }
// this method takes ownership of p
......
......@@ -25,7 +25,7 @@ namespace votca {
namespace csg {
class PotentialFunction {
public:
virtual ~PotentialFunction() {}
virtual ~PotentialFunction() = default;
// read parameters from the input file
virtual void setParam(std::string filename);
// save parameters to the file
......
......@@ -29,7 +29,7 @@ class PotentialFunctionCBSPL : public PotentialFunction {
public:
PotentialFunctionCBSPL(const std::string &name_, const int nlam_,
const double min_ = 0.0, const double max_ = 10.0);
~PotentialFunctionCBSPL() override {}
~PotentialFunctionCBSPL() override = default;
// calculate function value for given r
double CalculateF(const double r) const override;
// calculate first derivative w.r.t. ith parameter
......
......@@ -30,7 +30,8 @@ class PotentialFunctionLJ126 : public PotentialFunction {
public:
PotentialFunctionLJ126(const std::string &name_, const double min_ = 0.0,
const double max_ = 10.0);
~PotentialFunctionLJ126() override{};
~PotentialFunctionLJ126() override = default;
;
// calculate function value for given r
double CalculateF(const double r) const override;
// calculate first derivative w.r.t. ith parameter
......
......@@ -27,7 +27,8 @@ class PotentialFunctionLJG : public PotentialFunction {
public:
PotentialFunctionLJG(const std::string &name_, const double min_ = 0.0,
const double max_ = 10.0);
~PotentialFunctionLJG() override{};
~PotentialFunctionLJG() override = default;
;
// calculate function value for given r
double CalculateF(const double r) const override;
// calculate first derivative w.r.t. ith parameter
......
......@@ -25,7 +25,7 @@ class Topology;
class TopologyItem {
public:
virtual ~TopologyItem() {}
virtual ~TopologyItem() = default;
Topology *getParent() const { return _parent; }
protected:
......
......@@ -27,7 +27,7 @@ namespace csg {
class TopologyReader {
public:
virtual ~TopologyReader() {}
virtual ~TopologyReader() = default;
/// open, read and close topology file
virtual bool ReadTopology(std::string file, Topology &top) = 0;
......
......@@ -32,7 +32,7 @@ namespace csg {
*/
class TrajectoryReader {
public:
virtual ~TrajectoryReader() {}
virtual ~TrajectoryReader() = default;
/// open a trejectory file
virtual bool Open(const std::string &file) = 0;
......
......@@ -29,8 +29,8 @@ namespace csg {
class TrajectoryWriter {
public:
TrajectoryWriter() {}
virtual ~TrajectoryWriter() {}
TrajectoryWriter() = default;
virtual ~TrajectoryWriter() = default;
virtual void Open(std::string file, bool bAppend = false) {}
virtual void Close(){};
......
......@@ -27,7 +27,7 @@ namespace csg {
template <typename element_type, typename triple_type>
class TripleList {
public:
TripleList() {}
TripleList() = default;
virtual ~TripleList() { Cleanup(); }
void AddTriple(triple_type *t);
......
......@@ -38,8 +38,8 @@ namespace csg {
*/
class XYZReader : public TrajectoryReader, public TopologyReader {
public:
XYZReader() {}
~XYZReader() override {}
XYZReader() = default;
~XYZReader() override = default;
/// open a topology file
bool ReadTopology(std::string file, Topology &top) override;
......
......@@ -82,7 +82,8 @@ class CsgTestApp : public CsgApplication {
// derive from CsgApplication::Worker and define your worker
class RDFWorker : public CsgApplication::Worker {
public:
~RDFWorker() override{};
~RDFWorker() override = default;
;
// override EvalConfiguration with your analysis routine
void EvalConfiguration(Topology *top, Topology *top_ref) override;
// data belonging to this particular worker
......
......@@ -34,8 +34,8 @@ namespace csg {
class AnalysisTool {
public:
AnalysisTool() {}
virtual ~AnalysisTool() {}
AnalysisTool() = default;
virtual ~AnalysisTool() = default;
virtual void Register(std::map<std::string, AnalysisTool *> &lib) {}
virtual void Command(BondedStatistics &bs, const std::string &cmd,
......
......@@ -27,8 +27,10 @@ namespace csg {
class StdAnalysis : public AnalysisTool {
public:
StdAnalysis(){};
~StdAnalysis() override{};
StdAnalysis() = default;
;
~StdAnalysis() override = default;
;
void Register(std::map<std::string, AnalysisTool *> &lib) override;
......
......@@ -104,7 +104,8 @@ namespace csg {
class TabulatedPotential : public AnalysisTool {
public:
TabulatedPotential();
~TabulatedPotential() override{};
~TabulatedPotential() override = default;
;
void Register(std::map<std::string, AnalysisTool *> &lib) override;
......
......@@ -27,7 +27,7 @@ using namespace std;
namespace po = boost::program_options;
CGEngine::CGEngine() {}
CGEngine::CGEngine() = default;
CGEngine::~CGEngine() {
map<string, CGMoleculeDef *>::iterator i;
......
......@@ -35,7 +35,7 @@ namespace csg {
class DLPOLYTopologyReader : public TopologyReader {
public:
DLPOLYTopologyReader() {}
DLPOLYTopologyReader() = default;
/// read a topology file
bool ReadTopology(std::string file, Topology &top) override;
......
......@@ -33,7 +33,7 @@ namespace csg {
*/
class GMXTopologyReader : public TopologyReader {
public:
GMXTopologyReader() {}
GMXTopologyReader() = default;
/// read a topology file
bool ReadTopology(std::string file, Topology &top) override;
......
......@@ -45,7 +45,7 @@ namespace TOOLS = votca::tools;
*/
class GMXTrajectoryReader : public TrajectoryReader {
public:
GMXTrajectoryReader() {}
GMXTrajectoryReader() = default;
/// open a trejectory file
bool Open(const std::string &file) override;
......
......@@ -36,7 +36,7 @@ namespace csg {
class GMXTrajectoryWriter : public TrajectoryWriter {
public:
GMXTrajectoryWriter() {}
GMXTrajectoryWriter() = default;
void Open(std::string file, bool bAppend = false) override;
void Close() override;
......
......@@ -36,8 +36,8 @@ namespace csg {
*/
class GROReader : public TrajectoryReader, public TopologyReader {
public:
GROReader() {}
~GROReader() override {}
GROReader() = default;
~GROReader() override = default;
/// open a topology file
bool ReadTopology(std::string file, Topology &top) override;
......
......@@ -38,8 +38,8 @@ class Molecule;
*/
class LAMMPSDataReader : public TrajectoryReader, public TopologyReader {
public:
LAMMPSDataReader() {}
~LAMMPSDataReader() override {}
LAMMPSDataReader() = default;
~LAMMPSDataReader() override = default;
/// open, read and close topology file
bool ReadTopology(std::string file, Topology &top) override;
......
......@@ -36,8 +36,8 @@ namespace csg {
*/
class LAMMPSDumpReader : public TrajectoryReader, public TopologyReader {
public:
LAMMPSDumpReader() {}
~LAMMPSDumpReader() override {}
LAMMPSDumpReader() = default;
~LAMMPSDumpReader() override = default;
/// open a topology file
bool ReadTopology(std::string file, Topology &top) override;
......
......@@ -38,9 +38,9 @@ namespace csg {
class PDBReader : public TopologyReader, public TrajectoryReader {
public:
/// Constuctor
PDBReader() {}
PDBReader() = default;
/// Destructor
~PDBReader() override {}
~PDBReader() override = default;
/// open a topology file
bool ReadTopology(std::string file, Topology &top) override;
/// open a trajectory file
......
......@@ -50,7 +50,8 @@ class XMLBead {
XMLBead(std::string _name, std::string _type, double _mass = 1.0,
double _q = 0.0)
: name(_name), type(_type), mass(_mass), q(_q){};
XMLBead(){};
XMLBead() = default;
;
int pid;
std::string name;
......
......@@ -26,7 +26,7 @@ NBList_3Body::NBList_3Body() : _do_exclusions(false), _match_function(nullptr) {
SetMatchFunction(NBList_3Body::match_always);
}
NBList_3Body::~NBList_3Body() {}
NBList_3Body::~NBList_3Body() = default;
void NBList_3Body::Generate(BeadList &list1, BeadList &list2, BeadList &list3,
bool do_exclusions) {
......
......@@ -129,7 +129,8 @@ class CsgREupdate : public CsgApplication {
class CsgREupdateWorker : public CsgApplication::Worker {
public:
~CsgREupdateWorker() override{};
~CsgREupdateWorker() override = default;
;
Property _options;
std::vector<Property *> _nonbonded;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment