Class documentation of Concepts

Loading...
Searching...
No Matches
semantics.hh
Go to the documentation of this file.
1
6#ifndef semantics_hh
7#define semantics_hh
8
10#include "basics/output.hh"
11
12namespace concepts {
13
14 // forward declarations
15 class Attribute;
16
17 // ************************************************************* Semantics **
18
21 template<class T>
22 class Semantics : public OutputOperator {
23 public:
25 virtual T operator()(Attribute attrib) const = 0;
26 protected:
27 virtual std::ostream& info(std::ostream& os) const {
28 return os << concepts::typeOf(*this)<<"()"; }
29 };
30
31 // ********************************************************* AttributeBool **
32
36 class AttributeBool : public Semantics<bool> {
37 public:
41 bool operator()(Attribute attrib) const;
42 protected:
43 virtual std::ostream& info(std::ostream& os) const;
44 };
45
46} // namespace concepts
47
48#endif // semantics_hh
bool operator()(Attribute attrib) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual T operator()(Attribute attrib) const =0
Application operator to query an attribute.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition semantics.hh:27
std::string typeOf(const T &t)
Definition output.hh:43
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320