Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

resource.h

Go to the documentation of this file.
00001 /*
00002         $Id: resource.h,v 1.4 2001/03/04 17:54:47 mbn Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00016 
00017 #ifndef header_resource
00018 #define header_resource
00019 
00020 #include <string>
00021 #include "../IOData/outputsource.h"
00022 
00023 class CL_Resource
00024 //: Interface representing a resource in the resource manager.
00025 // <p>All resources available in the resource manager is an instance
00026 // of this class. The purpose of the class is to load and unload the resource,
00027 // and if a datafile is being built, it is also used to save it.</p>
00028 // <p>The resource manager uses instances of CL_ResourceType to create
00029 // CL_Resource'es.</p>
00030 // <p>To get more information on how to use create your own version of this
00031 // class, please see the overview documentation.</p>
00032 {
00033 public:
00034         CL_Resource(std::string type, std::string name);
00035         virtual ~CL_Resource();
00036 
00037         virtual const std::string &get_type() const { return type; }
00038         virtual const std::string &get_name() const { return name; }
00039 
00040         virtual void load()=0;
00041         virtual void unload()=0;
00042         virtual int get_load_count()=0;
00043 
00044         virtual void serialize_save(CL_OutputSource *output)=0;
00045 
00046 private:
00047         std::string type;
00048         std::string name;
00049 };
00050 
00051 #endif

Generated at Wed Apr 4 19:54:02 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001