20 #ifndef __dptrtemplate_h__
21 #define __dptrtemplate_h__
23 #include <tqptrdict.h>
25 template<
class Instance,
class PrivateData>
28 static PrivateData* d(
const Instance* instance )
32 d_ptr =
new TQPtrDict<PrivateData>;
33 tqAddPostRoutine( cleanup_d_ptr );
35 PrivateData* ret = d_ptr->find( (
void*) instance );
37 ret =
new PrivateData;
38 d_ptr->replace( (
void*) instance, ret );
42 static void delete_d(
const Instance* instance )
45 d_ptr->remove( (
void*) instance );
48 static void cleanup_d_ptr()
52 static TQPtrDict<PrivateData>* d_ptr;