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

Side by Side Diff: pkg/barback/lib/src/transformer/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.aggregate_transform; 5 library barback.transformer.aggregate_transform;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 import '../asset/asset.dart'; 10 import '../asset/asset.dart';
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 } 126 }
127 127
128 /// The controller for [AggregateTransform]. 128 /// The controller for [AggregateTransform].
129 class AggregateTransformController extends BaseTransformController { 129 class AggregateTransformController extends BaseTransformController {
130 AggregateTransform get transform => super.transform; 130 AggregateTransform get transform => super.transform;
131 131
132 /// The set of assets that the transformer has emitted. 132 /// The set of assets that the transformer has emitted.
133 AssetSet get outputs => transform._outputs; 133 AssetSet get outputs => transform._outputs;
134 134
135 /// The controller for the [AggregateTransform.primaryInputs] stream. 135 bool get isDone => transform._inputController.isClosed;
136 StreamController<Asset> get inputController => transform._inputController;
137 136
138 AggregateTransformController(TransformNode node) 137 AggregateTransformController(TransformNode node)
139 : super(new AggregateTransform._(node)); 138 : super(new AggregateTransform._(node));
140 139
141 void close() { 140 /// Adds a primary input asset to the [AggregateTransform.primaryInputs]
142 super.close(); 141 /// stream.
142 void addInput(Asset input) => transform._inputController.add(input);
143
144 /// Returns whether an input with the given [id] was added via [addInput].
145 bool addedId(AssetId id) {
146 return transform._emittedPrimaryInputs.ids.contains(id);
147 }
148
149 void done() {
143 transform._inputController.close(); 150 transform._inputController.close();
144 } 151 }
145 } 152 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/graph/transformer_classifier.dart ('k') | pkg/barback/lib/src/transformer/aggregate_transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698