Re: orbitcpp: structs, memory managment, etc. (fwd)



On 19 Mar 2002, Michael Meeks wrote:

> 	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 works for atomic types -- but this all breaks down when you have stuff
like objects as the struct's members.

> 	No good ideas here really,
> 
> 	Hmm.

Check out src/idl-compiler/cpp/types/HACKING which I've just committed --
I have a new approach that might just work. We'll have to see -- I'm going
to implement it next week.

-- 
   .--= ULLA! =---------------------.   `We are not here to give users what
   \     http://cactus.rulez.org     \   they want'  -- RMS, at GUADEC 2001
    `---= cactus@cactus.rulez.org =---'
Fekete lyuk: Isten nullával osztott...




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