00001 // ///////////////////////////////////////////////////////////////////////////// 00002 // 00003 // Name: AssetProcessor.h 00004 // Author: Michael Bartsch (ZCCdark203) 00005 // 00006 // Desc : Declaration of the AssetProcessor class. 00007 // 00008 // License: Copyright (C) 2009 Michael Bartsch and Contributors 00009 // 00010 // This program is free software: you can redistribute it 00011 // and/or modify it under the terms of the zlib/libpng License. 00012 // See main.cpp for conditions of distribution and use. 00013 // 00014 // ///////////////////////////////////////////////////////////////////////////// 00015 00016 #ifndef __ASSETPROCESSOR_H__ 00017 #define __ASSETPROCESSOR_H__ 00018 00019 // Include files 00020 #include "../dependencies.h" 00021 #include "ReferenceCounted.h" 00022 #include "AssetGroup.h" 00023 00024 // Forward declarations 00025 class AssetGroup; 00026 00027 00028 // AssetProcessor class 00032 class AssetProcessor : public ReferenceCounted 00033 { 00034 friend class AssetGroup; 00035 00036 public: 00037 00038 // Initialisation and deinitialisation 00040 AssetProcessor(AssetGroup *parent, const std::string &baseName); 00042 ~AssetProcessor(); 00043 00044 // Public methods 00046 const std::string& getBaseName() const; 00048 AssetGroup* getParent() const; 00049 00053 virtual bool reloadAsset(const std::string &fileName); 00055 virtual void reloadAssets(); 00056 00060 virtual bool removeAsset(const std::string &fileName); 00062 virtual void removeAssets(); 00063 00064 protected: 00065 00066 // Protected methods 00070 virtual bool loadAsset(const std::string &fileName); 00072 virtual void loadAssets(); 00073 00074 // Protected members 00076 AssetGroup *pParent; 00078 std::string mBaseName; 00079 }; 00080 00081 #endif