remove Impl from proxy

This commit is contained in:
Сергей Маринкевич
2025-12-02 19:58:46 +07:00
parent 9f48a74677
commit 40170d553d
3 changed files with 4 additions and 13 deletions
+1 -1
View File
@@ -20,6 +20,6 @@ int main() {
ProxyMarshaller marshaller(ch);
MyServiceProxy proxy(marshaller);
int r = proxy.add(7, 8);
int r = proxy.add(7, 9);
std::cout << "RESULT: " << r << std::endl;
}
+2 -10
View File
@@ -1,19 +1,11 @@
#include "{{ cls.name }}.proxy.h"
class {{ cls.name }}Proxy::Impl {
public:
explicit Impl(ProxyMarshaller& m)
: client(m) {}
ProxyMarshaller& client;
};
{{ cls.name }}Proxy::{{ cls.name }}Proxy(ProxyMarshaller& marshaller)
: impl(new Impl(marshaller)) {}
: impl(marshaller) {}
{% for m in cls.methods %}
{{ m.return_type }} {{ cls.name }}Proxy::{{ m.name }}({% for a in m.args %}{{ a.type }} {{ a.name }}{% if not loop.last %}, {% endif %}{% endfor %}) {
return impl->client.call<{{ m.return_type }}>("{{ cls.name }}.{{ m.name }}"{% for a in m.args %}, {{ a.name }}{% endfor %});
return impl.call<{{ m.return_type }}>("{{ cls.name }}.{{ m.name }}"{% for a in m.args %}, {{ a.name }}{% endfor %});
}
{% endfor %}
+1 -2
View File
@@ -10,6 +10,5 @@ public:
{% endfor %}
private:
class Impl;
Impl* impl;
ProxyMarshaller& impl;
};