Skip to content
Snippets Groups Projects
Commit adfb5980 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

cleanup: remove very old style, unnecessary constructors

parent d8518979
No related branches found
No related tags found
No related merge requests found
......@@ -14,28 +14,6 @@ using namespace std;
#include "coord.h"
#include "gar.h"
CCoord::CCoord(void)
{
}
CCoord::CCoord( const char *nin, const char *uin)
{
name = string(nin);
unit = string(uin);
}
CCoord::CCoord( const string *nin, const string *uin)
{
name = *nin;
unit = *uin;
}
CCoord::CCoord( const string nin, const string uin)
{
name = nin;
unit = uin;
}
char CoordDecode( const string& resp, CCoord *rval )
{
if (resp[0]=='\0') {
......@@ -84,17 +62,17 @@ CCoord CCoord::Ask( const string& quest )
return *this;
}
string CCoord::str(void) const
string CCoord::str() const
{
return name + ( unit!="" ? (" (" + unit + ")") : "");
}
string CCoord::ps_str(void) const // just two blanks instead of one
string CCoord::ps_str() const // just two blanks instead of one
{
return name + ( unit!="" ? (" (" + unit + ")") : "");
}
string CCoord::fstr(void) const
string CCoord::fstr() const
{
return name + "\t" + unit;
}
......@@ -136,7 +114,7 @@ int CParam::init_from_a01( const string in )
return 0;
}
string CParam::str(void) const
string CParam::str() const
{
return strg(val) + string(" ") + Co.str();
}
// This is coord.h
//
// Requires #include <string> "readln.h" "usrinp.h"
class CCoord {
public:
public:
string name, unit;
CCoord(void);
CCoord( const char *nin, const char *uin);
CCoord( const string *nin, const string *uin);
CCoord( const string nin, const string uin);
inline CCoord() {};
inline CCoord( const string _name, const string _unit) :
name(_name), unit(_unit) {};
CCoord Ask( const string& quest, const CCoord& defval );
CCoord Ask( const string& quest );
......@@ -26,21 +21,21 @@ public:
inline bool operator!= (const CCoord& Co2) const {
return !(*this==Co2); };
private:
private:
static const char *helptext;
};
inline string strg(const CCoord& C) { return C.str(); };
class CParam {
public:
public:
CCoord Co;
double val;
inline CParam(void) { };
inline CParam(void) {};
inline CParam(CCoord Cin, double vin=0) { Co = Cin; val = vin; };
inline CParam(string nin, string uin="", double vin=0)
{ Co = CCoord(nin, uin); val = vin; };
inline CParam(string _name, string _unit="", double vin=0)
{ Co = CCoord(_name, _unit); val = vin; };
string str(void) const;
int init_from_a01( const string in );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment