|
Boost : |
Subject: Re: [boost] [interprocess] map of vectors
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2008-11-26 11:36:21
Jan Stetka wrote:
> When I try to compile:
>
> typedef boost::shmem::vector<pair<float,ptime>
> ,boost::shmem::allocator<pair<float,ptime>,boost::shmem::named_shared_object::segment_manager
> > > phshCPUTime;
> typedef boost::shmem::vector<pair<unsigned long,ptime>
> ,boost::shmem::allocator<pair<unsigned
> long,ptime>,boost::shmem::named_shared_object::segment_manager > >
> phshMemory;
>
> struct PHSharedData
> {
> unsigned long TPM;
> phshCPUTime CPUTime;
> phshMemory Memory;
> };
> PHSharedData phsd;
> phsd.CPUTime =phshCPUTime(_segment.get_segment_manager());
>
> results in:
vector has no default constructor with shared memory allocators (because
shared memory allocators have no default constructor). So put a
constructor for PHSharedData
struct PHSharedData
{
PHSharedData(segment_manager *mngr)
: CPUTime(mngr)
{}
unsigned long TPM;
phshCPUTime CPUTime;
phshMemory Memory;
};
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk