A Resource reference with a controlled lifetime. More...
#include <entitylib.h>
Public Member Functions | |
ResourceReference (const std::string &name) | |
ResourceReference (const ResourceReference &other) | |
ResourceReference & | operator= (const ResourceReference &other) |
~ResourceReference () | |
void | capture () |
const std::string & | getName () const |
void | setName (const std::string &name) |
void | swap (ResourceReference &other) |
void | attach (ModuleObserver &observer) |
void | detach (ModuleObserver &observer) |
Resource * | get () |
Private Attributes | |
std::string | m_name |
Resource * | m_resource |
A Resource reference with a controlled lifetime.
The resource is released when the ResourceReference is destroyed.
Definition at line 658 of file entitylib.h.
ResourceReference::ResourceReference | ( | const std::string & | name | ) | [inline] |
Definition at line 663 of file entitylib.h.
References capture().
ResourceReference::ResourceReference | ( | const ResourceReference & | other | ) | [inline] |
Definition at line 668 of file entitylib.h.
References capture().
ResourceReference::~ResourceReference | ( | ) | [inline] |
Definition at line 679 of file entitylib.h.
References GlobalReferenceCache(), m_name, and ReferenceCache::release().
void ResourceReference::attach | ( | ModuleObserver & | observer | ) | [inline] |
Definition at line 705 of file entitylib.h.
References Resource::attach(), and m_resource.
Referenced by EModel::EModel(), and EModel::modelChanged().
void ResourceReference::capture | ( | ) | [inline] |
Definition at line 684 of file entitylib.h.
References ReferenceCache::capture(), GlobalReferenceCache(), m_name, and m_resource.
Referenced by ResourceReference().
void ResourceReference::detach | ( | ModuleObserver & | observer | ) | [inline] |
Definition at line 709 of file entitylib.h.
References Resource::detach(), and m_resource.
Referenced by EModel::modelChanged(), and EModel::~EModel().
Resource* ResourceReference::get | ( | ) | [inline] |
const std::string& ResourceReference::getName | ( | ) | const [inline] |
ResourceReference& ResourceReference::operator= | ( | const ResourceReference & | other | ) | [inline] |
Definition at line 673 of file entitylib.h.
References swap().
void ResourceReference::setName | ( | const std::string & | name | ) | [inline] |
Definition at line 693 of file entitylib.h.
References swap().
Referenced by EModel::modelChanged().
void ResourceReference::swap | ( | ResourceReference & | other | ) | [inline] |
Definition at line 699 of file entitylib.h.
References m_name, and m_resource.
Referenced by operator=(), and setName().
std::string ResourceReference::m_name [private] |
Definition at line 660 of file entitylib.h.
Referenced by capture(), getName(), swap(), and ~ResourceReference().
Resource* ResourceReference::m_resource [private] |