Boost logo

Boost Users :

Subject: [Boost-users] Sharing a complex object between two processes: Suggestions needed
From: Nathan Lewis (nathanlewissubscription_at_[hidden])
Date: 2011-07-12 17:12:30


Thanks so much for a great C++ library,

Last night I read the complete archive looking for some tidbits of info to
help me figure out how to move forward with a decision of the appropriate
approach. I am fairly new to boost so I am hoping someone has some advice
for my situation.

I am trying to share instances of a c++ class that is auto-generated from
xml schema. I am trying to hand this class off from a dll that a web service
engine loads to another application for processing.
This class is an in-memory implementation of the class and contains several
objects which contain a lot of native stl c++ strings as well as other
primitive types. I was hoping to use boosts circular buffer in shared
memory, but began prototyping with a vector it and researching and I
realized that the strings put in shared memory must use the basic_string
construct. Having some concern about going through all of the auto generated
code to change all of these types and concern over what affect that might
have on the dll & service engine operation. I've seen some examples using
shared memory that use the void allocator and thought maybe that is what I
need to do, however I keep getting back to the fact that I've got a bunch of
strings in this composite class and I don't know if that is torpedoing my
attempts.

I've seen there are many interprocess constructs, memory mapped regions,
shared_ptrs and message ques etc. I also recently got to thinking that
perhaps I should look at boost serialize to deal with the strings. I didn't
want to leave the boost interprocess approach if there was some way to
exchange instances of this class correctly using one of boost interprocess
constructs.

What I am hoping is that some could chime in with suggestions on different
ways to use boost to achieve this and I'll try and go off and research it.

Your input is greatly appreciated!



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net