1<%
2p_name = property.snake_case;
3p_tag = property.snake_case + "_t"
4p_type = property.cppTypeParam(interface.name)
5i_name = interface.joinedName("_", "interface")
6%>\
7    template <bool EmitSignal = true, typename Arg = ${p_type}>
8    void ${p_name}(Arg&& new_value)
9        requires server_details::has_set_property_nomsg<${p_tag}, Instance,
10                                                        ${p_type}>
11    {
12        bool changed = static_cast<Instance*>(this)->set_property(
13            ${p_tag}{}, std::forward<Arg>(new_value));
14
15        if (changed && EmitSignal)
16        {
17            _${i_name}.property_changed("${property.name}");
18        }
19    }
20
21    template <bool EmitSignal = true, typename Arg = ${p_type}>
22    void ${p_name}(sdbusplus::message_t& m, Arg&& new_value)
23        requires server_details::has_set_property_msg<${p_tag}, Instance,
24                                                      ${p_type}>
25    {
26        bool changed = static_cast<Instance*>(this)->set_property(
27            ${p_tag}{}, m, std::forward<Arg>(new_value));
28
29        if (changed && EmitSignal)
30        {
31            _${i_name}.property_changed("${property.name}");
32        }
33    }
34
35    template <bool EmitSignal = true, typename Arg = ${p_type}>
36    void ${p_name}(Arg&& new_value)
37        requires (!server_details::has_set_property<${p_tag}, Instance,
38                                                    ${p_type}>)
39    {
40        static_assert(
41            !server_details::has_get_property<${p_tag}, Instance>,
42            "Cannot create default set-property for '${p_tag}' with get-property overload.");
43
44        bool changed = (new_value != ${p_name}_);
45        ${p_name}_ = std::forward<Arg>(new_value);
46
47        if (changed && EmitSignal)
48        {
49            _${i_name}.property_changed("${property.name}");
50        }
51    }
52