public getQualifier ( string field ) : QualifierBase | ||
field | string | |
return | QualifierBase |
public void T01_PipeHdfContext() { PipeHdfContext ctx2 = new PipeHdfContext(); ctx2.setQualifier("blah", "1"); PipeHdfContext ctx = new PipeHdfContext(); ctx.setQualifier("foo", "bar"); ctx.setQualifier("baz", "blah"); ctx.setSubtree("baz", ctx2); Assert.AreEqual(new QualifierExact("bar"), ctx.getQualifier("foo", "deffoo")); Assert.AreEqual(new QualifierExact("blah"), ctx.getQualifier("baz", "defblah")); Assert.AreEqual(new QualifierExact("def not present"), ctx.getQualifier("notpresent", "def not present")); Assert.AreEqual(ctx2, ctx.getSubtree("baz")); }
internal override void _generateRowQualifierFromContext(PipeHdfContext ctx, PipeRowQualifier rob) { QualifierBase qual = ctx.getQualifier(this.context_key); if (qual != null) { rob.appendKeyPart(qual); } else { throw new PipeGenerateException(this, "missing context: " + this.context_key); } this.next_stage._generateRowQualifierFromContext(ctx, rob); }
internal override void _generateRowQualifierFromContext(PipeHdfContext ctx, PipeRowQualifier rob) { // TODO typecheck this cast and throw a useful execption QualifierExact mux_key = (QualifierExact) ctx.getQualifier(this.context_key, this.default_muxvalue); if (mux_key != null) { rob.appendKeyPart(mux_key); { PipeStage next_stage; try { next_stage = this.mux_map[mux_key]; } catch (KeyNotFoundException) { throw new PipeGenerateException(this, "missing mux_map entry for: " + this.context_key + " : " + mux_key); } next_stage._generateRowQualifierFromContext(ctx, rob); } } else { throw new PipeGenerateException(this, "missing mux context: " + this.context_key); } }