Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost interprocess features from inside Class member functions
From: Achuth Sankar (achuthman_at_[hidden])
Date: 2012-05-06 15:51:08


Hi Ion

Thanks a lot Ion, you saved my day. Let me try this out tomorrow. Was stuck
with this for a week.

regards
Achuth

On Sun, May 6, 2012 at 4:03 PM, Ion Gaztañaga <igaztanaga_at_[hidden]> wrote:

> El 04/05/2012 23:47, Achuth Sankar escribió:
>
> Hi All
>>
>> Am facing a lot of issue while using interprocess features inside
>> my class file. I am pasting my class file below:
>>
>
> when "mapped_region" is destroyed, then the shared memory is unmapped and
> you have no acces to it. Make mapped_region a member of your class.
>
>
> void MyClass::createBuffer() {
> shared_memory_object::remove("**test");
> shared_memory_object shm(open_or_create, infoBufferName, read_write);
> shm.truncate(sizeof(**ServerDetails));
> mapped_region region(shm, read_write);
> void* addr = region.get_address();
> ref=new (addr) Ref;
> ref->value=50;
> //Assign the recently created mapped region to the internal member
> m_member_mapped_region = boost::move(region);
> }
>
> best,
>
> Ion
> ______________________________**_________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/**mailman/listinfo.cgi/boost-**users>
>

-- 
be late to be great
hoida !!!


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