use const std::string& instead of std::string as parameter

This commit is contained in:
dqueteschiner
2015-03-26 15:06:05 +01:00
parent 8566c7eaa4
commit 343d1cba5b
3 changed files with 24 additions and 24 deletions

View File

@ -54,7 +54,7 @@ void Foam::clockModel::start(int pos) const
return;
}
void Foam::clockModel::start(int pos,std::string ident) const
void Foam::clockModel::start(int pos, const std::string& ident) const
{
if (particleCloud_.mesh().time().value() > startTime_)
{
@ -96,7 +96,7 @@ void Foam::clockModel::stop() const
return;
}
void Foam::clockModel::stop(std::string ident) const
void Foam::clockModel::stop(const std::string& ident) const
{
if (particleCloud_.mesh().time().value() > startTime_)
{
@ -303,7 +303,7 @@ void Foam::clockModel::normHist() const
return;
}
void Foam::clockModel::plotHist(double buffIn,std::string identifier,int numprocs,int myrank) const
void Foam::clockModel::plotHist(double buffIn,const std::string& identifier,int numprocs,int myrank) const
{
double* globalTime_all = NULL;
if (myrank == 0) globalTime_all = new double[numprocs];

View File

@ -120,19 +120,19 @@ public:
// Member Functions
virtual void start(int pos) const; //start measurement with custom string identifier
virtual void start(int pos,std::string identifier) const; //start measurement with custom string identifier
virtual void stop() const; //stop last started measurement
virtual void stop(std::string identifier) const; //stop last started measurement with check if identifier is equal
virtual std::string eval() const;
virtual void evalFile() const;
virtual void evalPar() const;
void initElems();
std::vector<int> calcShift() const; //detects empty indices in vector, when times are evaluated
void Hist() const; //calc Histogram
virtual void normHist() const; //calc normalized Histogram
void plotHist(double,std::string,int,int) const; //plot histogramm to terminal
void getRAMUsage() const;
virtual void start(int pos) const; //start measurement with custom string identifier
virtual void start(int pos,const std::string& identifier) const; //start measurement with custom string identifier
virtual void stop() const; //stop last started measurement
virtual void stop(const std::string& identifier) const; //stop last started measurement with check if identifier is equal
virtual std::string eval() const;
virtual void evalFile() const;
virtual void evalPar() const;
void initElems();
std::vector<int> calcShift() const; //detects empty indices in vector, when times are evaluated
void Hist() const; //calc Histogram
virtual void normHist() const; //calc normalized Histogram
void plotHist(double,const std::string&,int,int) const; //plot histogramm to terminal
void getRAMUsage() const;
};

View File

@ -77,14 +77,14 @@ public:
// Member Functions
void start(int pos) const {};
void start(int pos,std::string identifier) const {};
void stop() const {};
void stop(std::string identifier) const {};
std::string eval() const {return "";};
void evalFile() const {};
void evalPar() const {};
void normHist() const {};
void start(int pos) const {}
void start(int pos,const std::string& identifier) const {}
void stop() const {}
void stop(const std::string& identifier) const {}
std::string eval() const { return ""; }
void evalFile() const {}
void evalPar() const {}
void normHist() const {}
};