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

Unified Diff: pkg/barback/lib/src/declaring_transform.dart

Issue 178223024: Refactor the Transform classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: pkg/barback/lib/src/declaring_transform.dart
diff --git a/pkg/barback/lib/src/declaring_transform.dart b/pkg/barback/lib/src/declaring_transform.dart
index 3e621d9b3519abb97de482c75a1aa72c3f765122..3f6ecbd4fbd1a9ccafc8bd242cfe87501abec4c0 100644
--- a/pkg/barback/lib/src/declaring_transform.dart
+++ b/pkg/barback/lib/src/declaring_transform.dart
@@ -6,18 +6,16 @@ library barback.declaring_transform;
import 'asset_id.dart';
import 'base_transform.dart';
-import 'transform_logger.dart';
import 'transform_node.dart';
/// A transform for [DeclaringTransform]ers that allows them to declare the ids
/// of the outputs they'll generate without generating the concrete bodies of
/// those outputs.
class DeclaringTransform extends BaseTransform {
- final Set<AssetId> _outputIds;
+ final _outputIds = new Set<AssetId>();
- DeclaringTransform(TransformNode node, this._outputIds,
- LogFunction logFunction)
- : super(node, logFunction);
+ DeclaringTransform._(TransformNode node)
+ : super(node);
/// Stores [id] as the id of an output that will be created by this
/// transformation when it's run.
@@ -32,3 +30,15 @@ class DeclaringTransform extends BaseTransform {
_outputIds.add(id);
}
}
+
+/// The controller for [DeclaringTransform].
+class DeclaringTransformController extends BaseTransformController {
+ DeclaringTransform get transform => super.transform;
+
+ /// The set of ids that the transformer declares it will emit for the given
+ /// primary input.
+ Set<AssetId> get outputIds => transform._outputIds;
+
+ DeclaringTransformController(TransformNode node)
+ : super(new DeclaringTransform._(node));
+}

Powered by Google App Engine
This is Rietveld 408576698