Pelagicore / gdbus-codegen-glibmm

Code generator for C++ D-Bus stubs and proxies using Giomm/Glibmm
GNU Lesser General Public License v2.1
23 stars 25 forks source link

Glib::RefPtr should probably not be passed by value #58

Closed martin-ejdestig closed 5 years ago

martin-ejdestig commented 5 years ago

Glib::RefPtr and Glib::RefPtr wrapped helper classes should probably not be passed by value. A reference will be taken at call site, and in most cases object will just be dereferenced directly again when the call is done.

For instance, having the D-Bus method Test generates something similar to:

virtual void Test(FooMessageHelper msg) = 0;

in the stub. And FooMessageHelper has a RefPtr member variable.

A const & to the RefPtr (or simply a reference to the wrapped object) would probably be preferable.