D
Dima Stopel
Dear comp.lang.c++ members,
I need to write an application that shares some object via shared memory
with other applications.
I use Memory-Mapped Files technique in order to share memory.
Thus, in each process I have the *same* region of memory that is shared.
All I need now is to put my object into this region.
I use 'placement new' technique in order to put the object and all objects
it creates in its constructor into this region.
However, let's say that the object creates a hash_map in the constuctor. The
hash_map is placed inside the region as needed, however if hash_map also
creates some objects in *it's* constructor they won't be placed into the
region and I have no control over it. Thus, the other applications which
will try to call methods of my object will fail because those objects that
hash_map creates are not inside the shared region.
How can I ensure that the *whole* object with all it's sub-objects will be
inside the shared region? Is it possible?
Thank you in advance,
I need to write an application that shares some object via shared memory
with other applications.
I use Memory-Mapped Files technique in order to share memory.
Thus, in each process I have the *same* region of memory that is shared.
All I need now is to put my object into this region.
I use 'placement new' technique in order to put the object and all objects
it creates in its constructor into this region.
However, let's say that the object creates a hash_map in the constuctor. The
hash_map is placed inside the region as needed, however if hash_map also
creates some objects in *it's* constructor they won't be placed into the
region and I have no control over it. Thus, the other applications which
will try to call methods of my object will fail because those objects that
hash_map creates are not inside the shared region.
How can I ensure that the *whole* object with all it's sub-objects will be
inside the shared region? Is it possible?
Thank you in advance,