MyGUI: MyGUI_IResource.h Source File

MyGUI 3.2.2

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
23 class MYGUI_EXPORT IResource :
24 public ISerializable
25 {
26 // для серелизации и удаления
27 friend class ResourceManager;
28
29 MYGUI_RTTI_DERIVED( IResource )
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_
MyGUI_XmlDocument.h
MyGUI_Version.h
MyGUI::IResourcePtr
IResource * IResourcePtr
Definition: MyGUI_IResource.h:18
MyGUI::ISerializable
Definition: MyGUI_ISerializable.h:18
MyGUI::ResourceManager
Definition: MyGUI_ResourceManager.h:21
MyGUI_ISerializable.h
MyGUI::xml::Element
Definition: MyGUI_XmlDocument.h:158
MyGUI::xml::Element::findAttribute
bool findAttribute(const std::string &_name, std::string &_value)
Definition: MyGUI_XmlDocument.cpp:246
MyGUI::IResource::getResourceName
const std::string & getResourceName() const
Definition: MyGUI_IResource.h:32
MyGUI::Version
Definition: MyGUI_Version.h:17
MyGUI::IResource::setResourceName
void setResourceName(const std::string &_value)
Definition: MyGUI_IResource.h:37
MyGUI_Prerequest.h
MyGUI::IResource::mResourceName
std::string mResourceName
Definition: MyGUI_IResource.h:57
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:65
MyGUI::IResource::~IResource
virtual ~IResource()
Definition: MyGUI_IResource.h:49
MyGUI::IResource::IResource
IResource()
Definition: MyGUI_IResource.h:48
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:103
MyGUI::IResource::deserialization
virtual void deserialization(xml::ElementPtr _node, Version _version)
Definition: MyGUI_IResource.h:51
MyGUI::IResource
Definition: MyGUI_IResource.h:23
MyGUI
Definition: MyGUI_ActionController.h:14