gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/resource-manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'agg-plot/resource-manager.h')
-rw-r--r--agg-plot/resource-manager.h 29
1 files changed, 29 insertions, 0 deletions
diff --git a/agg-plot/resource-manager.h b/agg-plot/resource-manager.h
new file mode 100644
index 00000000..c59782a3
--- /dev/null
+++ b/agg-plot/resource-manager.h
@@ -0,0 +1,29 @@
+#ifndef AGGPLOT_RESOURCE_MANAGER_H
+#define AGGPLOT_RESOURCE_MANAGER_H
+
+
+class no_management {
+ public:
+ template <class T>
+ static void acquire(T* p) {};
+
+ template <class T>
+ static void dispose(T* p) {};
+};
+
+
+class ref_manager {
+public:
+ template <class T>
+ static void acquire(T* p) { p->ref(); };
+
+ template <class T>
+ static void dispose(T* p)
+ {
+ unsigned rc = p->unref();
+ if (rc == 0)
+ delete p;
+ };
+};
+
+#endif
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月17日 03:13:58 +0000

AltStyle によって変換されたページ (->オリジナル) /