internal StackMarker(IApplicable thunk, object mark1, object mark2) : base() { this.thunk = thunk; this.mark1 = mark1; this.mark2 = mark2; }
internal CallFromPrimitive2(IApplicable op, object arg0, object arg1) : base() { this.op = op; this.arg0 = arg0; this.arg1 = arg1; }
public static void ThrowIfApplied(this IApplicable applicable) { if (applicable.IsApplied) { throw new InvalidOperationException($"Applicable ({applicable.GetType()}) is applied and readonly for now"); } }
public static void ApplySafety(this IApplicable applicable) { if (!applicable.IsApplied) { applicable.Apply(); } }
internal static bool Call(out object answer, ref Control expression, ref Environment environment, object evop, object evarg0, object evarg1, object evarg2, object evarg3) { IApplicable op = evop as IApplicable; if (op == null) { throw new NotImplementedException("Application of non-procedure object."); } return(op.Call(out answer, ref expression, ref environment, evarg0, evarg1, evarg2, evarg3)); }
public static bool WithInterruptMask(out object answer, object arg0, object arg1) { IApplicable receiver = arg1 as IApplicable; if (receiver == null) { throw new NotImplementedException("Receiver is not applicable."); } answer = new TailCallInterpreter(new InterruptMask(arg0, receiver), null); return(true); }
public static bool WithStackMarker(out object answer, object thunk, object mark1, object mark2) { IApplicable athunk = thunk as IApplicable; if (athunk == null) { throw new NotImplementedException("Thunk is not applicable."); } answer = new TailCallInterpreter(new StackMarker(athunk, mark1, mark2), null); return(true); }
/// <summary> /// /// After the enumeration of the REST API is complete, this method will enumerate through the raw payloads that /// were retrieved; it will then use metadata in order to parse and then load the data into specific table columns. /// /// <param name="poProcess">The structure that represents the Process being currently run</param> /// <returns>None</returns> /// </summary> private void ApplyDataSnapshot(AceProcess poProcess) { int nTotalRecords = 0; int nFailedRecords = 0; string sSubject = "PmdAceConsumptionServiceImpl::ApplyDataSnapshot()"; Hashtable CurrRecord = new Hashtable(); try { Dictionary <string, IApplicable> BucketApplyManagers = CreateApplyManagers(poProcess); using (AceChangeRecordReader oRecordReader = new AceChangeRecordReader(moStgConnectionMetadata, poProcess)) { foreach (Hashtable TempRecord in oRecordReader) { CurrRecord = TempRecord; // We should probably have a better way of detecting successful records vs. error records if (TempRecord.Count > 1) { foreach (string sTmpBucketName in BucketApplyManagers.Keys) { if (AreBucketValuesPresent(poProcess, sTmpBucketName, TempRecord)) { IApplicable ApplyManager = BucketApplyManagers[sTmpBucketName]; ApplyManager.UpsertRecord(TempRecord); } } } else { nFailedRecords++; } nTotalRecords++; if ((nTotalRecords % 1000) == 0) { LogInfo(sSubject, "Applied (" + nTotalRecords + ") records to the staging table(s)"); Console.Out.Flush(); } } } } catch (Exception ex) { LogError(sSubject, "ERROR! An error has taken place with record -> Contents: (" + CurrRecord.ToString() + ")", ex); } } // method()
public static bool WithHistoryDisabled(out object answer, object arg0) { IApplicable thunk = arg0 as IApplicable; if (thunk == null) { throw new NotImplementedException("Thunk is not applicable."); } answer = new TailCallInterpreter(new HistoryDisabled(thunk), null); return(true); }
public AppliedEventResult <TEntity> Result <TEntity>( Func <TEvent, TEntity, TEntity> whenFunc, IApplicable <TEntity> entity ) { var applied = entity.Appled(); return(new AppliedEventResult <TEntity>( whenFunc((TEvent)_event, applied.Result()), applied .Events() .Concat(new [] { _event }) )); }
public static bool UserApply(out object answer, object arg0, object arg1) { ////Primitive.Noisy = true; IApplicable op = arg0 as IApplicable; Cons rands = arg1 as Cons; if (op == null) { throw new NotImplementedException("Apply non applicable."); } if (arg1 != null && rands == null) { throw new NotImplementedException("Bad list to apply."); } answer = new TailCallInterpreter(new ApplyFromPrimitive(op, rands), null); return(true); // special return }
public static bool CallWithCurrentContinuation(out object answer, object arg) { //if (cwccTroubleCount++ > 7) Debugger.Break (); // extreme hair ahead IApplicable receiver = arg as IApplicable; if (receiver == null) { throw new NotImplementedException("Receiver cannot be applied."); } // Create an initial unwinder state. After reload, we resume at // CWCCFrame0. UnwinderState env = new UnwinderState(new CWCCFrame0(receiver)); // Return from the primitive with instructions to unwind the stack. answer = new TailCallInterpreter(Interpreter.UnwindStackExpression, env); return(true); }
public static bool WithinControlPoint(out object answer, object arg0, object arg1) { // extreme hair ahead IApplicable thunk = arg1 as IApplicable; if (thunk == null) { throw new NotImplementedException("Thunk is not applicable."); } // Create an initial unwinder state. After reload, we resume at // WithinControlPointFrame. UnwinderState env = new UnwinderState((ControlPoint)arg0, new WithinControlPointFrame(thunk)); // Return from the primitive with instructions to unwind the stack. answer = new TailCallInterpreter(Interpreter.UnwindStackExpression, env); return(true); }
internal HistoryDisabled(IApplicable arg0) : base() { this.thunk = arg0; }
static ZilResult PerformMap([NotNull] Context ctx, ZilObject finalf, IApplicable loopf, [NotNull] IStructure[] structs, bool first) { if (structs == null) { throw new ArgumentNullException(nameof(structs)); } var finalf_app = finalf.AsApplicable(ctx); int numStructs = structs.Length; var loopArgs = new ZilObject[numStructs]; var results = new List <ZilObject>(); bool running = true; while (running) { // prepare loop args int i; for (i = 0; i < numStructs; i++) { var st = structs[i]; if (st == null || st.IsEmpty) { break; } if (first) { loopArgs[i] = st.GetFirst(); } else { loopArgs[i] = (ZilObject)st; } structs[i] = st.GetRest(1); } if (i < numStructs) { break; } // apply loop function var result = loopf.ApplyNoEval(ctx, loopArgs); if (result.IsMapControl(out var outcome, out var value)) { switch (outcome) { case ZilResult.Outcome.MapStop: // add values to results and exit loop results.AddRange((IEnumerable <ZilObject>)value); running = false; continue; case ZilResult.Outcome.MapRet: // add values to results and continue results.AddRange((IEnumerable <ZilObject>)value); continue; case ZilResult.Outcome.MapLeave: // discard results, skip finalf, and return this value from the map return(value); default: throw new UnhandledCaseException(outcome.ToString()); } } if (result.ShouldPass()) { return(result); } results.Add((ZilObject)result); } // apply final function if (finalf_app != null) { return(finalf_app.ApplyNoEval(ctx, results.ToArray())); } return(results.Count > 0 ? results[results.Count - 1] : ctx.FALSE); }
internal CallFromPrimitive1(IApplicable op, object arg0) : base() { this.op = op; this.arg0 = arg0; }
internal CallFromPrimitive0(IApplicable op) : base() { this.op = op; }
public static CallFromPrimitive Make(IApplicable op, object arg0, object arg1) { return new CallFromPrimitive2(op, arg0, arg1); }
internal ApplyFromPrimitive(IApplicable op, Cons rands) : base() { this.op = op; this.rands = rands; }
internal InterruptMask(object arg0, IApplicable receiver) : base() { this.arg0 = arg0; this.receiver = receiver; }
public CWCCFrame0(IApplicable receiver) { this.receiver = receiver; }
internal CallFromPrimitive1(IApplicable op, object arg0) : base() { this.op = op; this.arg0 = arg0; }
public Tab(IApplicable <TabType> entity) : this(entity, new EmptyEventStream()) { }
public Tab(IApplicable <TabType> entity, IEventStream eventStream) : base(entity, eventStream) { }
public AppliedTabCreatedEvent(TabCreatedEvent evnt, IApplicable <TabType> entity) : base(evnt, entity) { }
internal InterruptMask(object arg0, IApplicable receiver) : base() { this.arg0 = arg0; this.receiver = receiver; }
public static ZilResult MAPR([NotNull] Context ctx, [Decl("<OR FALSE APPLICABLE>")] ZilObject finalf, IApplicable loopf, [NotNull][ItemNotNull] IStructure[] structs) { return(PerformMap(ctx, finalf, loopf, structs, false)); }
public WithinControlPointFrame(IApplicable thunk) { this.thunk = thunk; }
public static CallFromPrimitive Make(IApplicable op) { return new CallFromPrimitive0 (op); }
public FakeAggregateRoot(Func <TEntity, TEventType, IApplicable <TEntity> > f, IApplicable <TEntity> entity, IEnumerable <IDomainEvent> ucommetedEvents) { _f = f; _entity = entity; _ucommetedEvents = ucommetedEvents; }
internal CallFromPrimitive0(IApplicable op) : base() { this.op = op; }
protected Combination2Q(Quotation rator, SCode rand0, SCode rand1) : base(rator, rand0, rand1) { this.ratorValue = (IApplicable) rator.Quoted; }
internal CallFromPrimitive2(IApplicable op, object arg0, object arg1) : base() { this.op = op; this.arg0 = arg0; this.arg1 = arg1; }
public CWCCFrame0(IApplicable receiver) { this.receiver = receiver; }
internal HistoryDisabled(IApplicable arg0) : base() { this.thunk = arg0; }
public WithinControlPointFrame(IApplicable thunk) { this.thunk = thunk; }
internal StackMarker(IApplicable thunk, object mark1, object mark2) : base() { this.thunk = thunk; this.mark1 = mark1; this.mark2 = mark2; }
internal ApplyFromPrimitive(IApplicable op, Cons rands) : base() { this.op = op; this.rands = rands; }
public FakeAggregateRoot(Func <TEntity, TEventType, IApplicable <TEntity> > f, IApplicable <TEntity> entity) : this(f, entity, new List <IDomainEvent>()) { }
public static CallFromPrimitive Make(IApplicable op) { return(new CallFromPrimitive0(op)); }
//protected AggregateRoot(EntityState<TEntity> entityState) //{ // _entityState = entityState; //} protected AggregateRoot(IApplicable <TEntity> entity, IEventStream eventStream) { _entity = entity; _eventStream = eventStream; }
public static CallFromPrimitive Make(IApplicable op, object arg0, object arg1) { return(new CallFromPrimitive2(op, arg0, arg1)); }