OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library barback.transformer.declaring_aggregate_transform; | 5 library barback.transformer.declaring_aggregate_transform; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import '../asset/asset_id.dart'; | 9 import '../asset/asset_id.dart'; |
10 import '../graph/transform_node.dart'; | 10 import '../graph/transform_node.dart'; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 throw new StateError( | 78 throw new StateError( |
79 "$id can't be consumed because it's not a primary input."); | 79 "$id can't be consumed because it's not a primary input."); |
80 } | 80 } |
81 | 81 |
82 super.consumePrimary(id); | 82 super.consumePrimary(id); |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 /// The controller for [DeclaringAggregateTransform]. | 86 /// The controller for [DeclaringAggregateTransform]. |
87 class DeclaringAggregateTransformController extends BaseTransformController { | 87 class DeclaringAggregateTransformController extends BaseTransformController { |
88 DeclaringAggregateTransform get transform => super.transform; | 88 final DeclaringAggregateTransform transform; |
89 | 89 |
90 /// The set of ids that the transformer declares it will emit. | 90 /// The set of ids that the transformer declares it will emit. |
91 Set<AssetId> get outputIds => transform._outputIds; | 91 Set<AssetId> get outputIds => transform._outputIds; |
92 | 92 |
93 bool get isDone => transform._idController.isClosed; | 93 bool get isDone => transform._idController.isClosed; |
94 | 94 |
95 DeclaringAggregateTransformController(TransformNode node) | 95 DeclaringAggregateTransformController(TransformNode node) |
96 : super(new DeclaringAggregateTransform._(node)); | 96 : transform = new DeclaringAggregateTransform._(node); |
97 | 97 |
98 /// Adds a primary input id to the [DeclaringAggregateTransform.primaryIds] | 98 /// Adds a primary input id to the [DeclaringAggregateTransform.primaryIds] |
99 /// stream. | 99 /// stream. |
100 void addId(AssetId id) => transform._idController.add(id); | 100 void addId(AssetId id) => transform._idController.add(id); |
101 | 101 |
102 void done() { | 102 void done() { |
103 transform._idController.close(); | 103 transform._idController.close(); |
104 } | 104 } |
105 } | 105 } |
OLD | NEW |