Bag  0.91
BagInterface.h
Go to the documentation of this file.
1 // Created by Frank M. Carrano and Timothy M. Henry.
2 // Copyright (c) 2017 Pearson Education, Hoboken, New Jersey.
5 #ifndef BAG_INTERFACE_
6 #define BAG_INTERFACE_
7 
8 #include <vector>
9 
10 template<class ItemType>
12 {
13 public:
16  virtual int getCurrentSize() const = 0;
17 
20  virtual bool isEmpty() const = 0;
21 
27  virtual bool add(const ItemType& newEntry) = 0;
28 
35  virtual bool remove(const ItemType& anEntry) = 0;
36 
39  virtual void clear() = 0;
40 
44  virtual int getFrequencyOf(const ItemType& anEntry) const = 0;
45 
49  virtual bool contains(const ItemType& anEntry) const = 0;
50 
54  virtual std::vector<ItemType> toVector() const = 0;
55 
57  virtual ~BagInterface() { }
58 }; // end BagInterface
59 #endif