[Haiku-commits] r31186 - haiku/trunk/headers/private/shared

bonefish at BerliOS bonefish at mail.berlios.de
Mon Jun 22 23:41:17 CEST 2009


Author: bonefish
Date: 2009-06-22 23:41:16 +0200 (Mon, 22 Jun 2009)
New Revision: 31186
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31186&view=rev

Modified:
   haiku/trunk/headers/private/shared/ObjectList.h
Log:
Added BinarySearchIndex().


Modified: haiku/trunk/headers/private/shared/ObjectList.h
===================================================================
--- haiku/trunk/headers/private/shared/ObjectList.h	2009-06-22 20:52:15 UTC (rev 31185)
+++ haiku/trunk/headers/private/shared/ObjectList.h	2009-06-22 21:41:16 UTC (rev 31186)
@@ -203,6 +203,10 @@
 	T *BinarySearchByKey(const Key &key,
 		int (*compare)(const Key *, const T *, void *), void *state) const;
 
+	int32 BinarySearchIndex(const T &item, CompareFunction compare) const;
+	int32 BinarySearchIndex(const T &item, CompareFunctionWithState compare,
+		void *state) const;
+
 	// Binary insertion - list must be sorted with CompareFunction for
 	// these to work
 
@@ -671,6 +675,25 @@
 
 
 template<class T>
+int32
+BObjectList<T>::BinarySearchIndex(const T &item, CompareFunction compare) const
+{
+	return _PointerList_::BinarySearchIndex(&item,
+		(GenericCompareFunction)compare);
+}
+
+
+template<class T>
+int32
+BObjectList<T>::BinarySearchIndex(const T &item,
+	CompareFunctionWithState compare, void *state) const
+{
+	return _PointerList_::BinarySearchIndex(&item,
+		(GenericCompareFunctionWithState)compare, state);
+}
+
+
+template<class T>
 bool
 BObjectList<T>::BinaryInsert(T *item, CompareFunction func)
 {




More information about the Haiku-commits mailing list