Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

tmap.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2003 by Scott Wheeler
00003     email                : wheeler@kde.org
00004  ***************************************************************************/
00005 
00006 /***************************************************************************
00007  *   This library is free software; you can redistribute it and/or modify  *
00008  *   it  under the terms of the GNU Lesser General Public License version  *
00009  *   2.1 as published by the Free Software Foundation.                     *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful, but   *
00012  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the Free Software   *
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00019  *   USA                                                                   *
00020  ***************************************************************************/
00021 
00022 #ifndef TAGLIB_MAP_H
00023 #define TAGLIB_MAP_H
00024 
00025 #include "taglib.h"
00026 
00027 #include <map>
00028 
00029 namespace TagLib {
00030 
00032 
00039   template <class Key, class T> class Map
00040   {
00041   public:
00042 #ifndef DO_NOT_DOCUMENT
00043     typedef typename std::map<Key, T>::iterator Iterator;
00044     typedef typename std::map<Key, T>::const_iterator ConstIterator;
00045 #endif
00046 
00050     Map();
00051 
00057     Map(const Map<Key, T> &m);
00058 
00062     virtual ~Map();
00063 
00068     Iterator begin();
00069 
00074     ConstIterator begin() const;
00075 
00080     Iterator end();
00081 
00086     ConstIterator end() const;
00087 
00092     void insert(const Key &key, const T &value);
00093 
00098     void clear();
00099 
00105     uint size() const;
00106 
00112     bool isEmpty() const;
00113 
00117     bool contains(const Key &key) const;
00118 
00124     const T &operator[](const Key &key) const;
00125 
00131     T &operator[](const Key &key);
00132 
00138     Map<Key, T> &operator=(const Map<Key, T> &m);
00139 
00140   protected:
00141     /*
00142      * If this List is being shared via implicit sharing, do a deep copy of the
00143      * data and separate from the shared members.  This should be called by all
00144      * non-const subclass members.
00145      */
00146     void detach();
00147 
00148   private:
00149 #ifndef DO_NOT_DOCUMENT
00150     template <class KeyP, class TP> class MapPrivate;
00151     MapPrivate<Key, T> *d;
00152 #endif
00153   };
00154 
00155 }
00156 
00157 // Since GCC doesn't support the "export" keyword, we have to include the
00158 // implementation.
00159 
00160 #include "tmap.tcc"
00161 
00162 #endif

Generated on Mon Jun 7 12:51:48 2004 for TagLib by doxygen 1.3.4