Re: IPC stream magic

Adam Lackorzynski <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <[email protected]>
On Thu Apr 09, 2015 at 19:46:20 -0400, teclis High Elf wrote:
> I have a complex nested structure that looks something like this:
> 
> typedef struct struct_A
> {
>   int i;
>   struct struct_B[5];
>   int j;
> }
> 
> using an IPC stream I do:
> 
> struct_A a;
> 
> ios.put(a);
> 
> and then in the server process I do:
> 
> struct_A b;
> 
> ios.get(b);
> 
> ( ios is a L4::Ipc::Iostream )
> 
> and magically my complex nested structure reappears with all the data
> intact in the server process running in another address space.
> 
> As the IPC Streams are not well documented would someone be able to explain
> to me how my complex nested structure got automatically marshalled in the
> client and unmarshalled in the server process?

That's the magic of templates. Using those, you know the type of a and b
inside put and get, and thus do an assignment into the UTCB or a memcpy,
or similar.



Adam
-- 
Adam                 [email protected]
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.