|
Re: Notify model objects about completion of their deserialization [message #414267 is a reply to message #414265] |
Mon, 29 October 2007 11:19 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
Felix,
I suppose you want this to happen after the entire load process is
complete not as objects are added during loading? Is there a similar
need if you were to say copy the contents of the resource, create a new
resource, and add the copy to it? Using OPTION_DEFER_ATTACHMENT might
be useful to make the attach happen last, but ID resolution still needs
to take place as that point. Using OPTION_RESOURCE_HANDLER might be
useful for getting allowing the root object to get callbacks when the
resource containing it finishes loading. Of course it could listen as
an adapter to the resource's isLoaded state change for that and it could
hook itself up as a adapter to the resource when eSetResource or
eSetDirectResource is called. The root would then be responsible for
traversing all the children...
Felix Dorner wrote:
> Hey,
>
> I´d like to do something weird: I load an EMF model from a single file,
> and immediately after the model deserialization is complete, I´d like my
> model objects to "doSomething()". I could add an EOperation
> "doSomething()" or so to each object, which is then called from a
> central point after I get my model root from the EMF runtime. But I´d
> rather keep the doSomething() method in private and let EMF somehow
> "notify" each object about the completion of the deserialization process.
>
> Is this understandable? Does this even work in theory, and if so, does
> EMF implement something like this?
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Notify model objects about completion of their deserialization [message #414268 is a reply to message #414267] |
Mon, 29 October 2007 11:22 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
Felix,
Another idea is that if you use OPTION_DISABLE_NOTIFY then as objects
are created, eSetDeliver(false) is called, and at the end of the
document loading, eSetDeliver(true) is called, so you could use that as
your queue to do some post load processing. Of course these methods
could be called anytime.
Ed Merks wrote:
> Felix,
>
> I suppose you want this to happen after the entire load process is
> complete not as objects are added during loading? Is there a similar
> need if you were to say copy the contents of the resource, create a
> new resource, and add the copy to it? Using OPTION_DEFER_ATTACHMENT
> might be useful to make the attach happen last, but ID resolution
> still needs to take place as that point. Using
> OPTION_RESOURCE_HANDLER might be useful for getting allowing the root
> object to get callbacks when the resource containing it finishes
> loading. Of course it could listen as an adapter to the resource's
> isLoaded state change for that and it could hook itself up as a
> adapter to the resource when eSetResource or eSetDirectResource is
> called. The root would then be responsible for traversing all the
> children...
>
>
> Felix Dorner wrote:
>> Hey,
>>
>> I´d like to do something weird: I load an EMF model from a single file,
>> and immediately after the model deserialization is complete, I´d like my
>> model objects to "doSomething()". I could add an EOperation
>> "doSomething()" or so to each object, which is then called from a
>> central point after I get my model root from the EMF runtime. But I´d
>> rather keep the doSomething() method in private and let EMF somehow
>> "notify" each object about the completion of the deserialization
>> process.
>>
>> Is this understandable? Does this even work in theory, and if so, does
>> EMF implement something like this?
>>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.04441 seconds