[xsd-users] mapping in shared memory

Boris Kolpackov boris at codesynthesis.com
Sun Jun 25 07:19:38 EDT 2006


Hi,

ZXMULARTA001, Ext <ext.zxmularta001 at astrium.eads.net> writes:

> I would like to define my data with XML and put the generated xsd-tree
> object into a shared memory. In order to do that, I'd like to generate
> only C structure (and not the complex C++ object) Is there a solution
> to do that with xsd ?

No, XSD does not (yet) have a backend that generates C mapping. Note,
however, that this will make little difference in your case since
the generated structs will have dynamically-allocated, non-trivial
data as their members (e.g, strings, arrays of nested structs, etc.)
which will make you solve pretty much the same problems as in the
case of C++ mapping (see below).


> Or how can I mount a xsd-tree object into a shared memory ?

There are two things that prevent the current implementation
of C++/Tree mapping from being shared-memory friendly, so to
speak.

The first is the use of virtual functions. Luckily, their use
is limited to construction and destruction of the tree. If
after the "master" process constructs the tree in a shared
memory region other processes are only going to do read-only
access, the virtual functions will not pose any problems. If
you need read/write access from several processes then things
are a bit more tricky. Let me know if that's the case and you
are interested in a solution.

The second, bigger, problem is to actually place the tree and
all its components (e.g., strings, sequences, etc.) in a shared
memory region. This is usually achieved with custom allocators
which are not (yet) supported in the C++/Tree mapping.

To summarize, the C++/Tree mapping is not (yet) ready for the
shared memory use. It is, however, not too hard to make it usable
in this context. We could probably customize the C++/Tree for you
(or implement the C mapping above) on a commercial basis. Let me
know if you are interested.

hth,
-boris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060625/3ce05b6f/attachment.pgp


More information about the xsd-users mailing list