Interface change from IncQuery 0.7 to 0.8 [message #1742664] |
Tue, 06 September 2016 13:33 |
Minh Tu Ton That Messages: 17 Registered: January 2015 |
Junior Member |
|
|
Hello,
I've noticed that from IncQuery v0.7 to v0.8, the inteface org.eclipse.incquery.runtime.api.IPatternMatch has been changed. The method has been replaced by public IQuerySpecification<? extends IncQueryMatcher<? extends IPatternMatch>> specification()
. With this new interface, how could you get a Pattern from a PatternMatch? Any suggestion would be welcomed.
PS: Is there any sort of notice of API change in the project ?
Best regards,
[Updated on: Tue, 06 September 2016 13:34] Report message to a moderator
|
|
|
|
|
Re: Interface change from IncQuery 0.7 to 0.8 [message #1742678 is a reply to message #1742675] |
Tue, 06 September 2016 15:07 |
Zoltan Ujhelyi Messages: 392 Registered: July 2015 |
Senior Member |
|
|
Hi,
first of all, it seems strange to me that you maintain a cache of PatternMatch instances for each Pattern, as the Pattern matcher itself already caches the results. In other words, when you need all matches of a pattern, ask the corresponding matcher (the results will be fast because of the internal caches). Still, if you want to get notified on model changes, you could ask the IncQueryEngine/ViatraQueryEngine (depending on the version you use; I'd recommend using as new version as you can; you will need the advanced version) to provide updateListeners for your Matcher.
As an example, you could have a look at http://git.eclipse.org/c/viatra/org.eclipse.viatra.examples.git/tree/query/headless/org.eclipse.viatra.query.application/src/org/eclipse/viatra/query/application/common/ViatraQueryHeadlessAdvanced.java#n124 ; based on the version you are using minor changes might be necessary.
Best regards,
Zoltán
|
|
|
Powered by
FUDForum. Page generated in 0.04441 seconds