get/set wrap methods.
- From: Pavlo Solntsev <pavlo solntsev gmail com>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: get/set wrap methods.
- Date: Thu, 22 Feb 2018 10:05:36 -0600
I am trying to wrap a simple structure from libgda package. I followed some examples and documentation and was able to implement all get/set methods via _MEMBER_GET macros. The generated code looks exactly as I would expect for c++ get/set:
const T& get_some()const;
void set_some(const T&);
My question about getter. It looks like I return a reference for the temporary created object, which is not good. Do you think getter should return Glib::RefPtr<>? It is a little uncommon for c++ in my opinion. Does it cause any performance degradation by creating a RefPtr object and returning it?
As an example, we may consider a simple struct:
struct Person {
char *fname;
char *lname;
};
Thanks,
-Pavlo Solntsev
---------------------------------------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]