List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:November 26 2009 5:48pm
Subject:Re: Binary store
View as plain text  
On Nov 26, 2009, at 10:36 AM, Sebastián Salazar Molina wrote:

> I need to store a C++ object, not a file.

Beware, there be dragons down that path:

    - Pointers can't be stored directly

    - Structure padding varies by compiler, OS, CPU, compiler options...

    - Byte order varies among CPU types and sometimes even OS on the same CPU (PowerPC and
HP PA-RISC processors allow switchable byte order at boot time)

This general class of problems is called object serialization, and there's got to be whole
books on the topic.  Academic journals even, maybe.  It might be best to leave such code
up to others who have already worked out the details.

MySQL++'s answer to this question is SSQLS.  Hardly comprehensive, but maybe good enough
for your purposes.
Thread
Binary storeSebastián Salazar Molina26 Nov
  • Re: Binary storeLeonti Bielski26 Nov
  • Re: Binary storeJonathan Wakely26 Nov
    • Re: Binary storeSebastián Salazar Molina26 Nov
      • Re: Binary storeWarren Young26 Nov
      • Re: Binary storeMickaël Wolff26 Nov
        • Re: Binary storeSebastián Salazar Molina27 Nov