nkjnm
Dependencies: MAX44000 nexpaq_mdk
Fork of LED_Demo by
mbd_os/tools/data/rpc/class.cpp@1:55a6170b404f, 2016-09-17 (annotated)
- Committer:
- nexpaq
- Date:
- Sat Sep 17 16:32:05 2016 +0000
- Revision:
- 1:55a6170b404f
checking in for sharing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nexpaq | 1:55a6170b404f | 1 | class Rpc{{name}} : public RPC { |
nexpaq | 1:55a6170b404f | 2 | public: |
nexpaq | 1:55a6170b404f | 3 | Rpc{{name}}({{cons_proto}}) : RPC(name), o({{cons_call}}) {} |
nexpaq | 1:55a6170b404f | 4 | |
nexpaq | 1:55a6170b404f | 5 | {{methods}} |
nexpaq | 1:55a6170b404f | 6 | |
nexpaq | 1:55a6170b404f | 7 | virtual const struct rpc_method *get_rpc_methods() { |
nexpaq | 1:55a6170b404f | 8 | static const rpc_method rpc_methods[] = { |
nexpaq | 1:55a6170b404f | 9 | {{rpc_methods}}, |
nexpaq | 1:55a6170b404f | 10 | RPC_METHOD_SUPER(RPC) |
nexpaq | 1:55a6170b404f | 11 | }; |
nexpaq | 1:55a6170b404f | 12 | return rpc_methods; |
nexpaq | 1:55a6170b404f | 13 | } |
nexpaq | 1:55a6170b404f | 14 | static struct rpc_class *get_rpc_class() { |
nexpaq | 1:55a6170b404f | 15 | static const rpc_function funcs[] = { |
nexpaq | 1:55a6170b404f | 16 | {"new", rpc_function_caller<const char*, {{cons_type}}, &RPC::construct<Rpc{{name}}, {{cons_type}}> >}, |
nexpaq | 1:55a6170b404f | 17 | RPC_METHOD_END |
nexpaq | 1:55a6170b404f | 18 | }; |
nexpaq | 1:55a6170b404f | 19 | static rpc_class c = {"{{name}}", funcs, NULL}; |
nexpaq | 1:55a6170b404f | 20 | return &c; |
nexpaq | 1:55a6170b404f | 21 | } |
nexpaq | 1:55a6170b404f | 22 | private: |
nexpaq | 1:55a6170b404f | 23 | {{name}} o; |
nexpaq | 1:55a6170b404f | 24 | }; |