Exemplo n.º 1
0
 public map(Func <TOldAddress, TNewAddress> f, IRangeRestriction <TOldAddress> c)
 {
     this.f = f;
     this.c = c;
     // ISSUE: explicit constructor call
     base.ctor();
     RangeRestriction.map <TNewAddress, TOldAddress> map136 = this;
 }
Exemplo n.º 2
0
        Tuple <IIndex <a>, VectorConstruction> IIndexBuilder.GetAddressRange <a>(Tuple <IIndex <a>, VectorConstruction> _arg11, RangeRestriction <long> range)
        {
            Tuple <IIndex <a>, VectorConstruction> tuple = _arg11;
            VectorConstruction vectorConstruction1       = tuple.Item2;
            IIndex <a>         index1  = tuple.Item1;
            IIndexBuilder      builder = (IIndexBuilder)this;
            FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > fsharpChoice = range.AsAbsolute(index1.KeyCount);

            if (fsharpChoice is FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice1Of2)
            {
                FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice1Of2 choice1Of2 = (FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice1Of2)fsharpChoice;
                long num1 = choice1Of2.get_Item().Item1;
                if (choice1Of2.get_Item().Item2 < num1)
                {
                    long num2 = choice1Of2.get_Item().Item1;
                    long num3 = choice1Of2.get_Item().Item2;
                    return(new Tuple <IIndex <a>, VectorConstruction>((IIndex <a>) new LinearIndex <a>(ReadOnlyCollection.empty <a>(), builder, FSharpOption <bool> .Some(true)), VectorConstruction.NewEmpty(0L)));
                }
            }
            if (!(fsharpChoice is FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice2Of2))
            {
                FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice1Of2 choice1Of2 = (FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice1Of2)fsharpChoice;
                long startAddress         = choice1Of2.get_Item().Item1;
                long endAddress           = choice1Of2.get_Item().Item2;
                VectorConstruction range1 = VectorConstruction.NewGetRange(vectorConstruction1, RangeRestriction <long> .NewFixed(startAddress, endAddress));
                return(new Tuple <IIndex <a>, VectorConstruction>((IIndex <a>) new LinearRangeIndex <a>(index1, startAddress, endAddress), range1));
            }
            IRangeRestriction <long> indices = ((FSharpChoice <Tuple <long, long>, IRangeRestriction <long> > .Choice2Of2)fsharpChoice).get_Item();
            IEnumerable <a>          @as     = (IEnumerable <a>) new LinearIndex.newKeys <a>(index1, indices, new long(), (IEnumerator <long>)null, 0, default(a));
            IIndex <a> index2 = builder.Create <a>(@as, (FSharpOption <bool>)null);

            LinearIndex.relocations relocations59218 = new LinearIndex.relocations();
            long   lo  = 0;
            long   hi  = index2.KeyCount - 1L;
            object obj = lo > hi ? (object)new LinearIndex.relocations(lo, hi, 1L, (Func <long, Func <long, bool> >) new LinearIndex.relocations()) : (object)new LinearIndex.relocations(lo, hi, 1L, (Func <long, Func <long, bool> >) new LinearIndex.relocations());
            IEnumerable <Tuple <long, long> > tuples = (IEnumerable <Tuple <long, long> >)SeqModule.Zip <long, long>((IEnumerable <M0>)SeqModule.Map <long, long>((Func <M0, M1>)relocations59218, (IEnumerable <M0>)obj), (IEnumerable <M1>)indices);
            VectorConstruction vectorConstruction2   = VectorConstruction.NewRelocate(vectorConstruction1, index2.KeyCount, tuples);

            return(new Tuple <IIndex <a>, VectorConstruction>(index2, vectorConstruction2));
        }
Exemplo n.º 3
0
        public static RangeRestriction <TNewAddress> map <TOldAddress, TNewAddress>(Func <TOldAddress, TNewAddress> f, RangeRestriction <TOldAddress> _arg1)
        {
            RangeRestriction <TOldAddress> rangeRestriction = _arg1;

            switch (rangeRestriction.Tag)
            {
            case 1:
                return(RangeRestriction <TNewAddress> .NewStart(((RangeRestriction <TOldAddress> .Start)rangeRestriction).item));

            case 2:
                return(RangeRestriction <TNewAddress> .NewEnd(((RangeRestriction <TOldAddress> .End)rangeRestriction).item));

            case 3:
                IRangeRestriction <TOldAddress> c = ((RangeRestriction <TOldAddress> .Custom)rangeRestriction).item;
                return(RangeRestriction <TNewAddress> .NewCustom(new RangeRestriction.map <TNewAddress, TOldAddress>(f, c)));

            default:
                RangeRestriction <TOldAddress> .Fixed @fixed = (RangeRestriction <TOldAddress> .Fixed)rangeRestriction;
                TOldAddress oldAddress1 = @fixed.item1;
                TOldAddress oldAddress2 = @fixed.item2;
                return(RangeRestriction <TNewAddress> .NewFixed(f.Invoke(oldAddress1), f.Invoke(oldAddress2)));
            }
        }
Exemplo n.º 4
0
 public static RangeRestriction <TAddress> NewCustom(IRangeRestriction <TAddress> item)
 {
     return((RangeRestriction <TAddress>) new RangeRestriction <TAddress> .Custom(item));
 }
Exemplo n.º 5
0
 internal Custom(IRangeRestriction <TAddress> item)
     : base(3)
 {
     this.item = item;
 }