We now have a real list of displays.
displays can be dynamically added or removed, and the
list is part of the SF's transaction.
Change-Id: I4186ea39f1317c0e7c044f869004017738968fab
diff --git a/include/utils/KeyedVector.h b/include/utils/KeyedVector.h
index 20575ee..47c2c56 100644
--- a/include/utils/KeyedVector.h
+++ b/include/utils/KeyedVector.h
@@ -56,7 +56,10 @@
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 @@
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
@@ -123,6 +127,11 @@
}
template<typename KEY, typename VALUE> inline
+bool KeyedVector<KEY,VALUE>::isIdenticalTo(const KeyedVector<KEY,VALUE>& rhs) const {
+ return mVector.array() == rhs.mVector.array();
+}
+
+template<typename KEY, typename VALUE> inline
ssize_t KeyedVector<KEY,VALUE>::indexOfKey(const KEY& key) const {
return mVector.indexOf( key_value_pair_t<KEY,VALUE>(key) );
}
@@ -140,6 +149,11 @@
}
template<typename KEY, typename VALUE> inline
+const VALUE& KeyedVector<KEY,VALUE>::operator[] (size_t index) const {
+ return valueAt(index);
+}
+
+template<typename KEY, typename VALUE> inline
const KEY& KeyedVector<KEY,VALUE>::keyAt(size_t index) const {
return mVector.itemAt(index).key;
}