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