From f540560feb093143569f8a85eb5280d9c7504a0e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 7 Sep 2009 21:30:45 +0200 Subject: =?UTF-8?q?StorageManager=20&=20StorageBackendFile=20hinzugef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/StorageManager.h | 61 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/Common/StorageManager.h (limited to 'src/Common/StorageManager.h') diff --git a/src/Common/StorageManager.h b/src/Common/StorageManager.h new file mode 100644 index 0000000..c81c707 --- /dev/null +++ b/src/Common/StorageManager.h @@ -0,0 +1,61 @@ +/* + * StorageManager.h + * + * Copyright (C) 2009 Matthias Schiffer + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with this program. If not, see . + */ + +#ifndef MAD_COMMON_DATAMANAGER_H_ +#define MAD_COMMON_DATAMANAGER_H_ + +#include "export.h" + +#include "XmlData.h" + +#include + +#include +#include + +namespace Mad { +namespace Common { + +class Application; +class StorageBackend; + +class MAD_COMMON_EXPORT StorageManager { + private: + friend class Application; + + Application *application; + + boost::shared_ptr backend; + + boost::shared_mutex mutex; + + StorageManager(Application *application0) : application(application0) {} + + public: + void setBackend(boost::shared_ptr newBackend); + void unsetBackend(boost::shared_ptr oldBackend); + + void store(const std::string &type, const std::string &name, const XmlData *data) throw (Core::Exception); + boost::shared_ptr load(const std::string &type, const std::string &name) throw (Core::Exception); +}; + +} +} + +#endif /* MAD_COMMON_DATAMANAGER_H_ */ -- cgit v1.2.3