| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library barback.asset_node; |
| 6 |
| 7 import 'dart:async'; |
| 8 |
| 9 import 'asset.dart'; |
| 10 import 'asset_graph.dart'; |
| 11 import 'asset_id.dart'; |
| 12 import 'phase.dart'; |
| 13 import 'transform_node.dart'; |
| 14 |
| 15 /// Describes an asset and its relationship to the build dependency graph. |
| 16 /// |
| 17 /// Keeps a cache of the last asset that was built for this node (i.e. for this |
| 18 /// node's ID and phase) and tracks which transforms depend on it. |
| 19 class AssetNode { |
| 20 final AssetId id; |
| 21 Asset asset; |
| 22 |
| 23 /// The [TransformNode]s that consume this node's asset as an input. |
| 24 final consumers = new Set<TransformNode>(); |
| 25 |
| 26 AssetNode(this.id); |
| 27 |
| 28 /// Updates this node's generated asset value and marks all transforms that |
| 29 /// use this as dirty. |
| 30 void updateAsset(Asset asset) { |
| 31 this.asset = asset; |
| 32 consumers.forEach((consumer) => consumer.dirty()); |
| 33 } |
| 34 } |
| OLD | NEW |