You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

class.cpp 695B

123456789101112131415161718192021222324
  1. class Rpc{{name}} : public RPC {
  2. public:
  3. Rpc{{name}}({{cons_proto}}) : RPC(name), o({{cons_call}}) {}
  4. {{methods}}
  5. virtual const struct rpc_method *get_rpc_methods() {
  6. static const rpc_method rpc_methods[] = {
  7. {{rpc_methods}},
  8. RPC_METHOD_SUPER(RPC)
  9. };
  10. return rpc_methods;
  11. }
  12. static struct rpc_class *get_rpc_class() {
  13. static const rpc_function funcs[] = {
  14. {"new", rpc_function_caller<const char*, {{cons_type}}, &RPC::construct<Rpc{{name}}, {{cons_type}}> >},
  15. RPC_METHOD_END
  16. };
  17. static rpc_class c = {"{{name}}", funcs, NULL};
  18. return &c;
  19. }
  20. private:
  21. {{name}} o;
  22. };