OGLplus  (0.59.0) a C++ wrapper for rendering APIs

constants.hpp
Go to the documentation of this file.
1 #ifndef OGLPLUS_TEXGEN_CONSTANTS_HPP
9 #define OGLPLUS_TEXGEN_CONSTANTS_HPP
10 
11 #include "interface.hpp"
12 #include <string>
13 
14 namespace eagine::oglp::texgen {
15 namespace expr {
16 struct constant_id {
17  constant_intf& constant;
18  compile_context& context;
19 };
20 std::ostream& operator<<(std::ostream& out, const constant_id&);
21 } // namespace expr
22 
23 class base_constant : public constant_intf {
24 public:
25  std::string identifier();
26 
27  slot_data_type value_type() override;
28 
29  virtual std::ostream& value(std::ostream&, compile_context&) = 0;
30 
31  std::ostream& definitions(std::ostream&, compile_context&) override;
32 
33  std::ostream& expression(std::ostream&, compile_context&) override;
34 };
35 
36 class constant_pi : public base_constant {
37 public:
38  string_view name() const noexcept override;
39 
40  std::ostream& value(std::ostream&, compile_context&) override;
41 };
42 
43 class constant_phi : public base_constant {
44 public:
45  string_view name() const noexcept override;
46 
47  std::ostream& value(std::ostream&, compile_context&) override;
48 };
49 
50 } // namespace eagine::oglp::texgen
51 
52 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
53 #include <oglplus/texgen/constants.inl>
54 #endif
55 
56 #endif // OGLPLUS_TEXGEN_CONSTANTS_HPP
value_type
Value tree value element data type enumeration.
Definition: interface.hpp:27
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
static auto operator<<(std::ostream &out, const identifier_name< M > &n) -> std::ostream &
Operator for writing identifier_name into output streams.
Definition: identifier.hpp:159
basic_identifier< 10, 6, default_identifier_char_set, identifier_t > identifier
Default identifier type used throughout the project.
Definition: identifier.hpp:346

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).