Om
container_back_source.hpp
Go to the documentation of this file.
1 
15 #ifndef Om_Source_ContainerBackSource_
16 
17  #define Om_Source_ContainerBackSource_ \
18  Om::Source::ContainerBackSource
19 
21 
22 namespace Om {
23 
24  namespace Source {
25 
26  // MARK: - Om::Source::ContainerBackSource
27 
32  template <
33  typename ThisItem,
34  typename ThisContainer
35  >
37  public DefaultSource<
38  ThisItem,
39  ContainerBackSource<
40  ThisItem,
41  ThisContainer
42  >
43  > {
44 
45  public: // MARK: public (non-static)
46 
47  explicit ContainerBackSource(ThisContainer &);
48 
50 
51  virtual bool operator !() const;
52 
53  virtual ThisItem & operator *() const;
54 
55  using DefaultSource<
56  ThisItem,
58  ThisItem,
59  ThisContainer
60  >
61  >::Equals;
62 
63  bool Equals(ContainerBackSource const &) const;
64 
65  virtual void Pop();
66 
68 
69  private: // MARK: private (non-static)
70 
75  ThisContainer & thisContainer;
76 
77  };
78 
79  // MARK: - Om::Source::
80 
81  template <
82  typename TheItem,
83  typename TheContainer
84  >
87  TheItem,
88  TheContainer
89  > const &,
91  TheItem,
92  TheContainer
93  > const &
94  );
95 
96  template <
97  typename TheItem,
98  typename TheContainer
99  >
102  TheItem,
103  TheContainer
104  > const &,
106  TheItem,
107  TheContainer
108  > const &
109  );
110 
111  }
112 
113 }
114 
115 namespace boost {
116 
117  // MARK: - boost::
118 
119  template <
120  typename TheItem,
121  typename TheContainer
122  >
123  void swap(
125  TheItem,
126  TheContainer
127  > &,
129  TheItem,
130  TheContainer
131  > &
132  );
133 
134 }
135 
137 
138 #endif
A Source adapter for a container; pulls items from the back.
ContainerBackSource & operator=(ContainerBackSource)
ContainerBackSource(ThisContainer &)
virtual ThisItem & operator*() const
bool Equals(ContainerBackSource const &) const
virtual void Pop()
Pops the current item.
virtual bool operator!() const
void Swap(ContainerBackSource &)
ThisContainer & thisContainer
The container to pull from.
A partial implementation of Source.
Om header file.
bool operator==(CodePointSource< TheCodeUnitIterator > const &, CodePointSource< TheCodeUnitIterator > const &)
bool operator!=(CodePointSource< TheCodeUnitIterator > const &, CodePointSource< TheCodeUnitIterator > const &)
The Om library.
Definition: code_point.hpp:26
void swap(Om::Language::Expression &, Om::Language::Expression &)