Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers class.cpp Source File

class.cpp

00001 class Rpc{{name}} : public RPC {
00002 public:
00003     Rpc{{name}}({{cons_proto}}) : RPC(name), o({{cons_call}}) {}
00004 
00005     {{methods}}
00006 
00007     virtual const struct rpc_method *get_rpc_methods() {
00008         static const rpc_method rpc_methods[] = {
00009             {{rpc_methods}},
00010             RPC_METHOD_SUPER(RPC)
00011         };
00012         return rpc_methods;
00013     }
00014     static struct rpc_class *get_rpc_class() {
00015         static const rpc_function funcs[] = {
00016             {"new", rpc_function_caller<const char*, {{cons_type}}, &RPC::construct<Rpc{{name}}, {{cons_type}}> >},
00017             RPC_METHOD_END
00018         };
00019         static rpc_class c = {"{{name}}", funcs, NULL};
00020         return &c;
00021     }
00022 private:
00023     {{name}} o;
00024 };