"platforms/reference/vscode:/vscode.git/clone" did not exist on "c741523e76a7db6f639236b06a10bebecd1f7eca"
Commit bf2a390b authored by Peter Eastman's avatar Peter Eastman
Browse files

Minor API changes

parent de099a02
...@@ -120,7 +120,7 @@ public: ...@@ -120,7 +120,7 @@ public:
* @return true if this Platform provides implementations of all the kernels in the list, * @return true if this Platform provides implementations of all the kernels in the list,
* false if there are any which it does not support * false if there are any which it does not support
*/ */
bool supportsKernels(std::vector<std::string> kernelNames) const ; bool supportsKernels(const std::vector<std::string>& kernelNames) const ;
/** /**
* Create a Kernel object. If you call this method multiple times for different contexts with the same name, * Create a Kernel object. If you call this method multiple times for different contexts with the same name,
* the returned Kernels are independent and do not interact with each other. This means * the returned Kernels are independent and do not interact with each other. This means
...@@ -167,7 +167,7 @@ public: ...@@ -167,7 +167,7 @@ public:
* @return the fastest registered Platform which supports all of the requested kernels. If no * @return the fastest registered Platform which supports all of the requested kernels. If no
* Platform exists which supports all of them, this will throw an exception. * Platform exists which supports all of them, this will throw an exception.
*/ */
static Platform& findPlatform(std::vector<std::string> kernelNames); static Platform& findPlatform(const std::vector<std::string>& kernelNames);
/** /**
* Load a dynamic library (DLL) which contains an OpenMM plugin. Typically, each Platform * Load a dynamic library (DLL) which contains an OpenMM plugin. Typically, each Platform
* is distributed as a separate dynamic library. This method can then be called at runtime * is distributed as a separate dynamic library. This method can then be called at runtime
...@@ -198,7 +198,7 @@ public: ...@@ -198,7 +198,7 @@ public:
* *
* @return the path to the default plugin directory * @return the path to the default plugin directory
*/ */
static std::string getDefaultPluginsDirectory(); static const std::string& getDefaultPluginsDirectory();
private: private:
// Retarded visual studio compiler complains about being unable to // Retarded visual studio compiler complains about being unable to
......
...@@ -88,7 +88,7 @@ void Platform::registerStreamFactory(string name, StreamFactory* factory) { ...@@ -88,7 +88,7 @@ void Platform::registerStreamFactory(string name, StreamFactory* factory) {
streamFactories[name] = factory; streamFactories[name] = factory;
} }
bool Platform::supportsKernels(vector<string> kernelNames) const { bool Platform::supportsKernels(const vector<string>& kernelNames) const {
for (int i = 0; i < (int) kernelNames.size(); ++i) for (int i = 0; i < (int) kernelNames.size(); ++i)
if (kernelFactories.find(kernelNames[i]) == kernelFactories.end()) if (kernelFactories.find(kernelNames[i]) == kernelFactories.end())
return false; return false;
...@@ -124,7 +124,7 @@ Platform& Platform::getPlatform(int index) { ...@@ -124,7 +124,7 @@ Platform& Platform::getPlatform(int index) {
return *getPlatforms()[index]; return *getPlatforms()[index];
} }
Platform& Platform::findPlatform(vector<string> kernelNames) { Platform& Platform::findPlatform(const vector<string>& kernelNames) {
Platform* best = 0; Platform* best = 0;
vector<Platform*>& platforms = getPlatforms(); vector<Platform*>& platforms = getPlatforms();
double speed = 0.0; double speed = 0.0;
...@@ -197,7 +197,7 @@ vector<string> Platform::loadPluginsFromDirectory(string directory) { ...@@ -197,7 +197,7 @@ vector<string> Platform::loadPluginsFromDirectory(string directory) {
return loadedLibraries; return loadedLibraries;
} }
string Platform::getDefaultPluginsDirectory() { const string& Platform::getDefaultPluginsDirectory() {
char* dir = getenv("OPENMM_PLUGIN_DIR"); char* dir = getenv("OPENMM_PLUGIN_DIR");
#ifdef _MSC_VER #ifdef _MSC_VER
if (dir != NULL) if (dir != NULL)
...@@ -207,8 +207,10 @@ string Platform::getDefaultPluginsDirectory() { ...@@ -207,8 +207,10 @@ string Platform::getDefaultPluginsDirectory() {
return "C:\\\\Program Files\\OpenMM\\lib\\plugins"; return "C:\\\\Program Files\\OpenMM\\lib\\plugins";
return string(dir)+"\\OpenMM\\lib\\plugins"; return string(dir)+"\\OpenMM\\lib\\plugins";
#else #else
static string directory;
if (dir == NULL) if (dir == NULL)
return "/usr/local/openmm/lib/plugins"; directory = "/usr/local/openmm/lib/plugins";
return string(dir); directory = string(dir);
return directory;
#endif #endif
} }
...@@ -48,14 +48,16 @@ public: ...@@ -48,14 +48,16 @@ public:
* This is the name of the parameter which stores the current temperature of the * This is the name of the parameter which stores the current temperature of the
* heat bath (in Kelvin). * heat bath (in Kelvin).
*/ */
static std::string Temperature() { static const std::string& Temperature() {
return "AndersenTemperature"; static const std::string key = "AndersenTemperature";
return key;
} }
/** /**
* This is the name of the parameter which store the current collision frequency (in 1/ps). * This is the name of the parameter which store the current collision frequency (in 1/ps).
*/ */
static std::string CollisionFrequency() { static const std::string& CollisionFrequency() {
return "AndersenCollisionFrequency"; static const std::string key = "AndersenCollisionFrequency";
return key;
} }
/** /**
* Create an AndersenThermostat. * Create an AndersenThermostat.
......
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