Wayverb
source.h
1 #pragma once
2 
3 #include "combined/model/hover.h"
4 #include "combined/model/min_size_vector.h"
5 
6 #include "core/geo/box.h"
7 
8 #include "cereal/types/base_class.hpp"
9 
10 #include <string>
11 
12 namespace wayverb {
13 namespace combined {
14 namespace model {
15 
16 class source final : public owning_member<source, hover_state> {
17 public:
18  explicit source(std::string name = "new source",
19  glm::vec3 position = glm::vec3{0});
20 
21  void set_name(std::string name);
22  std::string get_name() const;
23 
24  void set_position(const glm::vec3& position);
25  glm::vec3 get_position() const;
26 
27  using hover_state_t = class hover_state;
28  const auto& hover_state() const { return get<0>(); }
29  auto& hover_state() { return get<0>(); }
30 
31  template <typename Archive>
32  void serialize(Archive& archive) {
33  archive(name_, position_);
34  }
35 
36  NOTIFYING_COPY_ASSIGN_DECLARATION(source)
37 private:
38  inline void swap(source& other) noexcept {
39  using std::swap;
40  swap(name_, other.name_);
41  swap(position_, other.position_);
42  };
43 
44  std::string name_;
45  glm::vec3 position_;
46 };
47 
48 bool operator==(const source& a, const source& b);
49 bool operator!=(const source& a, const source& b);
50 
52 
54 
55 } // namespace model
56 } // namespace combined
57 } // namespace wayverb
Definition: capsule_base.h:9
A vector which must hold some minimum number of elements.
Definition: min_size_vector.h:11
Definition: source.h:16