summaryrefslogtreecommitdiff
path: root/src/resources/resource.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-07 02:48:12 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-08 16:46:28 +0300
commit27a2dd4fce2d529cd1d96aa5ddce1e74b4f54a2f (patch)
treec2c38e1b4f308ca885dc3c3581560cfbc6833a8e /src/resources/resource.h
parentd4e28aa97cbce34a0053d3c02cf070ef9065439f (diff)
downloadplus-27a2dd4fce2d529cd1d96aa5ddce1e74b4f54a2f.tar.gz
plus-27a2dd4fce2d529cd1d96aa5ddce1e74b4f54a2f.tar.bz2
plus-27a2dd4fce2d529cd1d96aa5ddce1e74b4f54a2f.tar.xz
plus-27a2dd4fce2d529cd1d96aa5ddce1e74b4f54a2f.zip
Move resourcemanager from class to namespace.
Diffstat (limited to 'src/resources/resource.h')
-rw-r--r--src/resources/resource.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/resources/resource.h b/src/resources/resource.h
index e9f7e0531..4b2f57229 100644
--- a/src/resources/resource.h
+++ b/src/resources/resource.h
@@ -32,17 +32,15 @@
*/
class Resource notfinal : public MemoryCounter
{
- friend class ResourceManager;
-
public:
/**
* Constructor
*/
Resource() :
MemoryCounter(),
+ mTimeStamp(0),
mIdPath(),
mSource(),
- mTimeStamp(0),
mRefCount(0),
mProtected(false),
#ifdef DEBUG_DUMP_LEAKS
@@ -57,6 +55,11 @@ class Resource notfinal : public MemoryCounter
A_DELETE_COPY(Resource)
/**
+ * Destructor.
+ */
+ virtual ~Resource();
+
+ /**
* Increments the internal reference count.
*/
virtual void incRef();
@@ -76,6 +79,9 @@ class Resource notfinal : public MemoryCounter
const std::string &getIdPath() const noexcept2 A_WARN_UNUSED
{ return mIdPath; }
+ void setIdPath(const std::string &path)
+ { mIdPath = path; }
+
/**
* Return refCount for this resource.
*/
@@ -110,19 +116,15 @@ class Resource notfinal : public MemoryCounter
{ mDumped = n; }
#endif // DEBUG_DUMP_LEAKS
+ time_t mTimeStamp; /**< Time at which the resource was orphaned. */
+
#ifndef UNITTESTS
protected:
#endif // UNITTESTS
- /**
- * Destructor.
- */
- virtual ~Resource();
-
std::string mIdPath; /**< Path identifying this resource. */
std::string mSource;
private:
- time_t mTimeStamp; /**< Time at which the resource was orphaned. */
unsigned int mRefCount; /**< Reference count. */
bool mProtected;
bool mNotCount;