I do not have the code at hand so I cannot really check.
Now if a model does not copy well itself (which I imagine) then we
have to check carefully and implement the
postCopy method on the complete famix and moose entities so that we
get a deepcopy instead of a shallow copy
(have a look at my lectures, there are some slides on using postCopy
in the hook and templates,
mathieu knows what I'm talking about so ask him.
The point of postcopy is that by default copy does a shallow copy and
send a postCopy mesage.
You can redefine the postCopy to implement a deep recursive copy but
this can be complex on
a graph like moose.
An alternate solution is to build a model walker and specialize it to
perform copy (the copier could be
clever and be based on the metadescription). May be I would go for
On Jul 20, 20
08, at 4:03 PM, Hani Abdeen wrote:
How can I have a duplication of a mooseModel (for example the model
that represents Mondrian namespace)? exactly like if I imported agin
the namespace Mondrian:
there is no entity in the duplication that has pointers to entities in
the original model.
For example, the accesses of a method 'mtd1' into the duplication
should not point to classes into the original model.
Moose-dev mailing list