public void CtorCodegen( CodegenCtor ctor, IList<CodegenTypedParam> explicitMembers, CodegenClassScope classScope, AggregationClassNames classNames) { ctor.CtorParams.Add(new CodegenTypedParam(typeof(AgentInstanceContext), NAME_AGENTINSTANCECONTEXT)); explicitMembers.Add( new CodegenTypedParam(typeof(IDictionary<object, object>), MEMBER_AGGREGATORSPERGROUP.Ref)); explicitMembers.Add(new CodegenTypedParam(typeof(object), MEMBER_CURRENTGROUPKEY.Ref)); explicitMembers.Add(new CodegenTypedParam(classNames.RowTop, MEMBER_CURRENTROW.Ref)); ctor.Block.AssignRef(MEMBER_AGGREGATORSPERGROUP, NewInstance(typeof(Dictionary<object, object>))); if (aggGroupByDesc.IsReclaimAged) { AggSvcGroupByReclaimAgedImpl.CtorCodegenReclaim( ctor, explicitMembers, classScope, reclaimAge, reclaimFreq); } if (HasRefCounting) { explicitMembers.Add(new CodegenTypedParam(typeof(IList<object>), MEMBER_REMOVEDKEYS.Ref)); ctor.Block.AssignRef(MEMBER_REMOVEDKEYS, NewInstance<List<object>>(Constant(4))); } }
public void ApplyEnterCodegen( CodegenMethod method, CodegenClassScope classScope, CodegenNamedMethods namedMethods, AggregationClassNames classNames) { method.Block .Apply( Instblock( classScope, "qAggregationGroupedApplyEnterLeave", ConstantTrue(), Constant(aggGroupByDesc.NumMethods), Constant(aggGroupByDesc.NumAccess), REF_GROUPKEY)); if (aggGroupByDesc.IsReclaimAged) { AggSvcGroupByReclaimAgedImpl.ApplyEnterCodegenSweep(method, classScope, classNames); } if (HasRefCounting) { method.Block.LocalMethod(HandleRemovedKeysCodegen(method, classScope)); } var block = method.Block.AssignRef( MEMBER_CURRENTROW, Cast(classNames.RowTop, ExprDotMethod(MEMBER_AGGREGATORSPERGROUP, "Get", REF_GROUPKEY))); block.IfCondition(EqualsNull(MEMBER_CURRENTROW)) .AssignRef(MEMBER_CURRENTROW, NewInstanceInner(classNames.RowTop, Ref("o"))) .ExprDotMethod(MEMBER_AGGREGATORSPERGROUP, "Put", REF_GROUPKEY, MEMBER_CURRENTROW); if (HasRefCounting) { block.ExprDotMethod(MEMBER_CURRENTROW, "IncreaseRefcount"); } if (aggGroupByDesc.IsReclaimAged) { block.ExprDotMethod(MEMBER_CURRENTROW, "SetLastUpdateTime", Ref("currentTime")); } block.ExprDotMethod(MEMBER_CURRENTROW, "ApplyEnter", REF_EPS, REF_EXPREVALCONTEXT) .Apply(Instblock(classScope, "aAggregationGroupedApplyEnterLeave", ConstantTrue())); }