Om
source.hpp
Go to the documentation of this file.
1 
15 #ifndef Om_Source_Source_
16 
17  #define Om_Source_Source_ \
18  Om::Source::Source
19 
20 namespace Om {
21 
22  namespace Source {
23 
24  // MARK: - Om::Source::Source
25 
30  template <typename ThisItem>
31  class Source {
32 
33  public: // MARK: public (static)
34 
39  typedef void (Source::* Boolean)() const;
40 
41  public: // MARK: public (non-static)
42 
43  virtual ~Source() = 0;
44 
45  virtual ThisItem & operator *() const = 0;
46 
47  ThisItem * operator ->() const;
48 
53  virtual bool operator !() const = 0;
54 
59  operator Boolean() const;
60 
65  virtual bool Equals(Source const &) const = 0;
66 
73  virtual void Pop() = 0;
74 
75  private: // MARK: private (non-static)
76 
77  Source & operator =(Source const &);
78 
79  void UncomparableBoolean() const;
80 
81  };
82 
83  }
84 
85  // MARK: - Om::
86 
87  template <typename TheItem>
91  );
92 
93  template <typename TheItem>
97  );
98 
99 }
100 
101  #include "om/source/source.cpp"
102 
103 #endif
Any object that items can be pulled from.
Definition: source.hpp:31
virtual ~Source()=0
void(Source::* Boolean)() const
The implementation of the Safe Boolean idiom.
Definition: source.hpp:39
Source & operator=(Source const &)
virtual bool Equals(Source const &) const =0
virtual ThisItem & operator*() const =0
virtual void Pop()=0
Pops the current item.
void UncomparableBoolean() const
virtual bool operator!() const =0
ThisItem * operator->() const
The Om library.
Definition: code_point.hpp:26
bool operator!=(Source::Source< TheItem > const &, Source::Source< TheItem > const &)
bool operator==(Source::Source< TheItem > const &, Source::Source< TheItem > const &)
Om source file.