Design Patterns
list_interface.h
Go to the documentation of this file.
1 // Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
2 // book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
3 //
4 // Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
5 
6 #ifndef OPERATIONAL_ITERATOR_LIST_INTERFACE_H_
7 #define OPERATIONAL_ITERATOR_LIST_INTERFACE_H_
8 
9 namespace operational
10 {
11 namespace iterator
12 {
13 template<class Item>
15 {
16  public:
17  virtual ~ListInterface() { }
18 
19  virtual long Count() const = 0;
20 
21  virtual Item &Get(long index) const = 0;
22  virtual Item &First() const = 0;
23  virtual Item &Last() const = 0;
24 
25  virtual bool Includes(const Item& anItem) const = 0;
26 
27  virtual void Append(const Item& anItem) = 0;
28  virtual void Prepend(const Item& anItem) = 0;
29 
30  virtual void Remove(const Item& anItem) = 0;
31  virtual void RemoveAt(long index) = 0;
32  virtual void RemoveLast() = 0;
33  virtual void RemoveFirst() = 0;
34  virtual void RemoveAll() = 0;
35 
36  virtual Item &Top() const = 0;
37 
38  virtual void Push(const Item& anItem) = 0;
39 
40  virtual Item &Pop() = 0;
41 };
42 }
43 }
44 
45 #endif
46 
virtual bool Includes(const Item &anItem) const =0
virtual ~ListInterface()
Definition: list_interface.h:17
virtual void Push(const Item &anItem)=0
virtual void RemoveAt(long index)=0
virtual Item & Top() const =0
Definition: application.cc:10
virtual long Count() const =0
virtual Item & First() const =0
Definition: list_interface.h:14
virtual void Prepend(const Item &anItem)=0
virtual void Append(const Item &anItem)=0
virtual void Remove(const Item &anItem)=0
virtual Item & Last() const =0
virtual Item & Get(long index) const =0