aboutsummaryrefslogtreecommitdiff
path: root/lib/base/init.h
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2004-05-23 20:52:00 +0000
committerFelix Domke <tmbinc@elitedvb.net>2004-05-23 20:52:00 +0000
commit02da1f586ef7945fef385e6d4743ef53441bc2fa (patch)
tree2786f3cf5d5d5a76f71dfcd3f5287435a36b9632 /lib/base/init.h
parentf7bcb76bda4da5d8a830181b4a8335d3de67f333 (diff)
downloadenigma2-02da1f586ef7945fef385e6d4743ef53441bc2fa.tar.gz
enigma2-02da1f586ef7945fef385e6d4743ef53441bc2fa.zip
- eConnections holds reference to object
- use eAutoInitPtr instead of eAutoInitP for iObject-based stuff - fix some ref initialization - added service stop
Diffstat (limited to 'lib/base/init.h')
-rw-r--r--lib/base/init.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/base/init.h b/lib/base/init.h
index 465bac40..6ffd04c7 100644
--- a/lib/base/init.h
+++ b/lib/base/init.h
@@ -3,6 +3,7 @@
#include <list>
#include <utility>
+#include <lib/base/object.h>
class eAutoInit;
@@ -94,4 +95,35 @@ public:
}
};
+template<class T1> class
+eAutoInitPtr: protected eAutoInit
+{
+ ePtr<T1> t;
+ void initNow()
+ {
+ t = new T1();
+ }
+ void closeNow()
+ {
+ t = 0;
+ }
+public:
+ operator T1*()
+ {
+ return t;
+ }
+ T1 *operator->()
+ {
+ return t;
+ }
+ eAutoInitPtr(int runl, char *description): eAutoInit(runl, description)
+ {
+ eInit::add(rl, this);
+ }
+ ~eAutoInitPtr()
+ {
+ eInit::remove(rl, this);
+ }
+};
+
#endif