Wayverb
waveguide_base.h
1 #pragma once
2 
3 #include "waveguide/bandpass_band.h"
4 
5 #include "glm/fwd.hpp"
6 
7 #include <experimental/optional>
8 #include <functional>
9 
10 // forward declarations //////////////////////////////////////////////////////
11 
12 namespace cl {
13 class Buffer;
14 class CommandQueue;
15 } // namespace cl
16 
17 namespace wayverb {
18 
19 namespace waveguide {
20 struct voxels_and_mesh;
21 struct single_band_parameters;
22 struct multiple_band_constant_spacing_parameters;
23 } // namespace waveguide
24 
25 namespace core {
26 class compute_context;
27 struct environment;
28 } // namespace core
29 
30 namespace combined {
31 
32 // interesting stuff /////////////////////////////////////////////////////////
33 
35 public:
36  waveguide_base() = default;
37  waveguide_base(const waveguide_base&) = default;
38  waveguide_base(waveguide_base&&) noexcept = default;
39  waveguide_base& operator=(const waveguide_base&) = default;
40  waveguide_base& operator=(waveguide_base&&) noexcept = default;
41  virtual ~waveguide_base() noexcept = default;
42 
43  virtual std::unique_ptr<waveguide_base> clone() const = 0;
44 
45  virtual double compute_sampling_frequency() const = 0;
46 
47  virtual std::experimental::optional<
48  util::aligned::vector<waveguide::bandpass_band>>
49  run(const core::compute_context& cc,
50  const waveguide::voxels_and_mesh& voxelised,
51  const glm::vec3& source,
52  const glm::vec3& receiver,
53  const core::environment& environment,
54  double simulation_time,
55  const std::atomic_bool& keep_going,
56  std::function<void(cl::CommandQueue& queue,
57  const cl::Buffer& buffer,
58  size_t step,
59  size_t steps)> pressure_callback) = 0;
60 };
61 
62 std::unique_ptr<waveguide_base> make_waveguide_ptr(
64 std::unique_ptr<waveguide_base> make_waveguide_ptr(
66 
67 } // namespace combined
68 } // namespace wayverb
Definition: waveguide_base.h:34
Definition: waveguide_base.h:12
Definition: traits.cpp:2
Definition: simulation_parameters.h:9
Definition: environment.h:6
Definition: capsule_base.h:9
invariant: device is a valid device for the context
Definition: common.h:13