Table of Contents

Struct Combinator

Namespace
Mech3DotNet.Reader
Assembly
Mech3DotNet.dll

Combinator for two IQueryOperation.

This results in a new IQueryOperation that can be applied directly, which is useful for fusing/combining two IQueryOperation.

public struct Combinator : IQueryOperation
Implements
Inherited Members

Examples

These two code snippets are equivalent:

var op1 = new FindByKey("foo");
var op2 = new FindOnly();
var res = query / op1 / op2;
var op1 = new FindByKey("foo");
   var op2 = new FindOnly();
   var op = new Combinator(op1, op2);
   var res = query / op;</code></pre>

However, the benefit of using the combinator is that the operators can be combined before being applied, which is situationally useful - for example, if a method returns a IQueryOperation.

Constructors

Combinator(IQueryOperation, IQueryOperation)

public Combinator(IQueryOperation op1, IQueryOperation op2)

Parameters

op1 IQueryOperation
op2 IQueryOperation

Methods

Apply(ReaderValue, List<string>)

Apply the operation to the ReaderValue, and modify the path appropriately.

This method is not usually called manually, but is called when the operation is applied to a Query.

public ReaderValue Apply(ReaderValue value, List<string> path)

Parameters

value ReaderValue
path List<string>

Returns

ReaderValue