home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) IBM Corp. 1992 */
-
- #ifndef _IRKEYSET_H
- #define _IRKEYSET_H
-
- #include <iakeyset.h>
-
- template < class Element, class Key, class Base >
- class IRKeySet : public virtual IAKeySet < Element, Key > {
- Base &ivBase;
- public:
-
- IRKeySet (Base& base) : ivBase (base) {};
-
- ~IRKeySet ();
-
- Boolean add (Element const&);
-
- Boolean add (Element const&,
- ICursor&);
-
- Element const& elementAt (ICursor const&) const;
-
- Element& elementAt (ICursor const&);
-
- Element const& anyElement () const;
-
- void removeAt (ICursor const&);
-
- INumber removeAll (Boolean (*property)
- (Element const&, void*),
- void* additionalArgument = 0);
-
- void replaceAt (ICursor const&,
- Element const&);
-
- void removeAll ();
-
- Boolean isBounded () const;
-
- INumber maxNumberOfElements () const;
-
- INumber numberOfElements () const;
-
- Boolean isEmpty () const;
-
- Boolean isFull () const;
-
- ICursor* newCursor () const;
-
- Boolean setToFirst (ICursor&) const;
-
- Boolean setToNext (ICursor&) const;
-
- Boolean allElementsDo (Boolean (*function)
- (Element&, void*),
- void* additionalArgument = 0);
-
- Boolean allElementsDo (IIterator <Element>&);
-
- Boolean allElementsDo (Boolean (*function)
- (Element const&, void*),
- void* additionalArgument = 0)
- const;
-
- Boolean allElementsDo (IConstantIterator
- <Element>&) const;
-
- Key const& key (Element const&) const;
-
- Boolean containsElementWithKey (Key const&) const;
-
- Boolean locateElementWithKey (Key const&, ICursor&)
- const;
-
- Boolean replaceElementWithKey (Element const&);
-
- Boolean replaceElementWithKey (Element const&,
- ICursor&);
-
- Boolean locateOrAddElementWithKey (Element const&);
-
- Boolean locateOrAddElementWithKey (Element const&,
- ICursor&);
-
- Boolean addOrReplaceElementWithKey (Element const&);
-
- Boolean addOrReplaceElementWithKey (Element const&,
- ICursor&);
-
- Boolean removeElementWithKey (Key const&);
-
- Element const& elementWithKey (Key const&) const;
-
- Element& elementWithKey (Key const&);
-
- };
-
- #ifdef __IBMCPP__
- #include <irkeyset.c>
- #endif
-
- #endif