home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) IBM Corp. 1992 */
-
- #ifndef _IRBAG_H
- #define _IRBAG_H
-
- #include <iabag.h>
-
- template < class Element, class Base >
- class IRBag : public virtual IABag < Element > {
- Base &ivBase;
- public:
-
- IRBag (Base& base) : ivBase (base) {};
-
- ~IRBag ();
-
- 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;
-
- Boolean contains (Element const&) const;
-
- Boolean locate (Element const&, ICursor&)
- const;
-
- Boolean locateOrAdd (Element const&);
-
- Boolean locateOrAdd (Element const&,
- ICursor&);
-
- Boolean remove (Element const&);
-
- INumber numberOfOccurrences (Element const&) const;
-
- Boolean locateNext (Element const&, ICursor&)
- const;
-
- INumber removeAllOccurrences (Element const&);
-
- INumber numberOfDifferentElements () const;
-
- Boolean setToNextDifferentElement (ICursor&) const;
-
- };
-
- #ifdef __IBMCPP__
- #include <irbag.c>
- #endif
-
- #endif