From e98b8a927dac2140e17e39b42c69d07e8da21f94 Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Tue, 17 Jun 2014 10:24:24 -0700 Subject: [PATCH] Add support for singletons to walk module deps. Change-Id: I63405ee917a55ae92cf55070af94e01ddc266389 --- blueprint/singleton_ctx.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/blueprint/singleton_ctx.go b/blueprint/singleton_ctx.go index af4b6ef..343f97b 100644 --- a/blueprint/singleton_ctx.go +++ b/blueprint/singleton_ctx.go @@ -32,6 +32,9 @@ type SingletonContext interface { VisitAllModules(visit func(Module)) VisitAllModulesIf(pred func(Module) bool, visit func(Module)) + VisitDepsDepthFirst(module Module, visit func(Module)) + VisitDepsDepthFirstIf(module Module, pred func(Module) bool, + visit func(Module)) } var _ SingletonContext = (*singletonContext)(nil) @@ -133,3 +136,15 @@ func (s *singletonContext) VisitAllModulesIf(pred func(Module) bool, s.context.visitAllModulesIf(pred, visit) } + +func (s *singletonContext) VisitDepsDepthFirst(module Module, + visit func(Module)) { + + s.context.visitDepsDepthFirst(module, visit) +} + +func (s *singletonContext) VisitDepsDepthFirstIf(module Module, + pred func(Module) bool, visit func(Module)) { + + s.context.visitDepsDepthFirstIf(module, pred, visit) +}