X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/12aae76fbeaa3dc91ab5ecad5531a2c1925340d2..8bfc0bdce2bf4f53ac2c072e7a44e9a7d3b3cca8:/projects/stargazer/store_loader.h diff --git a/projects/stargazer/store_loader.h b/projects/stargazer/store_loader.h index a9bb3a44..c187b540 100644 --- a/projects/stargazer/store_loader.h +++ b/projects/stargazer/store_loader.h @@ -18,45 +18,40 @@ * Author : Maxim Mamontov */ -/* - $Revision: 1.3 $ - $Date: 2010/03/04 12:24:19 $ - $Author: faust $ - */ +#pragma once -/* - * Header file for RAII store plugin loader - */ - -#ifndef __STORE_LOADER_H__ -#define __STORE_LOADER_H__ +#include "stg/module_settings.h" #include -#include "module_settings.h" -#include "noncopyable.h" +namespace STG +{ + +struct Store; +class SettingsImpl; + +class StoreLoader { + public: + explicit StoreLoader(const SettingsImpl& settings) noexcept; + ~StoreLoader(); -class STORE; -class SETTINGS_IMPL; + StoreLoader(const StoreLoader&) = delete; + StoreLoader& operator=(const StoreLoader&) = delete; -class STORE_LOADER : private NONCOPYABLE { -public: - STORE_LOADER(const SETTINGS_IMPL & settings); - ~STORE_LOADER(); + bool load() noexcept; + bool unload() noexcept; - bool Load(); - bool Unload(); + Store& get() noexcept { return *plugin; } - STORE * GetStore() { return plugin; } + const std::string& GetStrError() const noexcept { return errorStr; } - const std::string & GetStrError() const { return errorStr; } -private: - bool isLoaded; - void * handle; - STORE * plugin; - std::string errorStr; - MODULE_SETTINGS storeSettings; - std::string pluginFileName; + private: + bool isLoaded; + void* handle; + Store* plugin; + std::string errorStr; + ModuleSettings storeSettings; + std::string pluginFileName; }; -#endif +}