Commit d5213882 authored by Peter Eastman's avatar Peter Eastman
Browse files

Minor API change to fix problem in wrapper generation

parent 133b80e1
......@@ -233,7 +233,7 @@ public:
* @param index the index of the variable to get
* @return the name of the variable
*/
std::string getGlobalVariableName(int index) const;
const std::string& getGlobalVariableName(int index) const;
/**
* Define a new per-DOF variable.
*
......@@ -249,7 +249,7 @@ public:
* @param index the index of the variable to get
* @return the name of the variable
*/
std::string getPerDofVariableName(int index) const;
const std::string& getPerDofVariableName(int index) const;
/**
* Get the current value of a global variable.
*
......
......@@ -84,7 +84,7 @@ int CustomIntegrator::addGlobalVariable(const string& name, double initialValue)
return globalNames.size()-1;
}
string CustomIntegrator::getGlobalVariableName(int index) const {
const string& CustomIntegrator::getGlobalVariableName(int index) const {
if (index < 0 || index >= globalNames.size())
throw OpenMMException("Index out of range");
return globalNames[index];
......@@ -98,7 +98,7 @@ int CustomIntegrator::addPerDofVariable(const string& name, double initialValue)
return perDofNames.size()-1;
}
string CustomIntegrator::getPerDofVariableName(int index) const {
const string& CustomIntegrator::getPerDofVariableName(int index) const {
if (index < 0 || index >= perDofNames.size())
throw OpenMMException("Index out of range");
return perDofNames[index];
......
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