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 
12 namespace 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
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
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
An abstract function class to query attributes.
Definition: semantics.hh:22
bool operator()(Attribute attrib) const
Application operator.
A function class to query attributes.
Definition: semantics.hh:36
std::string typeOf(const T &t)
Return the typeid name of a class object.
Definition: output.hh:43
Class providing an output operator.
Attributes for elements of the topology.
Definition: connector.hh:22
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich