Ejemplo n.º 1
0
        public static LookupItem[] Compile(ParticleConstraint particle)
        {
            var instance = new ParticleCompiler();

            instance.Visit(particle);

            var result = new LookupItem[instance._path.Count];

            instance._path.CopyTo(result);

            return(result);
        }
Ejemplo n.º 2
0
        private void Visit(ParticleConstraint particle)
        {
            switch (particle)
            {
            case ElementParticle element:
            {
                Visit(element);
                break;
            }

            case CompositeParticle any when any.ParticleType == ParticleType.Any:
            {
                throw new NotSupportedException(ExceptionMessages.AnyParticleTypeNotSupported);
            }

            case CompositeParticle composite:
            {
                VisitComposite(composite);
                break;
            }
            }
        }
Ejemplo n.º 3
0
 public static CompiledParticle Compile(this ParticleConstraint particle)
 => new CompiledParticle(particle);
Ejemplo n.º 4
0
 public static ParticlePathItem Create(ParticleConstraint particle, byte index)
 => new ParticlePathItem(particle.ParticleType, index);
Ejemplo n.º 5
0
 public CompiledParticle(ParticleConstraint particle)
 {
     Particle = particle;
     _lookup  = new Lazy <LookupItem[]>(() => ParticleCompiler.Compile(Particle), true);
 }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ParticleConstraint obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }