ManaPlus
src
resources
resource.h
Go to the documentation of this file.
1
/*
2
* The ManaPlus Client
3
* Copyright (C) 2004-2009 The Mana World Development Team
4
* Copyright (C) 2009-2010 The Mana Developers
5
* Copyright (C) 2011-2019 The ManaPlus Developers
6
* Copyright (C) 2019-2021 Andrei Karas
7
*
8
* This file is part of The ManaPlus Client.
9
*
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
19
*
20
* You should have received a copy of the GNU General Public License
21
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
*/
23
24
#ifndef RESOURCES_RESOURCE_H
25
#define RESOURCES_RESOURCE_H
26
27
#include "
resources/memorycounter.h
"
28
29
#include "
localconsts.h
"
30
34
class
Resource
notfinal
:
public
MemoryCounter
35
{
36
public
:
40
Resource
() :
41
MemoryCounter
(),
42
mTimeStamp
(0),
43
mIdPath
(),
44
mSource
(),
45
mRefCount
(0),
46
mProtected
(false),
47
#ifdef DEBUG_DUMP_LEAKS
48
mNotCount
(false),
49
mDumped(false)
50
#else
// DEBUG_DUMP_LEAKS
51
mNotCount
(false)
52
#endif
// DEBUG_DUMP_LEAKS
53
{
54
}
55
56
A_DELETE_COPY
(
Resource
)
57
58
61
~Resource
()
override
;
62
66
virtual
void
incRef
();
67
75
virtual
void
decRef
();
76
77
int
calcMemoryLocal
()
const override
;
78
79
std::string
getCounterName
()
const override
80
{
return
mIdPath
+
"-"
+
mSource
; }
81
82
time_t
mTimeStamp
;
84
std::string
mIdPath
;
85
std::string
mSource
;
86
87
unsigned
int
mRefCount
;
88
bool
mProtected
;
89
bool
mNotCount
;
90
91
#ifdef DEBUG_DUMP_LEAKS
92
bool
mDumped;
93
#endif
// DEBUG_DUMP_LEAKS
94
};
95
96
#endif
// RESOURCES_RESOURCE_H
MemoryCounter
Definition:
memorycounter.h:30
Resource
Definition:
resource.h:35
Resource::~Resource
~Resource()
Definition:
resource.cpp:34
Resource::mProtected
bool mProtected
Definition:
resource.h:88
Resource::mIdPath
std::string mIdPath
Definition:
resource.h:84
Resource::incRef
virtual void incRef()
Definition:
resource.cpp:38
Resource::Resource
Resource()
Definition:
resource.h:40
Resource::decRef
virtual void decRef()
Definition:
resource.cpp:50
Resource::mSource
std::string mSource
Definition:
resource.h:85
Resource::mRefCount
unsigned int mRefCount
Definition:
resource.h:87
Resource::mTimeStamp
time_t mTimeStamp
Definition:
resource.h:82
Resource::getCounterName
std::string getCounterName() const
Definition:
resource.h:79
Resource::calcMemoryLocal
int calcMemoryLocal() const
Definition:
resource.cpp:76
Resource::mNotCount
bool mNotCount
Definition:
resource.h:89
localconsts.h
notfinal
#define notfinal
Definition:
localconsts.h:261
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition:
localconsts.h:53
memorycounter.h
Generated on Wed Mar 17 2021 19:19:10 for ManaPlus by
1.9.1