Development mbed library for MAX32630FTHR
Dependents: blinky_max32630fthr
Diff: tools/data/rpc/class.cpp
- Revision:
- 0:5c4d7b2438d3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/data/rpc/class.cpp Fri Nov 11 20:59:50 2016 +0000 @@ -0,0 +1,24 @@ +class Rpc{{name}} : public RPC { +public: + Rpc{{name}}({{cons_proto}}) : RPC(name), o({{cons_call}}) {} + + {{methods}} + + virtual const struct rpc_method *get_rpc_methods() { + static const rpc_method rpc_methods[] = { + {{rpc_methods}}, + RPC_METHOD_SUPER(RPC) + }; + return rpc_methods; + } + static struct rpc_class *get_rpc_class() { + static const rpc_function funcs[] = { + {"new", rpc_function_caller<const char*, {{cons_type}}, &RPC::construct<Rpc{{name}}, {{cons_type}}> >}, + RPC_METHOD_END + }; + static rpc_class c = {"{{name}}", funcs, NULL}; + return &c; + } +private: + {{name}} o; +};