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

base_input.hpp
Go to the documentation of this file.
1 #ifndef OGLPLUS_TEXGEN_BASE_INPUT_HPP
9 #define OGLPLUS_TEXGEN_BASE_INPUT_HPP
10 
11 #include "interface.hpp"
12 
13 namespace eagine::oglp::texgen {
14 
15 class base_input : public input_intf {
16 private:
17  node_intf& _parent;
18  string_view _name;
19  output_intf* _output;
20 
21 public:
22  base_input(base_input&&) noexcept = default;
23  base_input(const base_input&) = default;
24  base_input& operator=(base_input&&) = delete;
25  base_input& operator=(const base_input&) = delete;
26 
27  base_input(node_intf& par_node, string_view name_str) noexcept
28  : _parent(par_node)
29  , _name(name_str)
30  , _output(nullptr) {}
31 
32  ~base_input() noexcept override;
33 
34  node_intf& parent() noexcept {
35  return _parent;
36  }
37 
38  void set_name(string_view name) noexcept {
39  _name = name;
40  }
41 
42  string_view name() noexcept override;
43 
44  bool is_connected() noexcept override;
45 
46  bool is_connected(output_intf&) override;
47 
48  bool can_connect(output_intf&) override;
49 
50  bool do_connect(output_intf&);
51 
52  bool connect(output_intf&) override;
53 
54  void disconnect() override;
55 
56  bool disconnect(output_intf&) override;
57 
58  output_intf& connected_output() override;
59 
60  bool set_default_value(valid_if_between<span_size_t, 0, 3> cmp, float val)
61  override;
62 
63  void update_needed() override;
64 
65  void prepare_connected() override;
66 
67  bool render_connected(const render_params&) override;
68 };
69 
70 } // namespace eagine::oglp::texgen
71 
72 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
73 #include <oglplus/texgen/base_input.inl>
74 #endif
75 
76 #endif // OGLPLUS_TEXGEN_BASE_INPUT_HPP
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
valid_if_between_c< T, T, Min, Max > valid_if_between
Specialization of valid_if, for values valid if between Min and Max.
Definition: between.hpp:53

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