Re: orbitcpp: structs, memory managment, etc. (fwd)
- From: Michael Meeks <michael ximian com>
- To: ERDI Gergo <cactus cactus rulez org>
- Cc: orbit <orbit-list gnome org>
- Subject: Re: orbitcpp: structs, memory managment, etc. (fwd)
- Date: 19 Mar 2002 12:16:21 +0000
Hi Murray / Gergo,
On Sat, 2002-03-16 at 23:10, ERDI Gergo wrote:
> The problem with structures is that for method invocations, there needs to
> be a way to write a single method that returns a pointer to an allocated,
> valid C representation of the struct. As an example, see the stub for
> Test::TestIface::test_in (simplified):
Yes - that could be somewhat tricky.
I suppose you'll have to implement some wrapper code around the C
method calls that unpacks and re-packs any structures into C compatible
structures.
Is there no way to get a pointer to a C structure layout ? I mean if
you have:
struct CplusplusStruct : InheritedMess {
private:
int who_would_add_anything_here_anyway;
public:
double corba_member_1;
int corba_member_2;
char *corba_member_3;
}
Then is it true that &instance->corba_member_1 and onwards will be
layed out like a C struct ? of course - it's likely that you'll have
some strange wrapping of strings etc. that isn't a char * I suppose
which will scupper you, which sucks.
It's hard to know what to do for the best, clearly if you want fast
in-proc calls to work ( you really do ), and you don't want to write
your own GIOP marshaller ( you really don't ) then you need to be able
to map to the common ABI which is defined to be that specified in the C
language binding (+ the various bits of indirection specified in
interface-indirection.gnumeric ).
No good ideas here really,
Hmm.
Michael.
--
mmeeks@gnu.org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]