home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / bbxxk / iaequal.c__ / IAEQUAL.C
Encoding:
Text File  |  1992-10-26  |  832 b   |  29 lines

  1. /* Copyright (c) IBM Corp. 1992 */
  2. template < class Element >
  3. Boolean IAEqualityCollection < Element >::
  4. isContained (Element const& element, void* env) {
  5.   return (*(IAEqualityCollection < Element >**) env)->contains (element);
  6. }
  7.  
  8. template < class Element >
  9. Boolean IAEqualityCollection < Element >::
  10. isNotContained (Element const& element, void* env) {
  11.   return ! (*(IAEqualityCollection < Element >**) env)->contains (element);
  12. }
  13.  
  14. template <class Element>
  15. Boolean IAEqualityCollection < Element >::
  16. containsAllFrom (IACollection < Element > const& collection) const {
  17.   Boolean result = True;
  18.   ICursor *cursor = collection.newCursor ();
  19.   forCursor (*cursor) {
  20.     if (! contains (collection.elementAt (*cursor))) {
  21.       result = False;
  22.       break;
  23.     }
  24.   }
  25.   delete cursor;
  26.   return result;
  27. };
  28.  
  29.