Design Patterns
iterator_ptr.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_ITERATOR_PTR_H_
7 #define OPERATIONAL_ITERATOR_ITERATOR_PTR_H_
8 
9 #include "iterator_interface.h"
10 
11 namespace operational
12 {
13 namespace iterator
14 {
15 template<class Item>
17 {
18  public:
20  ~IteratorPtr();
21 
24 
25  private:
26  IteratorPtr(const IteratorPtr&);
27  IteratorPtr &operator=(const IteratorPtr&);
28 
30 };
31 
32 template<class Item>
34 
35 template<class Item>
37 {
38  delete i_;
39 }
40 
41 template<class Item>
43 {
44  return i_;
45 }
46 
47 template<class Item>
49 {
50  return *i_;
51 }
52 
53 template<class Item>
55 
56 template<class Item>
57 IteratorPtr<Item> &IteratorPtr<Item>::operator=(const IteratorPtr&)
58 {
59  return {};
60 }
61 }
62 }
63 
64 #endif
65 
Definition: application.cc:10
~IteratorPtr()
Definition: iterator_ptr.h:36
IteratorInterface< Item > * operator->()
Definition: iterator_ptr.h:42
Definition: iterator_ptr.h:16
Definition: iterator_interface.h:14
IteratorInterface< Item > & operator*()
Definition: iterator_ptr.h:48
IteratorPtr(IteratorInterface< Item > *i)
Definition: iterator_ptr.h:33