diff options
Diffstat (limited to 'project2/basics')
-rw-r--r-- | project2/basics/options/preload.cpp | 6 | ||||
-rw-r--r-- | project2/basics/options/showHelp.cpp | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/project2/basics/options/preload.cpp b/project2/basics/options/preload.cpp index 5cf42e8..4781abb 100644 --- a/project2/basics/options/preload.cpp +++ b/project2/basics/options/preload.cpp @@ -19,7 +19,7 @@ class Preload { static void LoadLibrary(const VariableType & librarypath) { - const auto beforeOpts = InstanceSet<Options>::GetAll(); + const auto beforeOpts = AdHoc::PluginManager::getDefault()->getAll<Options>(); void * handle = dlopen(librarypath, RTLD_GLOBAL | RTLD_NOW); if (handle) { @@ -32,10 +32,10 @@ class Preload { } libs[librarypath.as<std::string>()] = boost::shared_ptr<void>(handle, &dlclose); - const auto afterOpts = InstanceSet<Options>::GetAll(); + const auto afterOpts = AdHoc::PluginManager::getDefault()->getAll<Options>(); for (const auto & opt : afterOpts) { if (std::find(beforeOpts.begin(), beforeOpts.end(), opt) == beforeOpts.end()) { - opt->reset(); + opt->implementation()->reset(); } } } diff --git a/project2/basics/options/showHelp.cpp b/project2/basics/options/showHelp.cpp index 86dbc6f..b7f481c 100644 --- a/project2/basics/options/showHelp.cpp +++ b/project2/basics/options/showHelp.cpp @@ -8,7 +8,9 @@ void ShowHelpComponent::onConfigLoad() if (!showHelp) return; fprintf(stdout, "Help\n"); - InstanceSet<Options>::OnAll(boost::bind(&ShowHelpComponent::outputOptions, this, _1)); + for (auto opts : AdHoc::PluginManager::getDefault()->getAll<Options>()) { + outputOptions(opts->implementation()); + } exit(1); } |