![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TComparator
Inherited By:
None.
Purpose:
Compares attributes based on their names and categories. When an attribute is added to an attribute group, this comparator is used to see if there are any attributes currently in the group with the same name and category as the attribute to be added. If so, the corresponding attribute is removed from the group before the new attribute is added.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
This is a concrete class.
Concurrency:
Multithread safe.
Resource Use:
This comparator expects the member function NamesMatch to be defined for the objects that it is to be applied to.
TNamesMatchComparator ()
Interface Category:
API.
Purpose:
Default constructor.
Calling Context:
Called directly in order to allocate a TNamesMatchComparator object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None
virtual ~ TNamesMatchComparator ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None
virtual EComparisonResult Compare (const AType & leftObj, const AType & rightObj) const
Interface Category:
API.
Purpose:
Returns the result of calling NamesMatch on the two objects.
Calling Context:
Called directly to compare the names and categories of two objects.
Parameters:
- const AType & leftObj -The object to be compared with rightObj.
- const AType & rightObj -The object to be compared with leftObj.
Return Value:
true if NamesMatch returns true, false otherwise.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
Requires that the member function NamesMatch is defined for both objects.
virtual HashResult GetHash (const AType & obj) const
Interface Category:
API.
Purpose:
Compute and return a hash value for the object based on the text returned by GetName and GetCategory.
Calling Context:
Called directly to get the hash value for an object based on the text returned by GetName and GetCategory for that object.
Parameters:
- const AType & obj -The object for which the hash value is to be computed.
Return Value:
Returns the hash value.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
Requires that the member functions GetName and GetCategory are defined for the given object. The member functions GetName and GetCategory must return references to objects for which the member function Hash is defined.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.