Om
sink.cpp
Go to the documentation of this file.
1 
15 #ifndef Om_Sink_Sink_
16 
17  #include "om/sink/sink.hpp"
18 
19 #else
20 
21  #ifndef Om_Macro_Precompilation_
22 
23  #include <cassert>
24  #include <stdexcept>
25 
26  #endif
27 
28 // MARK: - Om::Sink::Sink
29 
30  #define Template_ \
31  template <typename ThisItem>
32 
33  #define Type_ \
34  Om::Sink::Sink<ThisItem>
35 
36 // MARK: public (non-static)
37 
38 Template_
39 inline Type_::~Sink() {}
40 
41 Template_
42 inline Type_ & Type_::operator =(ThisItem & theItem) {
43  this->Push(theItem);
44  return *this;
45 }
46 
47 Template_
48 inline Type_ & Type_::operator *() {
49  return *this;
50 }
51 
52 Template_
53 inline Type_ * Type_::operator ->() {
54  return this;
55 }
56 
57 Template_
58 inline void Type_::Push(ThisItem &) {
59  assert(0);
60  throw std::logic_error("Pure virtual function called.");
61 }
62 
63  #undef Type_
64  #undef Template_
65 
66 #endif
Om header file.