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

tdeio/bookmarks

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