14 #include <omtReader/entityMapperKey.h>
31 void addEntry(T,
bool replace =
false);
33 T
find(
const DtEntityMapperKey& key)
const;
69 typename QList<T>::iterator it = this->begin();
71 while (it != this->end())
83 typename QList<T>::const_iterator it = rhs.begin();
85 while (it != rhs.end())
95 if (this->count() == 0)
102 T item = this->last();
103 DtEntityMapperKey sdKey = *entry;
111 item = this->first();
115 this->insert(0, entry);
119 QString strKey = entry->string().c_str();
121 unsigned int iLower = 0;
122 unsigned int iUpper = this->count() - 1;
124 while ((iUpper - iLower) != 1)
126 int iPos = (iUpper + iLower) / 2;
128 if (sdKey < *this->at(iPos))
132 else if (sdKey > *this->at(iPos))
136 else if ((sdKey == *this->at(iPos)) && replace)
138 *this->at(iPos) = *entry;
144 this->insert(iLower + 1, entry);
147 template <
typename T>
150 typename QList<T>::const_iterator iter = this->begin();
152 while (iter != this->end())
165 template <
typename T>
168 typename QList<T>::iterator iter = this->begin();
170 while (iter != this->end())
virtual ~DtOrderedKeyList()
Definition: orderedKeyList.h:61
void copyList(const DtOrderedKeyList &)
Definition: orderedKeyList.h:81
DtOrderedKeyList()
Definition: orderedKeyList.h:37
void addEntry(T, bool replace=false)
Adds a new entry, ordering it by key type.
Definition: orderedKeyList.h:93
T find(const DtEntityMapperKey &key) const
Definition: orderedKeyList.h:148
void clear()
Definition: orderedKeyList.h:67
T removeEntry(const DtEntityMapperKey &key)
Definition: orderedKeyList.h:166
DtOrderedKeyList & operator=(const DtOrderedKeyList &)
Definition: orderedKeyList.h:49
An ordered key list will allow lookup by entity key type.
Definition: orderedKeyList.h:17