summaryrefslogtreecommitdiffstats
path: root/doc/tqmap.doc
blob: cad832f464b3485c90ec3dc0eebc9d72d1ed6a66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
/****************************************************************************
**
** TQMap and TQMapIterator class documentation
**
** Copyright (C) 1992-2008 Trolltech ASA.  All rights reserved.
**
** This file is part of the TQt GUI Toolkit.
**
** This file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free
** Software Foundation and appearing in the files LICENSE.GPL2
** and LICENSE.GPL3 included in the packaging of this file.
** Alternatively you may (at your option) use any later version
** of the GNU General Public License if such license has been
** publicly approved by Trolltech ASA (or its successors, if any)
** and the KDE Free TQt Foundation.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/.
** If you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** This file may be used under the terms of the Q Public License as
** defined by Trolltech ASA and appearing in the file LICENSE.QPL
** included in the packaging of this file.  Licensees holding valid Qt
** Commercial licenses may use this file in accordance with the Qt
** Commercial License Agreement provided with the Software.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
** herein.
**
**********************************************************************/


/*****************************************************************************
  TQMap documentation
 *****************************************************************************/

/*!
    \class TQMap tqmap.h
    \brief The TQMap class is a value-based template class that
    provides a dictionary.

    \ingroup qtl
    \ingroup tools
    \ingroup shared
    \mainclass

    TQMap is a TQt implementation of an STL-like map container. It can
    be used in your application if the standard \c map is not
    available on all your target platforms. TQMap is part of the \link
    ntqtl.html TQt Template Library\endlink.

    TQMap\<Key, Data\> defines a template instance to create a
    dictionary with keys of type Key and values of type Data. TQMap
    does not store pointers to the members of the map; instead, it
    holds a copy of every member. For this reason, TQMap is
    value-based, whereas TQPtrList and QDict are pointer-based.

    TQMap contains and manages a collection of objects of type Data
    with associated key values of type Key and provides iterators that
    allow the contained objects to be addressed. TQMap owns the
    contained items.

    Some classes cannot be used within a TQMap. For example everything
    derived from TQObject and thus all classes that implement widgets.
    Only values can be used in a TQMap. To qualify as a value, the
    class must provide

    \list
    \i A copy constructor
    \i An assignment operator
    \i A default constructor, i.e. a constructor that does not take
    any arguments.
    \endlist

    Note that C++ defaults to field-by-field assignment operators and
    copy constructors if no explicit version is supplied. In many
    cases, this is sufficient.

    The class used for the key requires that the \c operator< is
    implemented to define ordering of the keys.

    TQMap's function naming is consistent with the other TQt classes
    (e.g., count(), isEmpty()). TQMap also provides extra functions for
    compatibility with STL algorithms, such as size() and empty().
    Programmers already familiar with the STL \c map can use these
    the STL-like functions if preferred.

    Example:
    \target tqmap-eg
    \code
    #include <tqstring.h>
    #include <tqmap.h>
    #include <tqstring.h>

    class Employee
    {
    public:
	Employee(): sn(0) {}
	Employee( const TQString& forename, const TQString& surname, int salary )
	    : fn(forename), sn(surname), sal(salary)
	{ }

	TQString forename() const { return fn; }
	TQString surname() const { return sn; }
	int salary() const { return sal; }
	void setSalary( int salary ) { sal = salary; }

    private:
	TQString fn;
	TQString sn;
	int sal;
    };

    int main(int argc, char **argv)
    {
	QApplication app( argc, argv );

	typedef TQMap<TQString, Employee> EmployeeMap;
	EmployeeMap map;

	map["JD001"] = Employee("John", "Doe", 50000);
	map["JW002"] = Employee("Jane", "Williams", 80000);
	map["TJ001"] = Employee("Tom", "Jones", 60000);

	Employee sasha( "Sasha", "Hind", 50000 );
	map["SH001"] = sasha;
	sasha.setSalary( 40000 );

	EmployeeMap::Iterator it;
	for ( it = map.begin(); it != map.end(); ++it ) {
	    printf( "%s: %s, %s earns %d\n",
		    it.key().latin1(),
		    it.data().surname().latin1(),
		    it.data().forename().latin1(),
		    it.data().salary() );
	}
	return 0;
    }
    \endcode

    Program output:
    \code
    JD001: Doe, John earns 50000
    JW002: Williams, Jane earns 80000
    SH001: Hind, Sasha earns 50000
    TJ001: Jones, Tom earns 60000
    \endcode

    The latest changes to Sasha's salary did not affect the value in
    the list because the map created a copy of Sasha's entry. In
    addition, notice that the items are sorted alphabetically (by key)
    when iterating over the map.

    There are several ways to find items in a map. The begin() and
    end() functions return iterators to the beginning and end of the
    map. The advantage of using an iterator is that you can move
    forward or backward by incrementing/decrementing the iterator.
    The iterator returned by end() points to the element which is one
    past the last element in the container. The past-the-end iterator
    is still associated with the map it belongs to, however it is \e
    not dereferenceable; operator*() will not return a well-defined
    value. If the map is empty, the iterator returned by begin() will
    equal the iterator returned by end().

    Another way to find an element in the map is by using the find()
    function. This returns an iterator pointing to the desired item or
    to the end() iterator if no such element exists.

    Another approach uses the operator[]. But be warned: if the map
    does not contain an entry for the element you are looking for,
    operator[] inserts a default value. If you do not know that the
    element you are searching for is really in the list, you should
    not use operator[]. The following example illustrates this:

    \code
	TQMap<TQString,TQString> map;
	map["Clinton"] = "Bill";
	str << map["Clinton"] << map["Bush"] << endl;
    \endcode

    The code fragment will print out "Clinton", "". Since the value
    associated with the "Bush" key did not exist, the map inserted a
    default value (in this case, an empty string). If you are not
    sure whether a certain element is in the map, you should use
    find() and iterators instead.

    If you just want to know whether a certain key is contained in the
    map, use the contains() function. In addition, count() tells you
    how many keys are in the map.

    It is safe to have multiple iterators at the same time. If some
    member of the map is removed, only iterators pointing to the
    removed member become invalid; inserting in the map does not
    invalidate any iterators.

    Since TQMap is value-based, there is no need to be concerned about
    deleting items in the map. The map holds its own copies and will
    free them if the corresponding member or the map itself is
    deleted.

    TQMap is implicitly shared. This means you can just make copies of
    the map in time O(1). If multiple TQMap instances share the same
    data and one is modifying the map's data, this modifying instance
    makes a copy and modifies its private copy: so it does not affect
    other instances. If a TQMap is being used in a multi-threaded
    program, you must protect all access to the map. See \l TQMutex.

    There are a couple of ways of inserting new items into the map.
    One uses the insert() method; the other uses operator[]:
    \code
    TQMap<TQString, TQString> map;
    map["Clinton"] = "Bill";
    map.insert( "Bush", "George" );
    \endcode

    Items can also be removed from the map in several ways. One way is
    to pass an iterator to remove(). Another way is to pass a key
    value to remove(), which will delete the entry with the requested
    key. In addition you can clear the entire map using the clear()
    method.

    \sa TQMapIterator
*/


/*! \enum  TQMap::key_type
	The map's key type. */
/*! \enum  TQMap::mapped_type
	The map's data type. */
/*! \enum  TQMap::value_type
	Corresponds to TQPair\<key_type, mapped_type\>. */
/*! \enum  TQMap::ValueType
	Corresponds to TQPair\<key_type, mapped_type\>, TQt style.*/
/*! \enum  TQMap::pointer
	Pointer to value_type.*/
/*! \enum  TQMap::const_pointer
	Const pointer to value_type.*/
/*! \enum  TQMap::reference
	Reference to value_type.*/
/*! \enum  TQMap::const_reference
	Const reference to value_type.*/
/*! \enum  TQMap::size_type
	An unsigned integral type, used to represent various sizes. */
/*! \enum  TQMap::iterator
	The map's iterator type.*/
/*! \enum TQMap::Iterator
	The map's iterator type, TQt style. */
/*! \enum  TQMap::const_iterator
	The map's const iterator type.*/
/*! \enum  TQMap::ConstIterator
	The map's const iterator type, TQt style.*/
/*! \enum TQMap::difference_type
    \internal */
/*! \enum TQMap::Priv
    \internal */

/*!
    \fn TQMap::TQMap()

    Constructs an empty map.
*/

/*!
    \fn TQMap::TQMap( const TQMap<Key,T>& m )

    Constructs a copy of \a m.

    This operation costs O(1) time because TQMap is implicitly shared.
    This makes returning a TQMap from a function very fast. If a shared
    instance is modified, it will be copied (copy-on-write), and this
    takes O(n) time.
*/

/*!
    \fn TQMap::TQMap( const std::map<Key,T>& m )

    Constructs a copy of \a m.
*/

/*!
    \fn TQMap<Key,T>& TQMap::operator= ( const std::map<Key,T>& m )

    \overload

    Assigns \a m to this map and returns a reference to this map.

    All iterators of the current map become invalidated by this
    operation.
*/

/*!
    \fn TQMap::~TQMap()

    Destroys the map. References to the values in the map and all
    iterators of this map become invalidated. Since TQMap is highly
    tuned for performance you won't see warnings if you use invalid
    iterators, because it is not possible for an iterator to check
    whether it is valid or not.
*/

/*!
    \fn TQMap<Key, T>& TQMap::operator= (const TQMap<Key, T>& m)

    Assigns \a m to this map and returns a reference to this map.

    All iterators of the current map become invalidated by this
    operation. The cost of such an assignment is O(1), because TQMap is
    implicitly shared.
*/

/*!
    \fn T& TQMap::operator[] ( const Key& k )

    Returns the value associated with the key \a k. If no such key is
    present, an empty item is inserted with this key and a reference
    to the empty item is returned.

    You can use this operator both for reading and writing:
    \code
    TQMap<TQString, TQString> map;
    map["Clinton"] = "Bill";
    stream << map["Clinton"];
    \endcode
*/

/*!
    \fn void TQMap::clear()

    Removes all items from the map.

    \sa remove()
*/

/*!
    \fn Iterator TQMap::find( const Key& k )

    Returns an iterator pointing to the element with key \a k in the
    map.

    Returns end() if no key matched.

    \sa TQMapIterator
*/

/*!
    \fn ConstIterator TQMap::find( const Key& k ) const

    \overload

    Returns an iterator pointing to the element with key \a k in the
    map.

    Returns end() if no key matched.

    \sa TQMapConstIterator
*/

/*!
    \fn Iterator TQMap::begin()

    Returns an iterator pointing to the first element in the map. This
    iterator equals end() if the map is empty.

    The items in the map are traversed in the order defined by
    operator\<(Key, Key).

    \sa end() TQMapIterator
*/

/*!
    \fn ConstIterator TQMap::begin() const

    \overload

    \sa end() TQMapConstIterator
*/

/*!
    \fn ConstIterator TQMap::constBegin() const

    Returns an iterator pointing to the first element in the map. This
    iterator equals end() if the map is empty.

    The items in the map are traversed in the order defined by
    operator\<(Key, Key).

    \sa constEnd() TQMapConstIterator
*/

/*!
    \fn Iterator TQMap::end()

    The iterator returned by end() points to the element which is one
    past the last element in the container. The past-the-end iterator
    is still associated with the map it belongs to, but it is \e not
    dereferenceable; operator*() will not return a well-defined value.

    This iterator equals begin() if the map is empty.

    \sa begin() TQMapIterator
*/

/*!
    \fn ConstIterator TQMap::end() const

    \overload
*/

/*!
    \fn ConstIterator TQMap::constEnd() const

    The iterator returned by end() points to the element which is one
    past the last element in the container. The past-the-end iterator
    is still associated with the map it belongs to, but it is \e not
    dereferenceable; operator*() will not return a well-defined value.

    This iterator equals constBegin() if the map is empty.

    \sa constBegin() TQMapConstIterator
*/

/*!
    \fn void TQMap::detach()

    If the map does not share its data with another TQMap instance,
    nothing happens; otherwise the function creates a new copy of this
    map and detaches from the shared one. This function is called
    whenever the map is modified. The implicit sharing mechanism is
    implemented this way.
*/


/*!
    \fn QDataStream& operator>>( QDataStream& s, TQMap<Key,T>& m )

    \relates TQMap

    Reads the map \a m from the stream \a s. The types \e Key and \e T
    must implement the streaming operator as well.
*/

/*!
    \fn QDataStream& operator<<( QDataStream& s, const TQMap<Key,T>& m )

    \relates TQMap

    Writes the map \a m to the stream \a s. The types \e Key and \e T
    must implement the streaming operator as well.
*/

/*!
    \fn size_type TQMap::size() const

    Returns the number of items in the map.

    This function is provided for STL compatibility. It is equivalent
    to count().

    \sa empty()
*/

/*!
    \fn bool TQMap::empty() const

    Returns TRUE if the map contains no items; otherwise returns
    FALSE.

    This function is provided for STL compatibility. It is equivalent
    to isEmpty().

    \sa size()
*/

/*!
    \fn TQPair<iterator,bool> TQMap::insert( const value_type& x )

    \overload

    Inserts the (key, value) pair \a x into the map. \a x is a TQPair
    whose \c first element is a key to be inserted and whose \c second
    element is the associated value to be inserted. Returns a pair
    whose \c first element is an iterator pointing to the inserted
    item and whose \c second element is a bool indicating TRUE if \a x
    was inserted and FALSE if it was not inserted, e.g. because it was
    already present.

    \sa replace()
*/

/*!
    \fn void TQMap::erase( iterator it )

    Removes the item associated with the iterator \a it from the map.

    This function is provided for STL compatibility. It is equivalent
    to remove().

    \sa clear()
*/

/*!
    \fn void TQMap::erase( const key_type& k )

    \overload

    Removes the item with the key \a k from the map.
*/

/*!
    \fn size_type TQMap::count( const key_type& k ) const

    Returns the number of items whose key is \a k. Since TQMap does not
    allow duplicate keys, the return value is always 0 or 1.

    This function is provided for STL compatibility.
*/

/*!
    \fn Iterator TQMap::replace( const Key& k, const T& v )

    Replaces the value of the element with key \a k, with the value \a
    v.

    \sa insert() remove()
*/

/*!
    \fn const T& TQMap::operator[] ( const Key& k ) const

    \overload

    \warning This function differs from the non-const version of the
    same function. It will \e not insert an empty value if the key \a
    k does not exist. This may lead to logic errors in your program.
    You should check if the element exists before calling this
    function.

    Returns the value associated with the key \a k. If no such key is
    present, a reference to an empty item is returned.
*/

/*!
    \fn uint TQMap::count() const

    \overload

    Returns the number of items in the map.

    \sa isEmpty()
*/

/*!
    \fn bool TQMap::isEmpty() const

    Returns TRUE if the map contains no items; otherwise returns
    FALSE.

    \sa count()
*/

/*!
    \fn Iterator TQMap::insert( const Key& key, const T& value, bool overwrite )

    Inserts a new item with the key, \a key, and a value of \a value.
    If there is already an item whose key is \a key, that item's value
    is replaced with \a value, unless \a overwrite is FALSE (it is
    TRUE by default). In this case an iterator to this item is
    returned, else an iterator to the new item is returned.

*/

/*!
    \fn void TQMap::remove( iterator it )

    Removes the item associated with the iterator \a it from the map.

    \sa clear()
*/

/*!
    \fn void TQMap::remove( const Key& k )

    \overload

    Removes the item with the key \a k from the map.
*/

/*!
    \fn bool TQMap::contains( const Key& k ) const

    Returns TRUE if the map contains an item with key \a k; otherwise
    returns FALSE.
*/


/*****************************************************************************
  TQMapIterator documentation
 *****************************************************************************/

/*!
    \class TQMapIterator tqmap.h
    \brief The TQMapIterator class provides an iterator for TQMap.

    \ingroup qtl
    \ingroup tools

    You cannot create an iterator by yourself. Instead, you must ask a
    map to give you one. An iterator is as big as a pointer; on 32-bit
    machines that means 4 bytes, on 64-bit machines, 8 bytes. That
    makes copying iterators very fast. Iterators behave in a similar
    way to pointers, and they are almost as fast as pointers. See the
    \link tqmap.html#tqmap-eg TQMap example\endlink.

    TQMap is highly optimized for performance and memory usage, but the
    trade-off is that you must be more careful. The only way to
    traverse a map is to use iterators. TQMap does not know about its
    iterators, and the iterators don't even know to which map they
    belong. That makes things fast but a bit dangerous because it is
    up to you to make sure that the iterators you are using are still
    valid. QDictIterator will be able to give warnings, whereas
    TQMapIterator may end up in an undefined state.

    For every Iterator there is also a ConstIterator. You must use the
    ConstIterator to access a TQMap in a const environment or if the
    reference or pointer to the map is itself const. Its semantics are
    the same, but it only returns const references to the item it
    points to.

    \sa TQMap TQMapConstIterator
*/

/*! \enum  TQMapIterator::iterator_category
	The type of iterator category, \c std::bidirectional_iterator_tag. */
/*! \enum  TQMapIterator::value_type
	The type of value. */
/*! \enum  TQMapIterator::pointer
	Pointer to value_type. */
/*! \enum  TQMapIterator::reference
	Reference to value_type. */
/*! \enum TQMapIterator::difference_type
    \internal */
/*! \enum TQMapIterator::NodePtr
    \internal */

/*!
    \fn TQMapIterator::TQMapIterator()

    Creates an uninitialized iterator.
*/

/*!
    \fn TQMapIterator::TQMapIterator (TQMapNode<K, T> * p)

    Constructs an iterator starting at node \a p.
*/

/*!
    \fn TQMapIterator::TQMapIterator( const TQMapIterator<K,T>& it )

    Constructs a copy of the iterator, \a it.
*/

/*!
    \fn TQMapIterator<K,T>& TQMapIterator::operator++()

    Prefix ++ makes the succeeding item current and returns an
    iterator pointing to the new current item. The iterator cannot
    check whether it reached the end of the map. Incrementing the
    iterator returned by end() causes undefined results.
*/

/*!
    \fn TQMapIterator<K,T> TQMapIterator::operator++(int)

    \overload

    Postfix ++ makes the succeeding item current and returns an
    iterator pointing to the new current item. The iterator cannot
    check whether it reached the end of the map. Incrementing the
    iterator returned by end() causes undefined results.
*/

/*!
    \fn TQMapIterator<K,T>& TQMapIterator::operator--()

    Prefix -- makes the previous item current and returns an iterator
    pointing to the new current item. The iterator cannot check
    whether it reached the beginning of the map. Decrementing the
    iterator returned by begin() causes undefined results.
*/

/*!
    \fn TQMapIterator<K,T> TQMapIterator::operator--(int)

    \overload

    Postfix -- makes the previous item current and returns an iterator
    pointing to the new current item. The iterator cannot check
    whether it reached the beginning of the map. Decrementing the
    iterator returned by begin() causes undefined results.
*/

/*!
    \fn T& TQMapIterator::operator*()

    Dereference operator. Returns a reference to the current item's
    data. The same as data().
*/

/*!
    \fn const T& TQMapIterator::operator*() const

    \overload

    Dereference operator. Returns a const reference to the current
    item's data. The same as data().
*/

/*!
    \fn bool TQMapIterator::operator==( const TQMapIterator<K,T>& it ) const

    Compares the iterator to the \a it iterator and returns TRUE if
    they point to the same item; otherwise returns FALSE.
*/

/*!
    \fn bool TQMapIterator::operator!=( const TQMapIterator<K,T>& it ) const

    Compares the iterator to the \a it iterator and returns FALSE if
    they point to the same item; otherwise returns TRUE.
*/

/*!
    \fn T& TQMapIterator::data()

    Returns a reference to the current item's data.
*/

/*!
    \fn const T& TQMapIterator::data() const

    \overload

    Returns a const reference to the current item's data.
*/

/*!
    \fn const K& TQMapIterator::key() const

    Returns a const reference to the current item's key.
*/

/*!
    \fn TQValueList<Key> TQMap::keys() const

    Returns a list of all the keys in the map, in order.
*/

/*!
    \fn TQValueList<T> TQMap::values() const

    Returns a list of all the values in the map, in key order.
*/

/*****************************************************************************
  TQMapConstIterator documentation
 *****************************************************************************/

/*!
    \class TQMapConstIterator tqmap.h
    \brief The TQMapConstIterator class provides an iterator for TQMap.

    \ingroup qtl
    \ingroup tools

    In contrast to TQMapIterator, this class is used to iterate over a
    const map. It does not allow you to modify the values of the map
    because this would break the const semantics.

    For more information on TQMap iterators, see \l{TQMapIterator} and
    the \link tqmap.html#tqmap-eg TQMap example\endlink.

    \sa TQMap TQMapIterator
*/

/*! \enum  TQMapConstIterator::iterator_category
	The type of iterator category, \c std::bidirectional_iterator_tag. */
/*! \enum  TQMapConstIterator::value_type
	The type of const value. */
/*! \enum  TQMapConstIterator::pointer
	Const pointer to value_type. */
/*! \enum  TQMapConstIterator::reference
	Const reference to value_type. */
/*! \enum TQMapConstIterator::difference_type
    \internal */
/*! \enum TQMapConstIterator::NodePtr
    \internal */


/*!
    \fn TQMapConstIterator::TQMapConstIterator()

    Constructs an uninitialized iterator.
*/

/*!
    \fn TQMapConstIterator::TQMapConstIterator (TQMapNode<K, T> * p)

    Constructs an iterator starting at node \a p.
*/

/*!
    \fn TQMapConstIterator::TQMapConstIterator( const TQMapConstIterator<K,T>& it )

    Constructs a copy of the iterator, \a it.
*/

/*!
    \fn TQMapConstIterator::TQMapConstIterator( const TQMapIterator<K,T>& it )

    Constructs a copy of the iterator, \a it.
*/

/*!
    \fn TQMapConstIterator<K,T>& TQMapConstIterator::operator++()

    Prefix ++ makes the succeeding item current and returns an
    iterator pointing to the new current item. The iterator cannot
    check whether it reached the end of the map. Incrementing the
    iterator returned by end() causes undefined results.
*/

/*!
    \fn TQMapConstIterator<K,T> TQMapConstIterator::operator++(int)

    \overload

    Postfix ++ makes the succeeding item current and returns an
    iterator pointing to the new current item. The iterator cannot
    check whether it reached the end of the map. Incrementing the
    iterator returned by end() causes undefined results.
*/

/*!
    \fn TQMapConstIterator<K,T>& TQMapConstIterator::operator--()

    Prefix -- makes the previous item current and returns an iterator
    pointing to the new current item. The iterator cannot check
    whether it reached the beginning of the map. Decrementing the
    iterator returned by begin() causes undefined results.
*/

/*!
    \fn TQMapConstIterator<K,T> TQMapConstIterator::operator--(int)

    \overload

    Postfix -- makes the previous item current and returns an iterator
    pointing to the new current item. The iterator cannot check
    whether it reached the beginning of the map. Decrementing the
    iterator returned by begin() causes undefined results.
*/

/*!
    \fn const T& TQMapConstIterator::operator*() const

    Dereference operator. Returns a const reference to the current
    item's data. The same as data().
*/

/*!
    \fn bool TQMapConstIterator::operator==( const TQMapConstIterator<K,T>& it ) const

    Compares the iterator to the \a it iterator and returns TRUE if
    they point to the same item; otherwise returns FALSE.
*/

/*!
    \fn bool TQMapConstIterator::operator!=( const TQMapConstIterator<K,T>& it ) const

    Compares the iterator to the \a it iterator and returns FALSE if
    they point to the same item; otherwise returns TRUE.
*/

/*!
    \fn const T& TQMapConstIterator::data() const

    Returns a const reference to the current item's data.
*/

/*!
    \fn const K& TQMapConstIterator::key() const

    Returns a const reference to the current item's key.
*/