summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-11-11 13:30:33 -0600
committerPatrick Williams <patrick@stwcx.xyz>2016-11-17 15:35:54 -0600
commit7aa8a1e2e8fb9ed54a24bf9c61ddfbd78d70c629 (patch)
tree92c292348dd1025421af6fdc3d71dcef3f71de3d /tools
parentccacc4af969a70cc24f84981b5a5dde01a928d09 (diff)
downloadsdbusplus-7aa8a1e2e8fb9ed54a24bf9c61ddfbd78d70c629.tar.gz
sdbusplus-7aa8a1e2e8fb9ed54a24bf9c61ddfbd78d70c629.zip
sdbus++: Change namespace order
Rather than sdbusplus::server::<interface>::<interface_last> order for namespaces, use: sdbusplus::<interface>::server::<interface_last> This avoids a name collision for two interfaces such as: - org.example.Object (class Object) - org.example.Object.Delete (namespace Object) Change-Id: Iec5e2b61c0d5e34d0d8920abd51f469ec5cbd9a6 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'tools')
-rw-r--r--tools/sdbusplus/templates/interface.mako.server.cpp6
-rw-r--r--tools/sdbusplus/templates/interface.mako.server.hpp9
2 files changed, 8 insertions, 7 deletions
diff --git a/tools/sdbusplus/templates/interface.mako.server.cpp b/tools/sdbusplus/templates/interface.mako.server.cpp
index 2a5c497..c18a727 100644
--- a/tools/sdbusplus/templates/interface.mako.server.cpp
+++ b/tools/sdbusplus/templates/interface.mako.server.cpp
@@ -9,12 +9,12 @@
%>
namespace sdbusplus
{
-namespace server
-{
% for s in namespaces:
namespace ${s}
{
% endfor
+namespace server
+{
${classname}::${classname}(bus::bus& bus, const char* path)
: _${interface_instance()}(
@@ -106,8 +106,8 @@ ${ s.cpp_prototype(loader, interface=interface, ptype='vtable') }
vtable::end()
};
+} // namespace server
% for s in reversed(namespaces):
} // namespace ${s}
% endfor
-} // namespace server
} // namespace sdbusplus
diff --git a/tools/sdbusplus/templates/interface.mako.server.hpp b/tools/sdbusplus/templates/interface.mako.server.hpp
index ba55ef6..795205b 100644
--- a/tools/sdbusplus/templates/interface.mako.server.hpp
+++ b/tools/sdbusplus/templates/interface.mako.server.hpp
@@ -8,12 +8,12 @@
%>
namespace sdbusplus
{
-namespace server
-{
% for s in namespaces:
namespace ${s}
{
% endfor
+namespace server
+{
class ${classname}
{
@@ -73,7 +73,8 @@ ${ m.cpp_prototype(loader, interface=interface, ptype='callback-header') }
static constexpr auto _interface = "${interface.name}";
static const vtable::vtable_t _vtable[];
- interface::interface _${"_".join(interface.name.split('.'))}_interface;
+ sdbusplus::server::interface::interface
+ _${"_".join(interface.name.split('.'))}_interface;
% for p in interface.properties:
% if p.defaultValue:
@@ -85,8 +86,8 @@ ${ m.cpp_prototype(loader, interface=interface, ptype='callback-header') }
};
+} // namespace server
% for s in reversed(namespaces):
} // namespace ${s}
% endfor
-} // namespace server
} // namespace sdbusplus
OpenPOWER on IntegriCloud