Re: [Cppcms-users] Feature Request: Feature added to cppcms::rpc::json_method
Brought to you by:
artyom-beilis
|
From: Daniel V. <chi...@gm...> - 2011-12-01 16:50:50
|
Hello Artyom.
Did you have the time to see the code?
I added very few lines to rpc_json.h.
For me it is useful to receive json values const references with zero
copy.
void foo::bar(json::array const &a, json::object const
&o,json::value const &v);
...
bind("bar",json_method(&foo::bar,this),json_rpc_server::method_role);
...
Good bye.
On Fri, 2011-11-25 at 01:15 -0300, Daniel Vallejos wrote:
> Hello Ayrtom.
>
> I added (see attachment) a feature to cppcms::rpc::json_method and its
> binders.
>
> The feature allow to bind parameters of type:
>
> const cppcms::json::value const &
> cppcms::json::object const &
> cppcms::json::array const &
> std::string const &
>
> The forwarding of these types are passed by reference (zero copy
> overhead).
>
> For Example we can add a json rpc method of type:
>
> void my_rpc::my_method(json::array const& a, json::object const& o,
> json::value const& v);
> ...
> bind("my_method",
> json_method(&my_rpc::my_method,this),
> json_rpc_server::method_role);
> ...
>
>
> In theory the changes no breaks backward compatibility and ABI.
>
> In practice my whole project compile with it without change.
>
> Please review the code if you wish.
>
> Thank you.
>
|