Re: c++ bindings



> >>>>>>>>>>>>>> remove the line below
done, thanks.

> I'll have a look at the other sources very soon to see if it's ok, but
> as far as I've seen, it looks ok. Oh! yes, now I remember I saw you're
> also adding the _get_type functions. DON'T, since these functions are
> related to the GTK+ type system and are never called directly, and I
> think there won't be any useful use for it from C++ apps, so remove
> these functions.
I figured this out last night, so they should be gone now.
 
> And now I'm realizing that I don't know if it's a good idea to wrap the
> GDA_Value CORBA struct. I have to check if it's used at all in any
> client app. And if it's used, the gda-value.[ch] should be added to the
> libgda-client to wrap it in the C libs. This struct is now partially
> wrapped by the Gda_Field struct.

Hmm.... how do you set the value of a field? I can seem to only find
functions to get the value... What I've done, since there's support for
multiple values (real, shadow, original) is kept a gdaValue class, and it
primarily wraps around GDA_FieldValue (since there's not a struct for it
in the gda-clnt folder), and can access the subsequent GDA_Value
struct. Currently, in C you'd access the various structures like this:

field->real_value->_u.v._u.d or somesuch. In C++, it makes more sense to
have:
field->getRealValue().getDouble()
(*I* think so, at least.) So, I'll have to have a class in C++ that access
a "value", whichever one it ends up being. I've done that with the
gdaValue.cpp file, wrapping the functions so that it types all of the
messy _u.v._u.d.... stuff already. I'm g_strdup'ing when I write to a
longvarchar, is this how the client apps do it?

Also, if you can just get the value of a field by using
real_value->_u.v._u.d, why have the extra functions in Gda_Field to
get_double and such?

This is quickly wrapping (pun intended) up. I hope to have a working
program by the end of the week that people can use to base new C++/gda
programs on. 







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