[Ace-users] [ace-users] Putting an object into an ACE_Message_Block

Andrew Roark andrewjroark at yahoo.com
Sat Jan 5 16:44:05 CST 2008


----- Original Message ----
> From: Chris Cleeland <cleeland at ociweb.com>
> 
> > I use the following code for packing and unpacking structs.
> > Note: Be cautious with what you're packing or unpacking - I
> > strictly
> > use simple data types within a struct. That is, anything that is  
> > really just an array of bytes and can be reconstructed that way.
> > Works great for my needs.
> 
> This doesn't deal with byte-swapping, padding, alignment or any other  
> of the nitty-gritty details that will likely eventually bite you.

True.



The OP asked for a way to encode/decode data to/from a
ACE_Message_Block. Within my use (and possibly the OP's use), the
approach I posted ALWAYS works because I control exactly where it is
used.



For more industrial, complete, portable usage patterns such as network transmission over heterogeneous architectures, I agree that a "proper" serialization approach would be required. But this requirement was not in the original request.



Andrew




      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping



More information about the Ace-users mailing list