get/set wrap methods.



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
---------------------------------------------------------------------------------------------
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]