home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IACLLCT.C
< prev
next >
Wrap
Text File
|
1993-09-22
|
2KB
|
45 lines
/*******************************************************************************
* *
* COPYRIGHT: *
* IBM C/C++ Tools Version 2.01 - Collection Class Library *
* Licensed Materials - Property of IBM *
* (C) Copyright IBM Corporation 1992, 1993 *
* All Rights Reserved *
* US Government Users Restricted Rights - Use, duplication, or disclosure *
* restricted by GSA ADP Schedule Contract with IBM Corp. *
* *
*******************************************************************************/
#include <ibexcept.h>
template <class Element>
IACollection <Element> ::~IACollection ()
{
}
template <class Element>
void IACollection < Element >::
addAllFrom (IACollection < Element > const& collection)
{ ICHECK (! isIdentical (collection),
IIdenticalCollectionException, IIdenticalCollectionText)
ICursor *cursor = collection.newCursor ();
forCursor (*cursor) {
add (collection.elementAt (*cursor));
}
delete cursor;
};
template <class Element>
void IACollection < Element >::
copy (IACollection < Element > const& collection)
{ if (! isIdentical (collection)) {
removeAll ();
addAllFrom (collection);
}
};
template <class Element>
void* IACollection < Element >::
identity () const
{ return (void*) this;
}