X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d8845c7819caac09b95c4cdf1e8d48cc1cb1b7a6..1cb912e4f90473f78d2f0f10ab5c9b2c5bd36440:/projects/stargazer/store_loader.h diff --git a/projects/stargazer/store_loader.h b/projects/stargazer/store_loader.h index b38a46ee..c187b540 100644 --- a/projects/stargazer/store_loader.h +++ b/projects/stargazer/store_loader.h @@ -18,49 +18,40 @@ * Author : Maxim Mamontov */ -/* - $Revision: 1.3 $ - $Date: 2010/03/04 12:24:19 $ - $Author: faust $ - */ - -/* - * Header file for RAII store plugin loader - */ - -#ifndef __STORE_LOADER_H__ -#define __STORE_LOADER_H__ +#pragma once #include "stg/module_settings.h" -#include "stg/noncopyable.h" #include -class STORE; -class SETTINGS_IMPL; +namespace STG +{ + +struct Store; +class SettingsImpl; -class STORE_LOADER : private NONCOPYABLE { -public: - explicit STORE_LOADER(const SETTINGS_IMPL & settings); - ~STORE_LOADER(); +class StoreLoader { + public: + explicit StoreLoader(const SettingsImpl& settings) noexcept; + ~StoreLoader(); - bool Load(); - bool Unload(); + StoreLoader(const StoreLoader&) = delete; + StoreLoader& operator=(const StoreLoader&) = delete; - STORE & GetStore() { return *plugin; } + bool load() noexcept; + bool unload() noexcept; - const std::string & GetStrError() const { return errorStr; } + Store& get() noexcept { return *plugin; } -private: - STORE_LOADER(const STORE_LOADER & rvalue); - STORE_LOADER & operator=(const STORE_LOADER & rvalue); + const std::string& GetStrError() const noexcept { return errorStr; } - 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 +}