#pragma once #include "{{ cls.name }}.h" #include "rpc/RpcRegistry.h" #include "rpc/RpcValue.h" #include #include // Skeleton-обёртка над {{ cls.name }}, реализующая IRpcObject::invoke(). class {{ cls.name }}Skeleton : public IRpcObject { public: explicit {{ cls.name }}Skeleton({{ cls.name }}& obj); RpcValue invoke(const std::string& method, const RpcArgs& args) override; private: using Handler = RpcValue ({{ cls.name }}Skeleton::*)(const RpcArgs&); // Статическая таблица method-name -> member-function. static const std::unordered_map& handlers(); {% for m in cls.methods %} RpcValue call_{{ m.name }}(const RpcArgs& args); {% endfor %} {{ cls.name }}& obj_; };