Trait encompassing all associated metadata of a stack element.
Trait encompassing all associated metadata of a stack element. Stackables extend this trait.
A convenience class to construct stackable modules.
A convenience class to construct stackable modules. This variant
operates over stacks and the entire parameter map. The ModuleN
variants
may be more convenient for most definitions as they operate over T
types
and the parameter extraction is derived from type parameters.
ModuleParams
is similar, except it requires parameters
to be declared.
def myNode = new Module[Int=>Int]("myelem") { val role = "Multiplier" val description = "Multiplies values by a multiplier" val parameters = Seq(implicitly[Stack.Param[Multiplied]]) def make(params: Params, next: Stack[Int=>Int]): Stack[Int=>Int] = { val Multiplier(m) = params[Multiplier] if (m == 1) next // It's a no-op, skip it. else Stack.leaf("multiply", i => next.make(params)(i)*m) } }
A module of 0 parameters.
A module of 1 parameter.
A module of 2 parameters.
A module of 3 parameters.
A module of 4 parameters.
A module of 5 parameters.
A module of 6 parameters.
A module of 7 parameters.
A typeclass representing P-typed elements, eligible as parameters for stack configuration.
A typeclass representing P-typed elements, eligible as parameters for stack configuration. Note that the typeclass instance itself is used as the key in parameter maps; thus typeclasses should be persistent:
case class Multiplier(i: Int) { def mk(): (Multipler, Stack.Param[Multipler]) = (this, Multiplier.param) } object Multiplier { implicit val param = Stack.Param(Multiplier(123)) }
The mk()
function together with Parameterized.configured
provides a convenient Java interface.
A mix-in for describing an object that is parameterized.
A parameter map.
Base trait for Stack roles.
Base trait for Stack roles. A stack's role is indicative of its functionality. Roles provide a way to group similarly-purposed stacks and slot stack elements into specific usages.
Encodes transformations for stacks of
ServiceFactories of
arbitrary Req
and Rep
types.
Encodes transformations for stacks of
ServiceFactories of
arbitrary Req
and Rep
types. Such transformations must be
indifferent to these types in order to typecheck.
If only a role is given when constructing a leaf, then the head is created automatically
A static stack element; necessarily the last.
A constructor for a 'simple' Node.
Nodes materialize by transforming the underlying stack in some way.
stack.nilStack for starting construction of an empty stack for ServiceFactorys.