MyGUI  3.2.1
MyGUI_IResource.h
Go to the documentation of this file.
1 /*
2  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3  * Distributed under the MIT License
4  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5  */
6 
7 #ifndef __MYGUI_I_RESOURCE_H__
8 #define __MYGUI_I_RESOURCE_H__
9 
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_XmlDocument.h"
12 #include "MyGUI_Version.h"
13 #include "MyGUI_ISerializable.h"
14 
15 namespace MyGUI
16 {
17 
18  class IResource;
19  typedef IResource* IResourcePtr;
20 
21  class ResourceManager;
22 
24  public ISerializable
25  {
26  // для серелизации и удаления
27  friend class ResourceManager;
28 
30 
31  public:
32  const std::string& getResourceName() const
33  {
34  return mResourceName;
35  }
36 
37  void setResourceName(const std::string& _value)
38  {
39  mResourceName = _value;
40  }
41 
42  private:
43  // constructors and operator =, without implementation, just for private
44  IResource(IResource const&);
45  IResource& operator = (IResource const&);
46 
47  protected:
48  IResource() { }
49  virtual ~IResource() { }
50 
51  virtual void deserialization(xml::ElementPtr _node, Version _version)
52  {
53  _node->findAttribute("name", mResourceName);
54  }
55 
56  protected:
57  std::string mResourceName;
58  };
59 
60 } // namespace MyGUI
61 
62 #endif // __MYGUI_I_RESOURCE_H__