MangledNameBuilder

class MangledNameBuilder(initialName: String = "")

Builder for creating unique (but mangled) stage names.

The general form of the stage name is pipeline[<$index>](<$stageType>)::<$stageComponents>, referring to the of index-th pipeline stage with type stageType. Nested stages have additional $ components added to indicate nested pipelines.

Example 1:

- Compile -> pipeline[0](Compile)
- Compile -> pipeline[1](Compile)
- StdioTest -> pipeline[2](StdioTest)
- StdioTest -> pipeline[3](StdioTest)
- Score -> pipeline[4](Score)

In addition, if Compile has a property exitCode, it is accessed by appending ::exitCode to the end of the expression.

Example 2:

- ParExec -> pipeline[0](ParExec)
- SeqExec -> pipeline[0](ParExec)[0](SeqExec)
- Compile -> pipeline[0](ParExec)[0](SeqExec)$pipeline[0](Compile)
- StdioTest -> pipeline[0](ParExec)[0](SeqExec)$pipeline[1](StdioTest)
- SeqExec -> pipeline[0](ParExec)[1](SeqExec)
- Compile -> pipeline[0](ParExec)[1](SeqExec)$pipeline[0](Compile)
- StdioTest -> pipeline[0](ParExec)[1](SeqExec)$pipeline[1](StdioTest)

The SeqExec nested within the ParExec does not require the pipeline qualifier, because ParExec does not create pipelines, but rather houses a single nested pipeline.

Note that the builder makes no attempt to verify the correctness of the mangled name.

This builder assumes the following context is available:

  • The index of the pipeline stage in the root-level pipeline.

  • The index of the pipeline stage in the nested pipeline, if available.

Throws

if:

  • Initial name is non-empty but blank

  • Initial name does not start with the keyword "pipeline"

  • Initial name does not end with either an index, a stage type, or an identifier name.

Constructors

Link copied to clipboard
constructor(initialName: String = "")

Properties

Link copied to clipboard

Whether the builder is in stage component context.

Link copied to clipboard

Whether the builder is in pipeline context.

Link copied to clipboard
private val sb: StringBuilder

Functions

Link copied to clipboard

Appends an index to the mangled name.

Link copied to clipboard

Appends a key to the mangled name.

Link copied to clipboard

Appends a nested stage to the mangled name.

Link copied to clipboard

Appends the pipeline type to the mangled name.

Link copied to clipboard

Append a pipeline stage to the mangled name using its index in the pipeline.

Link copied to clipboard

Appends a stage component to the mangled name.

Link copied to clipboard

Appends stage components to the mangled name.

Link copied to clipboard

Appends a pipeline index to the mangled name.

Link copied to clipboard
fun build(): String

Builds the name as a String.

Link copied to clipboard
open override fun toString(): String

Builds the name as a String.