_ItemComparer (Compact 2013)

3/28/2014

This C++ class provides methods that compare two objects or two text strings to determine whether a specified object or text string is contained in a collection of enumerated data source objects.

Syntax

 class _ItemComparer 

Members

Methods

Methods

Description

_ItemComparer.AreObjectsEqual(const Type&,const Type&)

Determines whether the specified objects are equal to each other.

_ItemComparer.AreObjectsEqual(const StringType &,const StringType &)

Determines whether the specified text strings are equal to each other.

Thread Safety

Members of this class are not thread safe when you add, remove, update, or clear the objects in the collection. When you are updating objects with new data from the data provider, implement single-threading and block other operations until the update is finished.

Remarks

The _ItemComparer class is the default value of the ItemComparer template parameter in _XRValueCollectionBaseT<IFace,ItemType,ItemComparer,ItemConverter,ItemLifeManager>. It provides the default functionality to compare a specified object or text string with an object or text string that is stored in a data source collection.

You can create a derived class that inherits from _ItemComparer. You can then provide a custom implementation of the AreObjectsEqual methods that you use to determine whether an object or text string currently exists in a collection.

Specify the derived class in the ItemComparer template parameter in the _XRValueCollectionBaseT<IFace,ItemType,ItemComparer,ItemConverter,ItemLifeManager> class.

Requirements

Header

XRCollection.h

See Also

Reference

Classes for Populating UI Elements with Data