//  // // # # ### # # -= Nuclex Library =-  // // ## # # # ## ## ResourceSet.h - A set of resources  // // ### # # ###  // // # ### # ### A set of resources loaded from a serialized resource list  // // # ## # # ## ##  // // # # ### # # R1 (C)2002-2004 Markus Ewald -> License.txt  // //  // #ifndef NUCLEX_STORAGE_RESOURCESET_H #define NUCLEX_STORAGE_RESOURCESET_H #include "Nuclex/Nuclex.h" #include "Nuclex/Storage/Persistable.h" #include namespace Nuclex { namespace Storage { class StorageServer; class Archive; } namespace Video { class VideoServer; class Image; } namespace Text { class TextServer; class Font; } } namespace Nuclex { namespace Storage { //  // //  Nuclex::Storage::ResourceSet  // //  // /// Structured serializer base class /** Base class for structured data serializers */ class ResourceSet : public Persistable { public: /// Constructor NUCLEX_API ResourceSet( const string &sName, const shared_ptr &spStorageServer, const shared_ptr &spVideoServer, const shared_ptr &spTextServer ); /// Destructor /** Destroys an instance of Serializer */ NUCLEX_API virtual ~ResourceSet(); // // ResourceSet implementation // public: /// Add archive to pool NUCLEX_API void addArchive(const string &sName, const string &sSource); /// Add bitmap to pool NUCLEX_API void addImage(const string &sName, const string &sSource); /// Add font to pool NUCLEX_API void addFont(const string &sName, const string &sSource); /// Remove archive from pool NUCLEX_API void removeArchive(const string &sName); /// Remove bitmap from pool NUCLEX_API void removeImage(const string &sName); /// Remove font from pool NUCLEX_API void removeFont(const string &sName); /// Get pooled archive NUCLEX_API const shared_ptr &getArchive(const string &sName) const; /// Get pooled bitmap NUCLEX_API const shared_ptr &getImage(const string &sName) const; /// Get pooled font NUCLEX_API const shared_ptr &getFont(const string &sName) const; // // Persistable implementation // public: /// Load object from serializer NUCLEX_API void load(const shared_ptr &spSerializer); /// Save object to serializer NUCLEX_API void save(const shared_ptr &spSerializer) const; private: typedef std::deque > StringPairDeque; ResourceSet(const ResourceSet &); virtual void operator =(const ResourceSet &) { throw -1; } string m_sName; StringPairDeque m_Archives; StringPairDeque m_Images; StringPairDeque m_Fonts; shared_ptr m_spStorageServer; ///< The storage server shared_ptr m_spVideoServer; ///< The image server shared_ptr m_spTextServer; ///< The text server }; }} // namespace Nuclex::Storage #endif // NUCLEX_STORAGE_RESOURCESET_H