Boost logo

Boost :

From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2007-10-11 02:40:21


I am searching for a library / component / pattern that will help me
with the following problem:

I have a memory structure in raw memory (received from a measurement
instrument), that is unaligned in its data members.

Now I want to have an access interface to this data that comes as close
as possible to access of a struct.
E.g.

struct foo {
     char a;
     int b;
}

Altough my raw data "char* pdata" has an 8bit followed by a 32bit I want
to be able to do something like:

foo data(pdata);

and then

char ch = data.a;
int n = data.b;

Does anyone know about such a library?
(This should work compiler/platform independent of course.)

Thank you,
Roland aka speedsnail


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk