MyGUI_IResource.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_I_RESOURCE_H_
#define MYGUI_I_RESOURCE_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_XmlDocument.h"
#include "MyGUI_Version.h"
#include "MyGUI_ISerializable.h"
namespace MyGUI
{
class IResource;
using IResourcePtr = IResource*;
class ResourceManager;
class MYGUI_EXPORT IResource : public ISerializable
{
// для серелизации и удаления
friend class ResourceManager;
MYGUI_RTTI_DERIVED(IResource)
public:
const std::string& getResourceName() const
{
return mResourceName;
}
void setResourceName(std::string_view _value)
{
mResourceName = _value;
}
IResource(IResource const&) = delete;
IResource& operator=(IResource const&) = delete;
protected:
IResource() = default;
~IResource() override = default;
void deserialization(xml::ElementPtr _node, Version /*_version*/) override
{
_node->findAttribute("name", mResourceName);
}
protected:
std::string mResourceName;
};
} // namespace MyGUI
#endif // MYGUI_I_RESOURCE_H_
MyGUI_ISerializable.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:69
MyGUI_Version.h
MyGUI_XmlDocument.h
MyGUI::IResource
Definition MyGUI_IResource.h:24
MyGUI::IResource::deserialization
void deserialization(xml::ElementPtr _node, Version) override
Definition MyGUI_IResource.h:48
MyGUI::IResource::IResource
IResource(IResource const &)=delete
MyGUI::IResource::getResourceName
const std::string & getResourceName() const
Definition MyGUI_IResource.h:31
MyGUI::IResource::mResourceName
std::string mResourceName
Definition MyGUI_IResource.h:54
MyGUI::IResource::ResourceManager
friend class ResourceManager
Definition MyGUI_IResource.h:26
MyGUI::IResource::operator=
IResource & operator=(IResource const &)=delete
MyGUI::IResource::IResource
IResource()=default
MyGUI::IResource::~IResource
~IResource() override=default
MyGUI::IResource::setResourceName
void setResourceName(std::string_view _value)
Definition MyGUI_IResource.h:36
MyGUI::ISerializable
Definition MyGUI_ISerializable.h:19
MyGUI::ResourceManager
Definition MyGUI_ResourceManager.h:23
MyGUI::Version
Definition MyGUI_Version.h:18
MyGUI::xml::Element::findAttribute
bool findAttribute(std::string_view _name, std::string &_value)
Definition MyGUI_XmlDocument.cpp:242
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition MyGUI_XmlDocument.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::IResourcePtr
IResource * IResourcePtr
Definition MyGUI_IResource.h:19