aboutsummaryrefslogtreecommitdiff
path: root/src/lua/common/Reference.hpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-08-18 22:15:27 +0800
committerchai <chaifix@163.com>2018-08-18 22:15:27 +0800
commit22bb9b537caff927ef8c83bde82d58253ffbb1e4 (patch)
treef5328481574fd65d3f8a8b444ef26f34eab2d701 /src/lua/common/Reference.hpp
parent398966630f99329021d4335d819326e27a9d49df (diff)
*update
Diffstat (limited to 'src/lua/common/Reference.hpp')
-rw-r--r--src/lua/common/Reference.hpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/lua/common/Reference.hpp b/src/lua/common/Reference.hpp
index 7647a3f..feb96bb 100644
--- a/src/lua/common/Reference.hpp
+++ b/src/lua/common/Reference.hpp
@@ -6,7 +6,7 @@ namespace jin
namespace lua
{
- /*abstract*/class Reference
+ /*abstract*/class RefBase
{
public:
void retain()
@@ -20,29 +20,34 @@ namespace lua
delete this;
}
+ // object type string
+ const char* const type;
+
protected:
- Reference(void* obj)
+ RefBase(void* obj, const char* t)
: count(1)
, object(obj)
+ , type(t)
{
}
- Reference(const Reference&);
- virtual ~Reference()
+ RefBase(const RefBase&);
+
+ virtual ~RefBase()
{
}
void* object;
- int count;
+ int count;
};
template<class T>
- class Ref : public Reference
+ class Ref : public RefBase
{
public:
- Ref(T* obj)
- : Reference(obj)
+ Ref(T* obj, const char* type)
+ : RefBase(obj, type)
{
}