MyGUI 3.4.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
15namespace MyGUI
16{
17
18 class IResource;
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 protected:
43 IResource() = default;
44 ~IResource() override = default;
45 IResource(IResource const&) = delete;
46 IResource& operator = (IResource const&) = delete;
47
48 void deserialization(xml::ElementPtr _node, Version _version) override
49 {
50 _node->findAttribute("name", mResourceName);
51 }
52
53 protected:
54 std::string mResourceName;
55 };
56
57} // namespace MyGUI
58
59#endif // MYGUI_I_RESOURCE_H_
#define MYGUI_EXPORT
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:48
IResource(IResource const &)=delete
const std::string & getResourceName() const
std::string mResourceName
void setResourceName(const std::string &_value)
void deserialization(xml::ElementPtr _node, Version _version) override
IResource()=default
~IResource() override=default
bool findAttribute(const std::string &_name, std::string &_value)