diff --git a/include/utils/KeyedVector.h b/include/utils/KeyedVector.h index 20575ee3e..47c2c56de 100644 --- a/include/utils/KeyedVector.h +++ b/include/utils/KeyedVector.h @@ -56,7 +56,10 @@ public: inline size_t capacity() const { return mVector.capacity(); } //! setst the capacity. capacity can never be reduced less than size() inline ssize_t setCapacity(size_t size) { return mVector.setCapacity(size); } - + + // returns true if the arguments is known to be identical to this vector + inline bool isIdenticalTo(const KeyedVector& rhs) const; + /*! * accessors */ @@ -64,6 +67,7 @@ public: const VALUE& valueAt(size_t index) const; const KEY& keyAt(size_t index) const; ssize_t indexOfKey(const KEY& key) const; + const VALUE& operator[] (size_t index) const; /*! * modifying the array @@ -122,6 +126,11 @@ KeyedVector::KeyedVector() { } +template inline +bool KeyedVector::isIdenticalTo(const KeyedVector& rhs) const { + return mVector.array() == rhs.mVector.array(); +} + template inline ssize_t KeyedVector::indexOfKey(const KEY& key) const { return mVector.indexOf( key_value_pair_t(key) ); @@ -139,6 +148,11 @@ const VALUE& KeyedVector::valueAt(size_t index) const { return mVector.itemAt(index).value; } +template inline +const VALUE& KeyedVector::operator[] (size_t index) const { + return valueAt(index); +} + template inline const KEY& KeyedVector::keyAt(size_t index) const { return mVector.itemAt(index).key;