diff options
author | chai <chaifix@163.com> | 2018-10-19 08:36:44 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-19 08:36:44 +0800 |
commit | 7d5f055547e70fa93ee9ac944e62f8d657b9dc55 (patch) | |
tree | 081782a1541854db4b8eb69c4b43081f52711286 /src/libjin/Common/je_object.h | |
parent | 02dd1f38008594048f0e28bad01e7c6d18844198 (diff) |
*修改文件名
Diffstat (limited to 'src/libjin/Common/je_object.h')
-rw-r--r-- | src/libjin/Common/je_object.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/libjin/Common/je_object.h b/src/libjin/Common/je_object.h new file mode 100644 index 0000000..c4bf225 --- /dev/null +++ b/src/libjin/Common/je_object.h @@ -0,0 +1,49 @@ +#ifndef __LIBJIN_COMMON_OBJECT_H +#define __LIBJIN_COMMON_OBJECT_H + +namespace jin +{ + + class Object + { + private: + + // The reference count. + int count; + + public: + + /** + * Constructor. Sets reference count to one. + **/ + Object(); + + /** + * Destructor. + **/ + virtual ~Object() = 0; + + /** + * Gets the reference count of this Object. + * @returns The reference count. + **/ + int getReferenceCount() const; + + /** + * Retains the Object, i.e. increases the + * reference count by one. + **/ + void retain(); + + /** + * Releases one reference to the Object, i.e. decrements the + * reference count by one, and potentially deletes the Object + * if there are no more references. + **/ + void release(); + + }; // Object + +} // namespace jin + +#endif
\ No newline at end of file |