Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Interprocess: Can I share the multi_index array between processes?
From: Arman Khalatyan (arm2arm_at_[hidden])
Date: 2010-04-07 05:30:41


Nice!!! Thank you for help!!
The example 12 is fitting exactly to my requirements.
The MultiIndex great library thanks for inventing that.:)

Arman.

On Wed, Apr 7, 2010 at 9:24 AM, <joaquin_at_[hidden]> wrote:

> Arman Khalatyan escribió:
>
>> Hi, Thanks for your detailed explanations.
>> I was paying with your nice example.
>> Currently my structure is keeping only several floats, ints and unsigned
>> ints.
>> Following the Interprocess documentation, as you wrote, I can put them
>> directly
>> into shared memory:
>>
>> [...]
>>
>>
>> Now I am trying to access the memory from client:
>> shared_memory_object shm (open_only, "shared_memory", read_only);
>>
>> //Map the whole shared memory in this process
>> mapped_region region(shm, read_only);
>>
>> //Check that memory was initialized to 1
>> const particlesID_set *P =
>> static_cast<particlesID_set*>(region.get_address());
>>
>> //const particlesID_set::nth_index<1>::type L1_ID_index =
>> (*P).get<1>();// This does not compile, Why?
>>
>
> It is
>
> const particlesID_set::nth_index<1>::type& L1_ID_index = ...
>
> Note the added '&'; this is explained for instance at the final paragraph
> of
>
>
> http://www.boost.org/libs/multi_index/doc/tutorial/basics.html#multiple_sort
>
>
> Joaquín M López Muñoz
> Telefónica, Investigación y Desarrollo
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

-- 
------------------------------------------
Dr Arman Khalatyan,
Observatoire Astronomique de Marseille-Provence
Laboratoire d'Astrophysique de Marseille
-----------------------------------------


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