]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/src/TObject.hh
Initial revision
[helm.git] / helm / DEVEL / mathml_editor / src / TObject.hh
diff --git a/helm/DEVEL/mathml_editor/src/TObject.hh b/helm/DEVEL/mathml_editor/src/TObject.hh
new file mode 100644 (file)
index 0000000..c4b4e9e
--- /dev/null
@@ -0,0 +1,16 @@
+
+#ifndef __TObject_hh__
+#define __TObject_hh__
+
+class TObject
+{
+protected:
+  TObject(void) { refCounter = 1; };
+  virtual ~TObject() { };
+
+public:
+  void ref(coid) const { refCounter++; };
+  void unref(void) const { if (--refCounter) delete this; };
+};
+
+#endif // __TObject_hh__