[pooma-dev] MakeOwnCopy problem

Jeffrey Oldham oldham at codesourcery.com
Mon Mar 11 22:04:53 UTC 2002


	I agree.  Would you please check this change into the Pooma tree?

On Mon, Mar 11, 2002 at 10:59:47AM -0700, John Hall wrote:
> Gang:
> In FieldEngine.h, the routine makeOwnCopy references a "model" which 
> doesn't exist. I changed it locally to s.fieldEngine().data(m,c) 
> which compiles and links and seems to make sense to me.
> 
> Could someone else take a look at it and tell me what the right thing to do is?
> 
>    //---------------------------------------------------------------------------
>    // Make a distinct copy of this fieldEngineBase.
> 
>    template<class Subject>
>    void makeOwnCopy(const Subject &s)
>    {
>      PAssert(data_m.isValid());
> 
>      // Create a blank slate of engines:
> 
>      data_m = RefCountedBlockPtr<Data_t>();
>      stride_m = centering_m.size();
>      addSubFields();
> 
>      // Copy then engines and relations and
>      // Deepen the copies of the engine & relations list.
> 
>      for (int m = 0; m < num_materials_m; ++m)
>      {
>        for (int c = 0; c < centering_m.size(); ++ c)
>        {
>          data(m, c) = model.data(m, c); // This is THE LINE in question
>          data(m, c).engine().makeOwnCopy();
>          data(m, c).relations().makeOwnCopy(s);
>        }
>      }
>    }

Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com



More information about the pooma-dev mailing list