• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KMIME Library

  • KMime
  • KAutoDeleteHash
Public Member Functions | List of all members
KMime::KAutoDeleteHash< Key, T > Class Template Reference

#include <kautodeletehash.h>

Inheritance diagram for KMime::KAutoDeleteHash< Key, T >:
Inheritance graph
[legend]

Public Member Functions

 KAutoDeleteHash ()
 
 KAutoDeleteHash (const QHash< Key, T * > &other)
 
 ~KAutoDeleteHash ()
 
- Public Member Functions inherited from QHash< Key, T * >
 QHash (const QHash< Key, T > &other)
 
iterator begin ()
 
const_iterator begin () const
 
int capacity () const
 
void clear ()
 
const_iterator constBegin () const
 
const_iterator constEnd () const
 
const_iterator constFind (const Key &key) const
 
bool contains (const Key &key) const
 
int count () const
 
int count (const Key &key) const
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
iterator erase (iterator pos)
 
const_iterator find (const Key &key) const
 
iterator find (const Key &key)
 
iterator insert (const Key &key, const T &value)
 
iterator insertMulti (const Key &key, const T &value)
 
bool isEmpty () const
 
const Key key (const T &value, const Key &defaultKey) const
 
const Key key (const T &value) const
 
QList< Key > keys () const
 
QList< Key > keys (const T &value) const
 
bool operator!= (const QHash< Key, T > &other) const
 
QHash< Key, T > & operator= (const QHash< Key, T > &other)
 
bool operator== (const QHash< Key, T > &other) const
 
T & operator[] (const Key &key)
 
const T operator[] (const Key &key) const
 
int remove (const Key &key)
 
void reserve (int size)
 
int size () const
 
void squeeze ()
 
void swap (QHash< Key, T > &other)
 
T take (const Key &key)
 
QList< Key > uniqueKeys () const
 
QHash< Key, T > & unite (const QHash< Key, T > &other)
 
const T value (const Key &key) const
 
const T value (const Key &key, const T &defaultValue) const
 
QList< T > values (const Key &key) const
 
QList< T > values () const
 

Additional Inherited Members

- Public Attributes inherited from QHash< Key, T * >
typedef ConstIterator
 
typedef difference_type
 
typedef Iterator
 
typedef key_type
 
typedef mapped_type
 
typedef size_type
 

Detailed Description

template<class Key, class T>
class KMime::KAutoDeleteHash< Key, T >

The KAutoDeleteHash class is a convenience QHash subclass that provides automatic deletion of the values in the destructor.

Apart from this KAutoDeleteHash behaves exactly like QHash<Key, T *>.

Since the automatic deletion is restricted to the destruction of the hash you have take care of the deletion of values you remove or replace yourself. To replace a value in the hash by another value use

delete hash.take( key );
hash.insert( key, value );

and to remove a value from the hash use

delete hash.take( key );
Author
Ingo Klöcker <kloec.nosp@m.ker@.nosp@m.kde.o.nosp@m.rg>

Definition at line 49 of file kautodeletehash.h.

Constructor & Destructor Documentation

template<class Key, class T>
KMime::KAutoDeleteHash< Key, T >::KAutoDeleteHash ( )
inline

Constructs an empty hash.

Definition at line 55 of file kautodeletehash.h.

template<class Key, class T>
KMime::KAutoDeleteHash< Key, T >::KAutoDeleteHash ( const QHash< Key, T * > &  other)
inline

Constructs a copy of other (which can be a QHash or a KAutoDeleteHash).

Definition at line 59 of file kautodeletehash.h.

template<class Key, class T>
KMime::KAutoDeleteHash< Key, T >::~KAutoDeleteHash ( )
inline

Destroys the hash and deletes all values.

References to the values in the hash and all iterators of this hash become invalid.

Definition at line 65 of file kautodeletehash.h.


The documentation for this class was generated from the following file:
  • kautodeletehash.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KMIME Library

Skip menu "KMIME Library"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal