marble
kbihash_p.h
Go to the documentation of this file.
35 QDebug operator<<(QDebug out, const KBiAssociativeContainer<LeftContainer, RightContainer> &container);
38 QDataStream &operator<<(QDataStream &out, const KBiAssociativeContainer<LeftContainer, RightContainer> &container);
41 QDataStream &operator>>(QDataStream &in, KBiAssociativeContainer<LeftContainer, RightContainer> &container);
93 class _iterator : public _iterator_impl_ctor<Container, typename Container::key_type, typename Container::mapped_type>
99 : _iterator_impl_ctor<Container, typename Container::key_type, typename Container::mapped_type>(it)
128 inline KBiAssociativeContainer(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
132 const KBiAssociativeContainer<LeftContainer, RightContainer> &operator=(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
206 inline bool isSharedWith(const KBiAssociativeContainer<RightContainer, LeftContainer> &other) const {
207 return _leftToRight.isSharedWith(other._leftToRight) && _rightToLeft.isSharedWith(other._leftToRight);
260 // biHash.insert(5, 9); // replaces 5->7 with 5->9 in _leftToRight and inserts 9->5 in _rightToLeft.
263 // This means we need to hash u and t up to twice each. Could probably be done better using QHashNode.
275 KBiAssociativeContainer<LeftContainer, RightContainer> &intersect(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
276 typename KBiAssociativeContainer<RightContainer, LeftContainer>::left_iterator it = leftBegin();
286 KBiAssociativeContainer<LeftContainer, RightContainer> &subtract(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
287 typename KBiAssociativeContainer<RightContainer, LeftContainer>::left_iterator it = leftBegin();
297 KBiAssociativeContainer<LeftContainer, RightContainer> &unite(const KBiAssociativeContainer<LeftContainer, RightContainer> &other) {
398 static KBiAssociativeContainer<LeftContainer, RightContainer> fromHash(const QHash<left_type, right_type> &hash) {
407 static KBiAssociativeContainer<LeftContainer, RightContainer> fromMap(const QMap<left_type, right_type> &hash) {
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);
425 QDataStream &operator<<(QDataStream &out, const KBiAssociativeContainer<LeftContainer, RightContainer> &container)
431 QDataStream &operator>>(QDataStream &in, KBiAssociativeContainer<LeftContainer, RightContainer> &container)
471 return _containerType<Container, typename Container::key_type, typename Container::mapped_type>();
475 QDebug operator<<(QDebug out, const KBiAssociativeContainer<LeftContainer, RightContainer> &container)
477 typename KBiAssociativeContainer<LeftContainer, RightContainer>::left_const_iterator it = container.leftConstBegin();
479 const typename KBiAssociativeContainer<LeftContainer, RightContainer>::left_const_iterator end = container.leftConstEnd();
480 out.nospace() << "KBiAssociativeContainer<" << containerType<LeftContainer>() << ", " << containerType<RightContainer>() << ">" << "(";
540 typename KBiAssociativeContainer<QHash<T, U>, QMap<U, T> >::right_iterator rightLowerBound(const U &key)
545 typename KBiAssociativeContainer<QHash<T, U>, QMap<U, T> >::right_const_iterator rightLowerBound(const U &key) const
550 typename KBiAssociativeContainer<QHash<T, U>, QMap<U, T> >::right_iterator rightUpperBound(const U &key)
555 typename KBiAssociativeContainer<QHash<T, U>, QMap<U, T> >::right_const_iterator rightUpperBound(const U &key) const
LeftContainer::const_iterator left_const_iterator
Definition: kbihash_p.h:123
KBiAssociativeContainer(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:128
Definition: kbihash_p.h:444
KHash2Map(const KBiAssociativeContainer< QHash< T, U >, QMap< U, T > > &container)
Definition: kbihash_p.h:534
left_const_iterator leftConstEnd() const
Definition: kbihash_p.h:371
right_const_iterator rightBegin() const
Definition: kbihash_p.h:383
right_iterator eraseRight(right_iterator it)
Definition: kbihash_p.h:222
KBiAssociativeContainer()
Definition: kbihash_p.h:127
left_const_iterator findLeft(left_type t) const
Definition: kbihash_p.h:238
const KBiAssociativeContainer< LeftContainer, RightContainer > & operator=(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:132
left_iterator eraseLeft(left_iterator it)
Definition: kbihash_p.h:228
const_iterator constBegin() const
bool operator==(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:333
left_const_iterator constFindLeft(left_type t) const
Definition: kbihash_p.h:242
_iterator< LeftContainer > left_iterator
Definition: kbihash_p.h:122
KBiAssociativeContainer< LeftContainer, RightContainer > & subtract(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:286
const Container::mapped_type * operator->() const
Definition: kbihash_p.h:110
const Container::mapped_type & operator*() const
Definition: kbihash_p.h:107
bool rightContains(right_type u) const
Definition: kbihash_p.h:170
bool isSharedWith(const KBiAssociativeContainer< RightContainer, LeftContainer > &other) const
Definition: kbihash_p.h:206
right_const_iterator rightConstBegin() const
Definition: kbihash_p.h:390
_iterator(const typename Container::iterator it)
Definition: kbihash_p.h:98
static KBiAssociativeContainer< LeftContainer, RightContainer > fromMap(const QMap< left_type, right_type > &hash)
Definition: kbihash_p.h:407
right_const_iterator findRight(right_type u) const
Definition: kbihash_p.h:250
const right_type operator[](const left_type &t) const
Definition: kbihash_p.h:329
Definition: kbihash_p.h:32
bool leftContains(left_type t) const
Definition: kbihash_p.h:166
void updateLeft(right_iterator it, left_type t)
Definition: kbihash_p.h:317
RightContainer::const_iterator right_const_iterator
Definition: kbihash_p.h:125
_iterator< RightContainer > right_iterator
Definition: kbihash_p.h:124
KBiAssociativeContainer< LeftContainer, RightContainer > & intersect(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:275
bool operator!=(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:337
const_iterator constEnd() const
right_const_iterator rightConstEnd() const
Definition: kbihash_p.h:394
QDataStream & operator>>(QDataStream &in, KBiAssociativeContainer< LeftContainer, RightContainer > &container)
Definition: kbihash_p.h:431
left_iterator insert(left_type t, right_type u)
Definition: kbihash_p.h:258
const_iterator constEnd() const
KBiAssociativeContainer< LeftContainer, RightContainer > & unite(const KBiAssociativeContainer< LeftContainer, RightContainer > &other)
Definition: kbihash_p.h:297
left_iterator toLeftIterator(right_iterator it) const
Definition: kbihash_p.h:341
KBiAssociativeContainer< QHash< T, U >, QMap< U, T > >::right_iterator rightLowerBound(const U &key)
Definition: kbihash_p.h:540
KBiAssociativeContainer< QHash< T, U >, QMap< U, T > >::right_const_iterator rightLowerBound(const U &key) const
Definition: kbihash_p.h:545
iterator lowerBound(const Key &key)
Definition: kbihash_p.h:526
KBiAssociativeContainer< QHash< T, U >, QMap< U, T > >::right_iterator rightUpperBound(const U &key)
Definition: kbihash_p.h:550
const_iterator constBegin() const
KBiHash(const KBiAssociativeContainer< QHash< T, U >, QHash< U, T > > &container)
Definition: kbihash_p.h:504
const Container::mapped_type & value() const
Definition: kbihash_p.h:104
iterator upperBound(const Key &key)
left_type rightToLeft(right_type u) const
Definition: kbihash_p.h:158
right_type leftToRight(left_type t) const
Definition: kbihash_p.h:162
right_const_iterator constFindRight(right_type u) const
Definition: kbihash_p.h:254
void updateRight(left_iterator it, right_type u)
Definition: kbihash_p.h:309
static KBiAssociativeContainer< LeftContainer, RightContainer > fromHash(const QHash< left_type, right_type > &hash)
Definition: kbihash_p.h:398
left_const_iterator leftConstBegin() const
Definition: kbihash_p.h:367
QList< left_type > leftValues() const
Definition: kbihash_p.h:214
Definition: kbihash_p.h:93
KBiAssociativeContainer< QHash< T, U >, QMap< U, T > >::right_const_iterator rightUpperBound(const U &key) const
Definition: kbihash_p.h:555
QList< right_type > rightValues() const
Definition: kbihash_p.h:218
right_iterator toRightIterator(left_iterator it) const
Definition: kbihash_p.h:346
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
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.