Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
element.hpp
Go to the documentation of this file.
1 /*
2  ELEMENT.hpp - a generic element in the UI-Model
3 
4  Copyright (C) Lumiera.org
5  2015, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
41 #ifndef GUI_MODEL_ELEMENT_H
42 #define GUI_MODEL_ELEMENT_H
43 
44 
45 #include "lib/error.hpp"
46 #include "lib/nocopy.hpp"
47 #include "lib/hash-value.h"
48 //#include "lib/symbol.hpp"
49 #include "lib/util.hpp"
50 
51 #include <string>
52 
53 
54 
55 namespace gui {
56 namespace model {
57 
58  using lib::HashVal;
59  using util::isnil;
60  using std::string;
61 
62 
69  template<class X>
70  class Element
71  {
72  string nothing_;
73 
74  public:
75  explicit
76  Element (string const& b)
77  : nothing_(b)
78  { }
79 
80  // using default copy/assignment
81 
82 
83 
84  /* == Adapter interface for == */
85 
86  void
87  setSolution (string const& solution ="")
88  {
89  UNIMPLEMENTED ("tbw");
90 #if false
91  if (isDeaf())
92  this->transmogrify (solution);
93 #endif
94  }
95 
96 
97  protected:
98  void maybe () const;
99 
100 
101  friend HashVal
102  hash_value (Element const& entry)
103  {
104  return hash_value (entry.nothing_);
105  }
106  };
107 
108 
109 
110 
111 
112 
115  template<class X>
116  inline void
118  {
119  UNIMPLEMENTED ("tbw");
120  }
121 
122 
123 
124 
125 
126 }} // namespace gui::model
127 #endif /*GUI_MODEL_ELEMENT_H*/
Element(string const &b)
Definition: element.hpp:76
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:47
Basic (abstracted) view of...
Definition: element.hpp:70
Mix-Ins to allow or prohibit various degrees of copying and cloning.
friend HashVal hash_value(Element const &entry)
Definition: element.hpp:102
void setSolution(string const &solution="")
Definition: element.hpp:87
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
bool isnil(lib::time::Duration const &dur)
Definition: timevalue.hpp:642
Lumiera error handling (C++ interface).
void maybe() const
Definition: element.hpp:117
Hash value types and utilities.
size_t HashVal
a STL compatible hash value
Definition: hash-value.h:56