/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*/
class TestOptionsRegistry
{
- public:
- //! Returns the singleton instance of this class.
- static TestOptionsRegistry &getInstance()
- {
- static TestOptionsRegistry singleton;
- return singleton;
- }
+public:
+ //! Returns the singleton instance of this class.
+ static TestOptionsRegistry& getInstance()
+ {
+ static TestOptionsRegistry singleton;
+ return singleton;
+ }
- //! Adds a provider into the registry.
- void add(const char * /*name*/, TestOptionsProvider *provider)
- {
- lock_guard<Mutex> lock(listMutex_);
- providerList_.push_back(provider);
- }
+ //! Adds a provider into the registry.
+ void add(const char* /*name*/, TestOptionsProvider* provider)
+ {
+ lock_guard<Mutex> lock(listMutex_);
+ providerList_.push_back(provider);
+ }
- //! Initializes the options from all the provides.
- void initOptions(IOptionsContainer *options);
+ //! Initializes the options from all the provides.
+ void initOptions(IOptionsContainer* options);
- private:
- TestOptionsRegistry() {}
+private:
+ TestOptionsRegistry() {}
- typedef std::list<TestOptionsProvider *> ProviderList;
+ typedef std::list<TestOptionsProvider*> ProviderList;
- Mutex listMutex_;
- ProviderList providerList_;
+ Mutex listMutex_;
+ ProviderList providerList_;
- GMX_DISALLOW_COPY_AND_ASSIGN(TestOptionsRegistry);
+ GMX_DISALLOW_COPY_AND_ASSIGN(TestOptionsRegistry);
};
-void TestOptionsRegistry::initOptions(IOptionsContainer *options)
+void TestOptionsRegistry::initOptions(IOptionsContainer* options)
{
// TODO: Have some deterministic order for the options; now it depends on
// the order in which the global initializers are run.
- lock_guard<Mutex> lock(listMutex_);
- ProviderList::const_iterator i;
+ lock_guard<Mutex> lock(listMutex_);
+ ProviderList::const_iterator i;
for (i = providerList_.begin(); i != providerList_.end(); ++i)
{
(*i)->initOptions(options);
}
}
-} // namespace
+} // namespace
-void registerTestOptions(const char *name, TestOptionsProvider *provider)
+void registerTestOptions(const char* name, TestOptionsProvider* provider)
{
TestOptionsRegistry::getInstance().add(name, provider);
}
-void initTestOptions(IOptionsContainer *options)
+void initTestOptions(IOptionsContainer* options)
{
TestOptionsRegistry::getInstance().initOptions(options);
}