aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Common/Object.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-08-06 16:22:00 +0800
committerchai <chaifix@163.com>2018-08-06 16:22:00 +0800
commit89e7a9ecfad9a54633eb3ebbab1d1f13ad78826f (patch)
tree1ba8a806af1b8e7750d6b637c296f08e13cf268e /src/libjin/Common/Object.cpp
parentea9769944a2db3abe15f537dab67e16fdfc20bef (diff)
*update
Diffstat (limited to 'src/libjin/Common/Object.cpp')
-rw-r--r--src/libjin/Common/Object.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/libjin/Common/Object.cpp b/src/libjin/Common/Object.cpp
new file mode 100644
index 0000000..6c3b667
--- /dev/null
+++ b/src/libjin/Common/Object.cpp
@@ -0,0 +1,32 @@
+// LOVE
+#include "Object.h"
+
+namespace jin
+{
+
+ Object::Object()
+ : count(1)
+ {
+ }
+
+ Object::~Object()
+ {
+ }
+
+ int Object::getReferenceCount() const
+ {
+ return count;
+ }
+
+ void Object::retain()
+ {
+ ++count;
+ }
+
+ void Object::release()
+ {
+ if (--count <= 0)
+ delete this;
+ }
+
+} // love