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

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
kbihash_p.h
Go to the documentation of this file.
1 /*
2 
3  Copyright (C) 2010 Klarälvdalens Datakonsult AB,
4  a KDAB Group company, info@kdab.net,
5  author Stephen Kelly <stephen@kdab.com>
6 
7  This library is free software; you can redistribute it and/or modify it
8  under the terms of the GNU Library General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version.
11 
12  This library is distributed in the hope that it will be useful, but WITHOUT
13  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15  License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to the
19  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  02110-1301, USA.
21 */
22 
23 #ifndef KBIHASH_P_H
24 #define KBIHASH_P_H
25 
26 #include <QHash>
27 #include <QMap>
28 
29 #include <QDebug>
30 
31 template<typename LeftContainer, typename RightContainer>
32 class KBiAssociativeContainer;
33 
34 template<typename LeftContainer, typename RightContainer>
35 QDebug operator<<(QDebug out, const KBiAssociativeContainer<LeftContainer, RightContainer> &container);
36 
37 template<typename LeftContainer, typename RightContainer>
38 QDataStream &operator<<(QDataStream &out, const KBiAssociativeContainer<LeftContainer, RightContainer> &container);
39 
40 template<typename LeftContainer, typename RightContainer>
41 QDataStream &operator>>(QDataStream &in, KBiAssociativeContainer<LeftContainer, RightContainer> &container);
42 
43 
44 template<typename LeftContainer, typename RightContainer>
45 class KBiAssociativeContainer
46 {
47  // We need to convert from a QHash::iterator or QMap::iterator
48  // to a KBiAssociativeContainer::iterator (left or right)
49  // Do do that we use this implicit ctor. We partially specialize
50  // it for QHash and QMap types.
51  // Our iterator inherits from this struct to get the implicit ctor,
52  // and this struct must inherit from the QHash or QMap iterator.
53  template<typename Container, typename T, typename U>
54  struct _iterator_impl_ctor : public Container::iterator
55  {
56  _iterator_impl_ctor(typename Container::iterator it);
57  };
58 
59  template<typename T, typename U>
60  struct _iterator_impl_ctor<QHash<T, U>, T, U> : public QHash<T, U>::iterator
61  {
62  /* implicit */ _iterator_impl_ctor(const typename QHash<T, U>::iterator it)
63  // Using internals here because I was too lazy to write my own iterator.
64 #if QT_VERSION < 0x050000
65  : QHash<T, U>::iterator(reinterpret_cast<void *>(static_cast<QHashNode<T, U> *>(it)))
66 #else
67  : QHash<T, U>::iterator(it)
68 #endif
69  {
70 
71  }
72  };
73 
74  template<typename T, typename U>
75  struct _iterator_impl_ctor<QMap<T, U>, T, U> : public QMap<T, U>::iterator
76  {
77  /* implicit */ _iterator_impl_ctor(const typename QMap<T, U>::iterator it)
78  // Using internals here because I was too lazy to write my own iterator.
79 #if QT_VERSION < 0x050000
80  : QMap<T, U>::iterator(static_cast<QMapData::Node*>(it))
81 #else
82  : QMap<T, U>::iterator(it)
83 #endif
84  {
85 
86  }
87  };
88 public:
89  typedef typename RightContainer::mapped_type left_type;
90  typedef typename LeftContainer::mapped_type right_type;
91 
92  template <typename Container>
93  class _iterator : public _iterator_impl_ctor<Container, typename Container::key_type, typename Container::mapped_type>
94  {
95  public:
96  explicit inline _iterator(void *data) : Container::iterator(data) {}
97 
98  /* implicit */ _iterator(const typename Container::iterator it)
99  : _iterator_impl_ctor<Container, typename Container::key_type, typename Container::mapped_type>(it)
100  {
101 
102  }
103 
104  inline const typename Container::mapped_type &value() const {
105  return Container::iterator::value();
106  }
107  inline const typename Container::mapped_type &operator*() const {
108  return Container::iterator::operator*();
109  }
110  inline const typename Container::mapped_type *operator->() const {
111  return Container::iterator::operator->();
112  }
113 
114  private:
115 #ifndef Q_CC_MSVC
116  using Container::iterator::operator*;
117  using Container::iterator::operator->;
118  using Container::iterator::value;
119 #endif
120  };
121 
122  typedef _iterator<LeftContainer> left_iterator;
123  typedef typename LeftContainer::const_iterator left_const_iterator;
124  typedef _iterator<RightContainer> right_iterator;
125  typedef typename RightContainer::const_iterator right_const_iterator;
126 
127  inline KBiAssociativeContainer() {}
128  inline KBiAssociativeContainer(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
129  *this = other;
130  }
131 
132  const KBiAssociativeContainer<LeftContainer, RightContainer> &operator=(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
133  _leftToRight = other._leftToRight; _rightToLeft = other._rightToLeft; return *this;
134  }
135 
136  inline bool removeLeft(left_type t) {
137  const right_type u = _leftToRight.take(t);
138  return _rightToLeft.remove(u) != 0;
139  }
140 
141  inline bool removeRight(right_type u) {
142  const left_type t = _rightToLeft.take(u);
143  return _leftToRight.remove(t) != 0;
144  }
145 
146  inline right_type takeLeft(left_type t) {
147  const right_type u = _leftToRight.take(t);
148  _rightToLeft.remove(u);
149  return u;
150  }
151 
152  inline left_type takeRight(right_type u) {
153  const left_type t = _rightToLeft.take(u);
154  _leftToRight.remove(t);
155  return t;
156  }
157 
158  inline left_type rightToLeft(right_type u) const {
159  return _rightToLeft.value(u);
160  }
161 
162  inline right_type leftToRight(left_type t) const {
163  return _leftToRight.value(t);
164  }
165 
166  inline bool leftContains(left_type t) const {
167  return _leftToRight.contains(t);
168  }
169 
170  inline bool rightContains(right_type u) const {
171  return _rightToLeft.contains(u);
172  }
173 
174  inline int size() const {
175  return _leftToRight.size();
176  }
177 
178  inline int count() const {
179  return _leftToRight.count();
180  }
181 
182  inline int capacity() const {
183  return _leftToRight.capacity();
184  }
185 
186  void reserve(int size) {
187  _leftToRight.reserve(size); _rightToLeft.reserve(size);
188  }
189 
190  inline void squeeze() {
191  _leftToRight.squeeze(); _rightToLeft.squeeze();
192  }
193 
194  inline void detach() {
195  _leftToRight.detach(); _rightToLeft.detach();
196  }
197 
198  inline bool isDetached() const {
199  return _leftToRight.isDetached();
200  }
201 
202  inline void setSharable(bool sharable) {
203  _leftToRight.setSharable(sharable); _rightToLeft.setSharable(sharable);
204  }
205 
206  inline bool isSharedWith(const KBiAssociativeContainer<RightContainer, LeftContainer> &other) const {
207  return _leftToRight.isSharedWith(other._leftToRight) && _rightToLeft.isSharedWith(other._leftToRight);
208  }
209 
210  void clear() {
211  _leftToRight.clear(); _rightToLeft.clear();
212  }
213 
214  QList<left_type> leftValues() const {
215  return _leftToRight.keys();
216  }
217 
218  QList<right_type> rightValues() const {
219  return _rightToLeft.keys();
220  }
221 
222  right_iterator eraseRight(right_iterator it) {
223  Q_ASSERT(it != rightEnd());
224  _leftToRight.remove(it.value());
225  return _rightToLeft.erase(it);
226  }
227 
228  left_iterator eraseLeft(left_iterator it) {
229  Q_ASSERT(it != leftEnd());
230  _rightToLeft.remove(it.value());
231  return _leftToRight.erase(it);
232  }
233 
234  left_iterator findLeft(left_type t) {
235  return _leftToRight.find(t);
236  }
237 
238  left_const_iterator findLeft(left_type t) const {
239  return _leftToRight.find(t);
240  }
241 
242  left_const_iterator constFindLeft(left_type t) const {
243  return _leftToRight.constFind(t);
244  }
245 
246  right_iterator findRight(right_type u) {
247  return _rightToLeft.find(u);
248  }
249 
250  right_const_iterator findRight(right_type u) const {
251  return _rightToLeft.find(u);
252  }
253 
254  right_const_iterator constFindRight(right_type u) const {
255  return _rightToLeft.find(u);
256  }
257 
258  left_iterator insert(left_type t, right_type u) {
259  // biHash.insert(5, 7); // creates 5->7 in _leftToRight and 7->5 in _rightToLeft
260  // biHash.insert(5, 9); // replaces 5->7 with 5->9 in _leftToRight and inserts 9->5 in _rightToLeft.
261  // The 7->5 in _rightToLeft would be dangling, so we remove it before insertion.
262 
263  // This means we need to hash u and t up to twice each. Could probably be done better using QHashNode.
264 
265  if (_leftToRight.contains(t))
266  _rightToLeft.remove(_leftToRight.take(t));
267  if (_rightToLeft.contains(u))
268  _leftToRight.remove(_rightToLeft.take(u));
269 
270  _rightToLeft.insert(u, t);
271  return _leftToRight.insert(t, u);
272  }
273 
274 
275  KBiAssociativeContainer<LeftContainer, RightContainer> &intersect(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
276  typename KBiAssociativeContainer<RightContainer, LeftContainer>::left_iterator it = leftBegin();
277  while (it != leftEnd()) {
278  if (!other.leftContains(it.key()))
279  it = eraseLeft(it);
280  else
281  ++it;
282  }
283  return *this;
284  }
285 
286  KBiAssociativeContainer<LeftContainer, RightContainer> &subtract(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
287  typename KBiAssociativeContainer<RightContainer, LeftContainer>::left_iterator it = leftBegin();
288  while (it != leftEnd()) {
289  if (other._leftToRight.contains(it.key()))
290  it = eraseLeft(it);
291  else
292  ++it;
293  }
294  return *this;
295  }
296 
297  KBiAssociativeContainer<LeftContainer, RightContainer> &unite(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
298  typename LeftContainer::const_iterator it = other._leftToRight.constBegin();
299  const typename LeftContainer::const_iterator end = other._leftToRight.constEnd();
300  while (it != end) {
301  const left_type key = it.key();
302  if (!_leftToRight.contains(key))
303  insert(key, it.value());
304  ++it;
305  }
306  return *this;
307  }
308 
309  void updateRight(left_iterator it, right_type u) {
310  Q_ASSERT(it != leftEnd());
311  const left_type key = it.key();
312  _rightToLeft.remove(_leftToRight.value(key));
313  _leftToRight[key] = u;
314  _rightToLeft[u] = key;
315  }
316 
317  void updateLeft(right_iterator it, left_type t) {
318  Q_ASSERT(it != rightEnd());
319  const right_type key = it.key();
320  _leftToRight.remove(_rightToLeft.value(key));
321  _rightToLeft[key] = t;
322  _leftToRight[t] = key;
323  }
324 
325  inline bool isEmpty() const {
326  return _leftToRight.isEmpty();
327  }
328 
329  const right_type operator[](const left_type &t) const {
330  return _leftToRight.operator[](t);
331  }
332 
333  bool operator==(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
334  return _leftToRight.operator == (other._leftToRight);
335  }
336 
337  bool operator!=(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
338  return _leftToRight.operator != (other._leftToRight);
339  }
340 
341  left_iterator toLeftIterator(right_iterator it) const {
342  Q_ASSERT(it != rightEnd());
343  return _leftToRight.find(it.value());
344  }
345 
346  right_iterator toRightIterator(left_iterator it) const {
347  Q_ASSERT(it != leftEnd());
348  return _rightToLeft.find(it.value());
349  }
350 
351  inline left_iterator leftBegin() {
352  return _leftToRight.begin();
353  }
354 
355  inline left_iterator leftEnd() {
356  return _leftToRight.end();
357  }
358 
359  inline left_const_iterator leftBegin() const {
360  return _leftToRight.begin();
361  }
362 
363  inline left_const_iterator leftEnd() const {
364  return _leftToRight.end();
365  }
366 
367  inline left_const_iterator leftConstBegin() const {
368  return _leftToRight.constBegin();
369  }
370 
371  inline left_const_iterator leftConstEnd() const {
372  return _leftToRight.constEnd();
373  }
374 
375  inline right_iterator rightBegin() {
376  return _rightToLeft.begin();
377  }
378 
379  inline right_iterator rightEnd() {
380  return _rightToLeft.end();
381  }
382 
383  inline right_const_iterator rightBegin() const {
384  return _rightToLeft.begin();
385  }
386 
387  inline right_const_iterator rightEnd() const {
388  return _rightToLeft.end();
389  }
390  inline right_const_iterator rightConstBegin() const {
391  return _rightToLeft.constBegin();
392  }
393 
394  inline right_const_iterator rightConstEnd() const {
395  return _rightToLeft.constEnd();
396  }
397 
398  static KBiAssociativeContainer<LeftContainer, RightContainer> fromHash(const QHash<left_type, right_type> &hash) {
399  KBiAssociativeContainer<LeftContainer, RightContainer> container;
400  typename QHash<left_type, right_type>::const_iterator it = hash.constBegin();
401  const typename QHash<left_type, right_type>::const_iterator end = hash.constEnd();
402  for ( ; it != end; ++it)
403  container.insert(it.key(), it.value());
404  return container;
405  }
406 
407  static KBiAssociativeContainer<LeftContainer, RightContainer> fromMap(const QMap<left_type, right_type> &hash) {
408  KBiAssociativeContainer<LeftContainer, RightContainer> container;
409  typename QMap<left_type, right_type>::const_iterator it = hash.constBegin();
410  const typename QMap<left_type, right_type>::const_iterator end = hash.constEnd();
411  for ( ; it != end; ++it)
412  container.insert(it.key(), it.value());
413  return container;
414  }
415 
416  friend QDataStream &operator<< <LeftContainer, RightContainer>(QDataStream &out, const KBiAssociativeContainer<LeftContainer, RightContainer> &bihash);
417  friend QDataStream &operator>> <LeftContainer, RightContainer>(QDataStream &in, KBiAssociativeContainer<LeftContainer, RightContainer> &biHash);
418  friend QDebug operator<< <LeftContainer, RightContainer>(QDebug out, const KBiAssociativeContainer<LeftContainer, RightContainer> &biHash);
419 protected:
420  LeftContainer _leftToRight;
421  RightContainer _rightToLeft;
422 };
423 
424 template<typename LeftContainer, typename RightContainer>
425 QDataStream &operator<<(QDataStream &out, const KBiAssociativeContainer<LeftContainer, RightContainer> &container)
426 {
427  return out << container._leftToRight;
428 }
429 
430 template<typename LeftContainer, typename RightContainer>
431 QDataStream &operator>>(QDataStream &in, KBiAssociativeContainer<LeftContainer, RightContainer> &container)
432 {
433  LeftContainer leftToRight;
434  in >> leftToRight;
435  typename LeftContainer::const_iterator it = leftToRight.constBegin();
436  const typename LeftContainer::const_iterator end = leftToRight.constEnd();
437  for (; it != end; ++it)
438  container.insert(it.key(), it.value());
439 
440  return in;
441 }
442 
443 template<typename Container, typename T, typename U>
444 struct _containerType
445 {
446  operator const char *();
447 };
448 
449 template<typename T, typename U>
450 struct _containerType<QHash<T, U>, T, U>
451 {
452  operator const char *()
453  {
454  return "QHash";
455  }
456 };
457 
458 template<typename T, typename U>
459 struct _containerType<QMap<T, U>, T, U>
460 {
461  operator const char *()
462  {
463  return "QMap";
464  }
465 };
466 
467 
468 template<typename Container>
469 static const char * containerType()
470 {
471  return _containerType<Container, typename Container::key_type, typename Container::mapped_type>();
472 }
473 
474 template<typename LeftContainer, typename RightContainer>
475 QDebug operator<<(QDebug out, const KBiAssociativeContainer<LeftContainer, RightContainer> &container)
476 {
477  typename KBiAssociativeContainer<LeftContainer, RightContainer>::left_const_iterator it = container.leftConstBegin();
478 
479  const typename KBiAssociativeContainer<LeftContainer, RightContainer>::left_const_iterator end = container.leftConstEnd();
480  out.nospace() << "KBiAssociativeContainer<" << containerType<LeftContainer>() << ", " << containerType<RightContainer>() << ">" << "(";
481  for (; it != end; ++it)
482  out << "(" << it.key() << " <=> " << it.value() << ") ";
483 
484  out << ")";
485  return out;
486 }
487 
495 template <typename T, typename U>
496 struct KBiHash : public KBiAssociativeContainer<QHash<T, U>, QHash<U, T> >
497 {
498  KBiHash()
499  : KBiAssociativeContainer<QHash<T, U>, QHash<U, T> > ()
500  {
501 
502  }
503 
504  KBiHash(const KBiAssociativeContainer<QHash<T, U>, QHash<U, T> > &container)
505  : KBiAssociativeContainer<QHash<T, U>, QHash<U, T> > (container)
506  {
507 
508  }
509 };
510 
511 template<typename T, typename U>
512 QDebug operator<<(QDebug out, const KBiHash<T, U> &biHash)
513 {
514  typename KBiHash<T, U>::left_const_iterator it = biHash.leftConstBegin();
515 
516  const typename KBiHash<T, U>::left_const_iterator end = biHash.leftConstEnd();
517  out.nospace() << "KBiHash(";
518  for (; it != end; ++it)
519  out << "(" << it.key() << " <=> " << it.value() << ") ";
520 
521  out << ")";
522  return out;
523 }
524 
525 template <typename T, typename U>
526 struct KHash2Map : public KBiAssociativeContainer<QHash<T, U>, QMap<U, T> >
527 {
528  KHash2Map()
529  : KBiAssociativeContainer<QHash<T, U>, QMap<U, T> > ()
530  {
531 
532  }
533 
534  KHash2Map(const KBiAssociativeContainer<QHash<T, U>, QMap<U, T> > &container)
535  : KBiAssociativeContainer<QHash<T, U>, QMap<U, T> > (container)
536  {
537 
538  }
539 
540  typename KBiAssociativeContainer<QHash<T, U>, QMap<U, T> >::right_iterator rightLowerBound(const U &key)
541  {
542  return this->_rightToLeft.lowerBound(key);
543  }
544 
545  typename KBiAssociativeContainer<QHash<T, U>, QMap<U, T> >::right_const_iterator rightLowerBound(const U &key) const
546  {
547  return this->_rightToLeft.lowerBound(key);
548  }
549 
550  typename KBiAssociativeContainer<QHash<T, U>, QMap<U, T> >::right_iterator rightUpperBound(const U &key)
551  {
552  return this->_rightToLeft.upperBound(key);
553  }
554 
555  typename KBiAssociativeContainer<QHash<T, U>, QMap<U, T> >::right_const_iterator rightUpperBound(const U &key) const
556  {
557  return this->_rightToLeft.upperBound(key);
558  }
559 };
560 
561 template<typename T, typename U>
562 QDebug operator<<(QDebug out, const KHash2Map<T, U> &container)
563 {
564  typename KHash2Map<T, U>::left_const_iterator it = container.leftConstBegin();
565 
566  const typename KHash2Map<T, U>::left_const_iterator end = container.leftConstEnd();
567  out.nospace() << "KHash2Map(";
568  for (; it != end; ++it)
569  out << "(" << it.key() << " <=> " << it.value() << ") ";
570 
571  out << ")";
572  return out;
573 }
574 
575 #endif
KBiAssociativeContainer::left_const_iterator
LeftContainer::const_iterator left_const_iterator
Definition: kbihash_p.h:123
KBiAssociativeContainer::removeLeft
bool removeLeft(left_type t)
Definition: kbihash_p.h:136
KBiAssociativeContainer::KBiAssociativeContainer
KBiAssociativeContainer(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:128
_containerType
Definition: kbihash_p.h:444
KHash2Map::KHash2Map
KHash2Map(const KBiAssociativeContainer< QHash< T, U >, QMap< U, T > > &container)
Definition: kbihash_p.h:534
KBiAssociativeContainer::leftEnd
left_const_iterator leftEnd() const
Definition: kbihash_p.h:363
KBiAssociativeContainer::leftConstEnd
left_const_iterator leftConstEnd() const
Definition: kbihash_p.h:371
KBiAssociativeContainer::rightBegin
right_const_iterator rightBegin() const
Definition: kbihash_p.h:383
KBiAssociativeContainer::eraseRight
right_iterator eraseRight(right_iterator it)
Definition: kbihash_p.h:222
KBiAssociativeContainer::KBiAssociativeContainer
KBiAssociativeContainer()
Definition: kbihash_p.h:127
KBiAssociativeContainer::findLeft
left_const_iterator findLeft(left_type t) const
Definition: kbihash_p.h:238
KBiAssociativeContainer::operator=
const KBiAssociativeContainer< LeftContainer, RightContainer > & operator=(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:132
KBiAssociativeContainer::eraseLeft
left_iterator eraseLeft(left_iterator it)
Definition: kbihash_p.h:228
KBiAssociativeContainer::reserve
void reserve(int size)
Definition: kbihash_p.h:186
QDataStream
KBiAssociativeContainer::detach
void detach()
Definition: kbihash_p.h:194
QMap::constBegin
const_iterator constBegin() const
KBiAssociativeContainer::operator==
bool operator==(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:333
QMap
KBiAssociativeContainer::constFindLeft
left_const_iterator constFindLeft(left_type t) const
Definition: kbihash_p.h:242
KBiAssociativeContainer::takeLeft
right_type takeLeft(left_type t)
Definition: kbihash_p.h:146
KBiAssociativeContainer::left_iterator
_iterator< LeftContainer > left_iterator
Definition: kbihash_p.h:122
KBiAssociativeContainer::subtract
KBiAssociativeContainer< LeftContainer, RightContainer > & subtract(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:286
KBiAssociativeContainer::_iterator::operator->
const Container::mapped_type * operator->() const
Definition: kbihash_p.h:110
KBiAssociativeContainer::_iterator::operator*
const Container::mapped_type & operator*() const
Definition: kbihash_p.h:107
KBiAssociativeContainer::squeeze
void squeeze()
Definition: kbihash_p.h:190
KBiAssociativeContainer::rightContains
bool rightContains(right_type u) const
Definition: kbihash_p.h:170
KBiAssociativeContainer::isSharedWith
bool isSharedWith(const KBiAssociativeContainer< RightContainer, LeftContainer > &other) const
Definition: kbihash_p.h:206
KBiAssociativeContainer::left_type
RightContainer::mapped_type left_type
Definition: kbihash_p.h:89
KBiAssociativeContainer::rightConstBegin
right_const_iterator rightConstBegin() const
Definition: kbihash_p.h:390
KBiAssociativeContainer::_iterator::_iterator
_iterator(const typename Container::iterator it)
Definition: kbihash_p.h:98
KBiAssociativeContainer::fromMap
static KBiAssociativeContainer< LeftContainer, RightContainer > fromMap(const QMap< left_type, right_type > &hash)
Definition: kbihash_p.h:407
KBiAssociativeContainer::findRight
right_const_iterator findRight(right_type u) const
Definition: kbihash_p.h:250
KBiAssociativeContainer::operator[]
const right_type operator[](const left_type &t) const
Definition: kbihash_p.h:329
KBiAssociativeContainer
Definition: kbihash_p.h:32
KBiAssociativeContainer::leftContains
bool leftContains(left_type t) const
Definition: kbihash_p.h:166
KBiAssociativeContainer::updateLeft
void updateLeft(right_iterator it, left_type t)
Definition: kbihash_p.h:317
KBiAssociativeContainer::right_const_iterator
RightContainer::const_iterator right_const_iterator
Definition: kbihash_p.h:125
KBiAssociativeContainer::right_iterator
_iterator< RightContainer > right_iterator
Definition: kbihash_p.h:124
containerType
static const char * containerType()
Definition: kbihash_p.h:469
KBiAssociativeContainer::intersect
KBiAssociativeContainer< LeftContainer, RightContainer > & intersect(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:275
KBiAssociativeContainer::operator!=
bool operator!=(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:337
QHash::constEnd
const_iterator constEnd() const
QHash
KBiAssociativeContainer::rightConstEnd
right_const_iterator rightConstEnd() const
Definition: kbihash_p.h:394
operator>>
QDataStream & operator>>(QDataStream &in, KBiAssociativeContainer< LeftContainer, RightContainer > &container)
Definition: kbihash_p.h:431
KBiAssociativeContainer::insert
left_iterator insert(left_type t, right_type u)
Definition: kbihash_p.h:258
QMap::constEnd
const_iterator constEnd() const
KBiAssociativeContainer::_rightToLeft
RightContainer _rightToLeft
Definition: kbihash_p.h:421
KBiAssociativeContainer::unite
KBiAssociativeContainer< LeftContainer, RightContainer > & unite(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:297
QMap::const_iterator
KBiAssociativeContainer::leftBegin
left_iterator leftBegin()
Definition: kbihash_p.h:351
KBiAssociativeContainer::toLeftIterator
left_iterator toLeftIterator(right_iterator it) const
Definition: kbihash_p.h:341
QList
KHash2Map::rightLowerBound
KBiAssociativeContainer< QHash< T, U >, QMap< U, T > >::right_iterator rightLowerBound(const U &key)
Definition: kbihash_p.h:540
KBiHash
KBiHash provides a bi-directional hash container.
Definition: kbihash_p.h:496
KHash2Map::rightLowerBound
KBiAssociativeContainer< QHash< T, U >, QMap< U, T > >::right_const_iterator rightLowerBound(const U &key) const
Definition: kbihash_p.h:545
KBiAssociativeContainer::right_type
LeftContainer::mapped_type right_type
Definition: kbihash_p.h:90
QMap::lowerBound
iterator lowerBound(const Key &key)
KBiAssociativeContainer::leftBegin
left_const_iterator leftBegin() const
Definition: kbihash_p.h:359
KBiAssociativeContainer::takeRight
left_type takeRight(right_type u)
Definition: kbihash_p.h:152
KBiAssociativeContainer::findRight
right_iterator findRight(right_type u)
Definition: kbihash_p.h:246
KBiAssociativeContainer::isEmpty
bool isEmpty() const
Definition: kbihash_p.h:325
KBiHash::KBiHash
KBiHash()
Definition: kbihash_p.h:498
KBiAssociativeContainer::capacity
int capacity() const
Definition: kbihash_p.h:182
KBiAssociativeContainer::_iterator::_iterator
_iterator(void *data)
Definition: kbihash_p.h:96
QDebug
KHash2Map
Definition: kbihash_p.h:526
KBiAssociativeContainer::setSharable
void setSharable(bool sharable)
Definition: kbihash_p.h:202
KBiAssociativeContainer::_leftToRight
LeftContainer _leftToRight
Definition: kbihash_p.h:420
KBiAssociativeContainer::leftEnd
left_iterator leftEnd()
Definition: kbihash_p.h:355
QHash::const_iterator
KBiAssociativeContainer::rightEnd
right_iterator rightEnd()
Definition: kbihash_p.h:379
KHash2Map::rightUpperBound
KBiAssociativeContainer< QHash< T, U >, QMap< U, T > >::right_iterator rightUpperBound(const U &key)
Definition: kbihash_p.h:550
KBiAssociativeContainer::clear
void clear()
Definition: kbihash_p.h:210
QHash::constBegin
const_iterator constBegin() const
KBiHash::KBiHash
KBiHash(const KBiAssociativeContainer< QHash< T, U >, QHash< U, T > > &container)
Definition: kbihash_p.h:504
KBiAssociativeContainer::findLeft
left_iterator findLeft(left_type t)
Definition: kbihash_p.h:234
KBiAssociativeContainer::_iterator::value
const Container::mapped_type & value() const
Definition: kbihash_p.h:104
QMap::upperBound
iterator upperBound(const Key &key)
operator*
Vec3 operator*(double r, const Vec3 &c1)
Definition: attlib.cpp:133
KBiAssociativeContainer::rightToLeft
left_type rightToLeft(right_type u) const
Definition: kbihash_p.h:158
KBiAssociativeContainer::leftToRight
right_type leftToRight(left_type t) const
Definition: kbihash_p.h:162
KBiAssociativeContainer::constFindRight
right_const_iterator constFindRight(right_type u) const
Definition: kbihash_p.h:254
KHash2Map::KHash2Map
KHash2Map()
Definition: kbihash_p.h:528
KBiAssociativeContainer::updateRight
void updateRight(left_iterator it, right_type u)
Definition: kbihash_p.h:309
KBiAssociativeContainer::fromHash
static KBiAssociativeContainer< LeftContainer, RightContainer > fromHash(const QHash< left_type, right_type > &hash)
Definition: kbihash_p.h:398
KBiAssociativeContainer::leftConstBegin
left_const_iterator leftConstBegin() const
Definition: kbihash_p.h:367
KBiAssociativeContainer::leftValues
QList< left_type > leftValues() const
Definition: kbihash_p.h:214
KBiAssociativeContainer::_iterator
Definition: kbihash_p.h:93
KBiAssociativeContainer::size
int size() const
Definition: kbihash_p.h:174
KHash2Map::rightUpperBound
KBiAssociativeContainer< QHash< T, U >, QMap< U, T > >::right_const_iterator rightUpperBound(const U &key) const
Definition: kbihash_p.h:555
KBiAssociativeContainer::isDetached
bool isDetached() const
Definition: kbihash_p.h:198
KBiAssociativeContainer::count
int count() const
Definition: kbihash_p.h:178
KBiAssociativeContainer::rightEnd
right_const_iterator rightEnd() const
Definition: kbihash_p.h:387
QMap::iterator
KBiAssociativeContainer::rightValues
QList< right_type > rightValues() const
Definition: kbihash_p.h:218
KBiAssociativeContainer::toRightIterator
right_iterator toRightIterator(left_iterator it) const
Definition: kbihash_p.h:346
KBiAssociativeContainer::rightBegin
right_iterator rightBegin()
Definition: kbihash_p.h:375
KBiAssociativeContainer::removeRight
bool removeRight(right_type u)
Definition: kbihash_p.h:141
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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