Hi,
I am currently evaluating boost interprocess library for using shared memory.
I found two ways to transfer complex data structures.
1. Creating data structures directly in shared memory.
class complex_data
{
int id_;
char_string char_string_;
int_vector_vector int_vector_vector_;
public:
//Since void_allocator is convertible to any other allocator<T>, we can simplify
//the initialization taking just one allocator for all inner containers.
complex_data(int id, const char *name, const void_allocator &void_alloc)
: id_(id), char_string_(name, void_alloc), int_vector_vector_(void_alloc)
{}
//Other members...
};
2. Serializing data into bufferstream and deserializing it.
My initial trial shows that streaming to bufferstream took 7 times more time than using direct shared structures.
Can you please help me to choose the effective way between these two approaches?
thanks,
Kalyan