Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > serializing an arbitrary data structure into a flat buffer (raw contiguousmemory block)

Reply
Thread Tools

serializing an arbitrary data structure into a flat buffer (raw contiguousmemory block)

 
 
Alfonso Morra
Guest
Posts: n/a
 
      10-03-2005
Hi,

I am writing a messaging library which will allow me to send a generic
message structure with custom "payloads".

In many cases, a message must store a non-linear data structure (i.e.
"payload") using pointers. Examples of these are binary trees, hash
tables etc. Thus, the message itself contains only a pointer to the
actual data. When the message is sent to the same processor, these
pointers point to the original locations, which are within the address
space of the same processor. However, when such a message is sent to
other processors, these pointers will point to invalid locations.

I need a way to ``serialize'' (or pack) my message structures into a
contiguous raw memory block (and then be able to de-serialize or
"unpack" them at the other end.

I just need a simple example, using a simple structure that contains
pointers (say a ptr to another struct, or a char*) so that I can build
on from that.

Searches on Google over the last few days have yielded nothing useful.

Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can a Java buffer overflow lead to arbitrary code execution? neuneudr@yahoo.fr Java 2 02-05-2007 05:54 PM
Serializing an instance with arbitrary methods (in rails) Gavin Kistner Ruby 6 11-17-2005 07:43 PM
serializing an arbitrary data structure into a flat buffer (raw contiguousmemory block) Alfonso Morra C Programming 5 10-04-2005 01:55 PM
calling an arbitrary function w/ arbitrary arguments Honestmath C++ 5 12-13-2004 06:18 AM
convert flat structure into hierarchical one Ksenia Marasanova Python 3 09-27-2004 02:44 PM



Advertisments