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

container.hpp
Go to the documentation of this file.
1 #ifndef OGLPLUS_GLSL_CONTAINER_HPP
9 #define OGLPLUS_GLSL_CONTAINER_HPP
10 
11 #include "string_ref.hpp"
12 #include <string>
13 
14 namespace eagine::oglp {
15 //------------------------------------------------------------------------------
18 template <typename Container>
20 public:
22  glsl_container() = default;
23 
25  glsl_container(Container storage) noexcept
26  : _storage(std::move(storage))
27  , _str_ref(_storage.data(), _storage.size()) {}
28 
30  auto storage() noexcept -> Container& {
31  return _storage;
32  }
33 
35  operator glsl_source_ref() const noexcept {
36  return _str_ref;
37  }
38 
39 private:
40  Container _storage;
41  glsl_string_ref _str_ref;
42 };
43 
45 //------------------------------------------------------------------------------
46 } // namespace eagine::oglp
47 
48 #endif // OGLPLUS_GLSL_CONTAINER_HPP
Class referencing a set of GLSL source code strings.
Definition: source_ref.hpp:20
auto storage() noexcept -> Container &
Returns a reference to the storage container.
Definition: container.hpp:30
Reference to a GLSL source code string.
Definition: string_ref.hpp:18
glsl_container()=default
Default constructor.
Base class typically storing GLSL source code strings.
Definition: container.hpp:19
glsl_container(Container storage) noexcept
Construction from the storage container.
Definition: container.hpp:25

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