summaryrefslogtreecommitdiffstats
path: root/api/logic/Usable.h
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/Usable.h')
-rw-r--r--api/logic/Usable.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/api/logic/Usable.h b/api/logic/Usable.h
index 1168be4d..83dd083d 100644
--- a/api/logic/Usable.h
+++ b/api/logic/Usable.h
@@ -12,27 +12,27 @@ class Usable;
*/
class Usable
{
- friend class UseLock;
+ friend class UseLock;
public:
- std::size_t useCount()
- {
- return m_useCount;
- }
- bool isInUse()
- {
- return m_useCount > 0;
- }
+ std::size_t useCount()
+ {
+ return m_useCount;
+ }
+ bool isInUse()
+ {
+ return m_useCount > 0;
+ }
protected:
- virtual void decrementUses()
- {
- m_useCount--;
- }
- virtual void incrementUses()
- {
- m_useCount++;
- }
+ virtual void decrementUses()
+ {
+ m_useCount--;
+ }
+ virtual void incrementUses()
+ {
+ m_useCount++;
+ }
private:
- std::size_t m_useCount = 0;
+ std::size_t m_useCount = 0;
};
/**
@@ -43,16 +43,16 @@ private:
class UseLock
{
public:
- UseLock(std::shared_ptr<Usable> usable)
- : m_usable(usable)
- {
- // this doesn't use shared pointer use count, because that wouldn't be correct. this count is separate.
- m_usable->incrementUses();
- }
- ~UseLock()
- {
- m_usable->decrementUses();
- }
+ UseLock(std::shared_ptr<Usable> usable)
+ : m_usable(usable)
+ {
+ // this doesn't use shared pointer use count, because that wouldn't be correct. this count is separate.
+ m_usable->incrementUses();
+ }
+ ~UseLock()
+ {
+ m_usable->decrementUses();
+ }
private:
- std::shared_ptr<Usable> m_usable;
+ std::shared_ptr<Usable> m_usable;
};