]> gerrit.simantics Code Review - simantics/platform.git/blob
883f8099f29a93ff717cfba3e86d173a2d70bbd8
[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 /*    public void registerNodeSupport(NodeSupport<Node> support) {
35         this.support = support;
36     }
37
38
39     public void registerSupport(NodeSupport<Node> support) {
40         this.support = support;
41     }*/
42
43     @Override
44     public void refreshVariable(Node node) {
45         super.refreshVariable(node);
46         support.valueCache.clearExpired();
47         support.structureCache.clearExpired();
48     }
49
50 }