Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: pkg/barback/lib/src/transformer/declaring_aggregate_transform.dart

Issue 267393009: Transition barback's infrastructure to an aggregate-based model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 } 80 }
81 81
82 /// The controller for [DeclaringAggregateTransform]. 82 /// The controller for [DeclaringAggregateTransform].
83 class DeclaringAggregateTransformController extends BaseTransformController { 83 class DeclaringAggregateTransformController extends BaseTransformController {
84 DeclaringAggregateTransform get transform => super.transform; 84 DeclaringAggregateTransform get transform => super.transform;
85 85
86 /// The set of ids that the transformer declares it will emit. 86 /// The set of ids that the transformer declares it will emit.
87 Set<AssetId> get outputIds => transform._outputIds; 87 Set<AssetId> get outputIds => transform._outputIds;
88 88
89 /// The controller for the [DeclaringAggregateTransform.primaryIds] stream. 89 bool get isDone => transform._idController.isClosed;
90 StreamController<AssetId> get idController => transform._idController;
91 90
92 DeclaringAggregateTransformController(TransformNode node) 91 DeclaringAggregateTransformController(TransformNode node)
93 : super(new DeclaringAggregateTransform._(node)); 92 : super(new DeclaringAggregateTransform._(node));
94 93
95 void close() { 94 /// Adds a primary input id to the [DeclaringAggregateTransform.primaryIds]
96 super.close(); 95 /// stream.
97 idController.close(); 96 void addId(AssetId id) => transform._idController.add(id);
97
98 void done() {
99 transform._idController.close();
98 } 100 }
99 } 101 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/transformer/base_transform.dart ('k') | pkg/barback/lib/src/transformer/transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698