sdbus++: property: simplify server mako structure
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I1181d785dea13c51cee1f59a07af541b92af303c
diff --git a/tools/meson.build b/tools/meson.build
index 6493efb..41d0bb6 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -23,7 +23,7 @@
'sdbusplus/templates/method.prototype.hpp.mako',
'sdbusplus/templates/property.md.mako',
'sdbusplus/templates/property.client.hpp.mako',
- 'sdbusplus/templates/property.prototype.hpp.mako',
+ 'sdbusplus/templates/property.server.cpp.mako',
'sdbusplus/templates/signal.md.mako',
'sdbusplus/templates/signal.prototype.hpp.mako',
)
diff --git a/tools/sdbusplus/property.py b/tools/sdbusplus/property.py
index a798245..a1478d7 100644
--- a/tools/sdbusplus/property.py
+++ b/tools/sdbusplus/property.py
@@ -294,16 +294,6 @@
loader, "property.md.mako", property=self, post=str.strip
)
- def cpp_prototype(self, loader, interface, ptype):
- return self.render(
- loader,
- "property.prototype.hpp.mako",
- property=self,
- interface=interface,
- ptype=ptype,
- post=str.rstrip,
- )
-
def cpp_includes(self, interface):
return interface.error_includes(self.errors) + interface.enum_includes(
[self]
diff --git a/tools/sdbusplus/templates/interface.server.cpp.mako b/tools/sdbusplus/templates/interface.server.cpp.mako
index 9c726cd..eb8ca64 100644
--- a/tools/sdbusplus/templates/interface.server.cpp.mako
+++ b/tools/sdbusplus/templates/interface.server.cpp.mako
@@ -20,7 +20,7 @@
% endfor
% for p in interface.properties:
-${ p.cpp_prototype(loader, interface=interface, ptype='callback-cpp') }
+${ p.render(loader, "property.server.cpp.mako", property=p, interface=interface) }
% endfor
% if interface.properties:
diff --git a/tools/sdbusplus/templates/property.prototype.hpp.mako b/tools/sdbusplus/templates/property.server.cpp.mako
similarity index 98%
rename from tools/sdbusplus/templates/property.prototype.hpp.mako
rename to tools/sdbusplus/templates/property.server.cpp.mako
index ec54869..3b5b64d 100644
--- a/tools/sdbusplus/templates/property.prototype.hpp.mako
+++ b/tools/sdbusplus/templates/property.server.cpp.mako
@@ -1,4 +1,3 @@
-% if ptype == 'callback-cpp':
auto ${interface.classname}::${property.camelCase}() const ->
${property.cppTypeParam(interface.name)}
{
@@ -100,4 +99,3 @@
${property.cppTypeParam(interface.name, full=True)}>());
}
}
-% endif