]> gerrit.simantics Code Review - simantics/platform.git/blob
a08d733d1374f78c0831e4071524a4b212d005a5
[simantics/platform.git] /
1 /*******************************************************************************
2  * Copyright (c) 2013 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *     Semantum Oy - initial API and implementation
12  *******************************************************************************/
13 package org.simantics.simulator.toolkit.db;
14
15 import org.simantics.db.layer0.variable.NodeSupport;
16 import org.simantics.simulator.toolkit.StandardNodeManager;
17 import org.simantics.simulator.toolkit.StandardNodeManagerSupport;
18 import org.simantics.simulator.toolkit.StandardRealm;
19
20 /**
21  * Adds support for Layer0 Variable interface in StandardNodeManager
22  *
23  * @author Antti Villberg
24  */
25 public class StandardVariableNodeManager<Node, Engine extends StandardNodeManagerSupport<Node>> extends StandardNodeManager<Node,Engine> {
26
27     protected NodeSupport<Node> support;
28
29     public StandardVariableNodeManager(StandardRealm<Node, Engine> realm, Node root) {
30         super(realm, root);
31         this.support = new NodeSupport<>(this);
32     }
33
34     @Override
35     public void refreshVariable(Node node) {
36         super.refreshVariable(node);
37         support.valueCache.clearExpired();
38         support.structureCache.clearExpired();
39     }
40
41 }