• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/bookmarks
 

tdeio/bookmarks

  • tdeio
  • bookmarks
dptrtemplate.h
1/* This file is part of the KDE project
2 Copyright (C) 2003 Alexander Kellett <lypanov@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __dptrtemplate_h__
21#define __dptrtemplate_h__
22
23#include <tqptrdict.h>
24
25template<class Instance, class PrivateData>
26class dPtrTemplate {
27public:
28 static PrivateData* d( const Instance* instance )
29 {
30 if ( !d_ptr ) {
31 cleanup_d_ptr();
32 d_ptr = new TQPtrDict<PrivateData>;
33 tqAddPostRoutine( cleanup_d_ptr );
34 }
35 PrivateData* ret = d_ptr->find( (void*) instance );
36 if ( ! ret ) {
37 ret = new PrivateData;
38 d_ptr->replace( (void*) instance, ret );
39 }
40 return ret;
41 }
42 static void delete_d( const Instance* instance )
43 {
44 if ( d_ptr )
45 d_ptr->remove( (void*) instance );
46 }
47private:
48 static void cleanup_d_ptr()
49 {
50 delete d_ptr;
51 }
52 static TQPtrDict<PrivateData>* d_ptr;
53};
54
55#endif

tdeio/bookmarks

Skip menu "tdeio/bookmarks"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/bookmarks

Skip menu "tdeio/bookmarks"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/bookmarks by doxygen 1.9.4
This website is maintained by Timothy Pearson.