Om
default_atom.hpp
Go to the documentation of this file.
1 
15 #ifndef Om_Language_DefaultAtom_
16 
17  #define Om_Language_DefaultAtom_ \
18  Om::Language::DefaultAtom
19 
20  #include "om/language/atom.hpp"
22 
23  #ifndef Om_Macro_Precompilation_
24 
25  #include <string>
26 
27  #endif
28 
29 namespace Om {
30 
31  namespace Language {
32 
33  // MARK: - Om::Language::DefaultAtom
34 
41  template <typename ThisImplementation>
42  class DefaultAtom:
43  public DefaultElement<
44  ThisImplementation,
45  Om::Language::Atom
46  > {
47 
48  public: // MARK: public (non-static)
49 
50  virtual ~DefaultAtom() = 0;
51 
58  bool operator <(DefaultAtom const &);
59 
60  virtual void Clear();
61 
62  using DefaultElement<
63  ThisImplementation,
64  Atom
65  >::Equals;
66 
67  bool Equals(DefaultAtom const &) const;
68 
69  bool Equals(ThisImplementation const &) const;
70 
71  virtual std::auto_ptr<
74 
75  virtual std::auto_ptr<
77  > GetElementRange() const;
78 
83  std::string const & GetString() const;
84 
91  virtual bool IsEmpty() const;
92 
93  using DefaultElement<
94  ThisImplementation,
95  Atom
96  >::Merge;
97 
102  virtual bool Merge(ThisImplementation &);
103 
107  virtual bool Merge(ThisImplementation const &);
108 
109  void Swap(ThisImplementation &);
110 
111  protected: // MARK: protected (non-static)
112 
114 
119  explicit DefaultAtom(
120  char const theCodeUnitIterator[]
121  );
122 
127  explicit DefaultAtom(char const theCodeUnit);
128 
133  std::string thisString;
134 
135  private: // MARK: private (non-static)
136 
138 
139  };
140 
141  // MARK: - Om::Language::
142 
143  template <typename TheImplementation>
147  );
148 
149  template <typename TheImplementation>
153  );
154 
155  }
156 
157 }
158 
160 
161 #endif
Om header file.
An atomic Element defined by a string.
Definition: atom.hpp:33
A partial implementation of Atom.
bool Equals(DefaultAtom const &) const
virtual bool IsEmpty() const
std::string thisString
The NFD-normalized string that defines the Atom.
virtual std::auto_ptr< Om::Source::Source< Element > > GetElementRange()
DefaultAtom & operator=(DefaultAtom const &)
virtual bool Merge(ThisImplementation const &)
std::string const & GetString() const
virtual std::auto_ptr< Om::Source::Source< Element const > > GetElementRange() const
bool Equals(ThisImplementation const &) const
DefaultAtom(char const theCodeUnit)
DefaultAtom(char const theCodeUnitIterator[])
void Swap(ThisImplementation &)
virtual bool Merge(ThisImplementation &)
bool operator<(DefaultAtom const &)
Compares with a Atom; required for use as index in containers.
A partial implementation of Element.
Any object that items can be pulled from.
Definition: source.hpp:31
Om source file.
Om header file.
bool operator!=(DefaultAtom< TheImplementation > const &, DefaultAtom< TheImplementation > const &)
bool operator==(DefaultAtom< TheImplementation > const &, DefaultAtom< TheImplementation > const &)
The Om library.
Definition: code_point.hpp:26