home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IRKEYBAG.H
< prev
next >
Wrap
Text File
|
1993-09-22
|
5KB
|
130 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. *
* *
*******************************************************************************/
#ifndef _IRKEYBAG_H
#define _IRKEYBAG_H
#include <iakeybag.h>
template < class Element, class Key, class Base >
class IRKeyBag : public virtual IAKeyBag < Element, Key > {
Base &ivBase;
public:
IRKeyBag (Base& base) : ivBase (base) {};
~IRKeyBag ();
IBoolean add (Element const&);
IBoolean add (Element const&,
ICursor&);
Element const& elementAt (ICursor const&) const;
Element& elementAt (ICursor const&);
Element const& anyElement () const;
void removeAt (ICursor const&);
INumber removeAll (IBoolean (*property)
(Element const&, void*),
void* additionalArgument = 0);
void replaceAt (ICursor const&,
Element const&);
void removeAll ();
IBoolean isBounded () const;
INumber maxNumberOfElements () const;
INumber numberOfElements () const;
IBoolean isEmpty () const;
IBoolean isFull () const;
ICursor* newCursor () const;
IBoolean setToFirst (ICursor&) const;
IBoolean setToNext (ICursor&) const;
IBoolean allElementsDo (IBoolean (*function)
(Element&, void*),
void* additionalArgument = 0);
IBoolean allElementsDo (IIterator <Element>&);
IBoolean allElementsDo (IBoolean (*function)
(Element const&, void*),
void* additionalArgument = 0)
const;
IBoolean allElementsDo (IConstantIterator
<Element>&) const;
IBoolean isConsistent () const;
Key const& key (Element const&) const;
IBoolean containsElementWithKey (Key const&) const;
IBoolean locateElementWithKey (Key const&, ICursor&)
const;
IBoolean replaceElementWithKey (Element const&);
IBoolean replaceElementWithKey (Element const&,
ICursor&);
IBoolean locateOrAddElementWithKey (Element const&);
IBoolean locateOrAddElementWithKey (Element const&,
ICursor&);
IBoolean addOrReplaceElementWithKey (Element const&);
IBoolean addOrReplaceElementWithKey (Element const&,
ICursor&);
IBoolean removeElementWithKey (Key const&);
Element const& elementWithKey (Key const&) const;
Element& elementWithKey (Key const&);
INumber numberOfElementsWithKey (Key const&) const;
IBoolean locateNextElementWithKey (Key const&,
ICursor&) const;
INumber removeAllElementsWithKey (Key const&);
INumber numberOfDifferentKeys () const;
IBoolean setToNextWithDifferentKey (ICursor&) const;
protected:
void* identity () const;
};
#ifdef __IBMCPP__
#ifndef __TEMPINC__
#include <irkeybag.c>
#endif
#endif
#endif