Skip to content

Commit

Permalink
refactor(spa): delete viewing methods on non l-values
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Oct 13, 2024
1 parent 265855a commit f34a784
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion include/rohrkabel/spa/pod/object/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ namespace pipewire::spa
pod_object &operator=(pod_object &&) noexcept;

public:
[[nodiscard]] spa::pod pod() const;
[[nodiscard]] spa::pod pod() const &;
[[nodiscard]] spa::pod pod() const && = delete;

public:
[[nodiscard]] spa::type type() const;
[[nodiscard]] std::uint32_t id() const;

Expand Down
5 changes: 4 additions & 1 deletion include/rohrkabel/spa/pod/prop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ namespace pipewire::spa
pod_prop &operator=(pod_prop &&) noexcept;

public:
[[nodiscard]] pod value() const;
[[nodiscard]] pod value() const &;
[[nodiscard]] pod value() const && = delete;

public:
[[nodiscard]] std::uint32_t flags() const;
[[nodiscard]] enum_value<prop> key() const;

Expand Down
2 changes: 1 addition & 1 deletion src/spa/spa.pod.object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace pipewire::spa
return *this;
}

spa::pod pod_object::pod() const
spa::pod pod_object::pod() const &
{
return spa::pod::view(&m_impl->object->pod);
}
Expand Down
2 changes: 1 addition & 1 deletion src/spa/spa.pod.prop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace pipewire::spa
return *this;
}

pod pod_prop::value() const
pod pod_prop::value() const &
{
return pod::view(&m_impl->prop->value);
}
Expand Down

0 comments on commit f34a784

Please sign in to comment.