Om
element.cpp
Go to the documentation of this file.
1 
15 #ifndef Om_Language_Element_
16 
17  #include "om/language/element.hpp"
18 
19 #else
20 
21 // MARK: - Om::Language::Element
22 
23  #define Type_ \
24  Om::Language::Element
25 
26 // MARK: public (non-static)
27 
28 inline Type_::~Element() {}
29 
30 inline Om::Language::Program & Type_::operator *() {
31  assert(0);
32  throw std::logic_error("Pure virtual function called.");
33 }
34 
35 inline Om::Language::Program const & Type_::operator *() const {
36  assert(0);
37  throw std::logic_error("Pure virtual function called.");
38 }
39 
40 inline Om::Language::Program * Type_::operator ->() {
41  return &**this;
42 }
43 
44 inline Om::Language::Program const * Type_::operator ->() const {
45  return &**this;
46 }
47 
48 inline bool Type_::Equals(Element const &) const {
49  assert(0);
50  throw std::logic_error("Pure virtual function called.");
51 }
52 
53 inline std::auto_ptr<
55 > Type_::GetElementRange() {
56  assert(0);
57  throw std::logic_error("Pure virtual function called.");
58 }
59 
60 inline bool Type_::Merge(Operator &) {
61  return false;
62 }
63 
64 inline bool Type_::Merge(Operator const &) {
65  return false;
66 }
67 
68 inline bool Type_::Merge(Separator &) {
69  return false;
70 }
71 
72 inline bool Type_::Merge(Separator const &) {
73  return false;
74 }
75 
76 // MARK: - Om::Language::
77 
78 inline bool Om::Language::operator ==(
79  Type_ const & theFirst,
80  Type_ const & theSecond
81 ) {
82  return theFirst.Equals(theSecond);
83 }
84 
85 inline bool Om::Language::operator !=(
86  Type_ const & theFirst,
87  Type_ const & theSecond
88 ) {
89  return !theFirst.Equals(theSecond);
90 }
91 
92 inline Type_ * Om::Language::new_clone(Type_ const & theCopyable) {
93  return Copy(theCopyable).release();
94 }
95 
96  #undef Type_
97 
98 #endif
The Program implementation.
Definition: program.hpp:62
Any object that items can be pulled from.
Definition: source.hpp:31
Om header file.
bool operator!=(DefaultAtom< TheImplementation > const &, DefaultAtom< TheImplementation > const &)
Atom * new_clone(Atom const &)
bool operator==(DefaultAtom< TheImplementation > const &, DefaultAtom< TheImplementation > const &)
std::auto_ptr< TheCopyable > Copy(TheCopyable const &)