From 02da1f586ef7945fef385e6d4743ef53441bc2fa Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Sun, 23 May 2004 20:52:00 +0000 Subject: - eConnections holds reference to object - use eAutoInitPtr instead of eAutoInitP for iObject-based stuff - fix some ref initialization - added service stop --- lib/base/init.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'lib/base/init.h') 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 #include +#include class eAutoInit; @@ -94,4 +95,35 @@ public: } }; +template class +eAutoInitPtr: protected eAutoInit +{ + ePtr 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 -- cgit v1.2.3