Ejemplo n.º 1
0
 public static EventType OptionalIsEventTypeSingle(EPType type)
 {
     if (type != null && type is EventEPType)
     {
         return(((EventEPType)type).EventType);
     }
     return(null);
 }
Ejemplo n.º 2
0
 public static EventType GetEventTypeMultiValued(this EPType type)
 {
     if (type is EventMultiValuedEPType)
     {
         return(((EventMultiValuedEPType)type).Component);
     }
     return(null);
 }
Ejemplo n.º 3
0
 public static Type OptionalIsComponentTypeColl(EPType type)
 {
     if (type != null && type is ClassMultiValuedEPType)
     {
         return(((ClassMultiValuedEPType)type).Component);
     }
     return(null);
 }
Ejemplo n.º 4
0
 public static Type GetClassMultiValued(this EPType type)
 {
     if (type is ClassMultiValuedEPType)
     {
         return(((ClassMultiValuedEPType)type).Component);
     }
     return(null);
 }
Ejemplo n.º 5
0
 public static Type GetClassSingleValued(this EPType type)
 {
     if (type is ClassEPType)
     {
         return(((ClassEPType)type).Clazz);
     }
     return(null);
 }
Ejemplo n.º 6
0
 public static EventType GetEventTypeSingleValued(this EPType type)
 {
     if (type is EventEPType)
     {
         return(((EventEPType)type).EventType);
     }
     return(null);
 }
 public ExprDotEnumerationSourceForgeForProps(
     ExprEnumerationForge enumeration,
     EPType returnType,
     int? streamOfProviderIfApplicable,
     ExprEnumerationGivenEventForge enumerationGivenEvent)
     : base(returnType, streamOfProviderIfApplicable, enumeration)
 {
     EnumerationGivenEvent = enumerationGivenEvent;
 }
Ejemplo n.º 8
0
 public ExprDotForgeUnpackCollEventBeanTable(
     EventType type,
     TableMetaData table)
 {
     this.typeInfo = EPTypeHelper.CollectionOfSingleValue(
         table.PublicEventType.UnderlyingType,
         null);
     this.table = table;
 }
Ejemplo n.º 9
0
 public EnumFirstOfPredicateScalarForge(
     ExprForge innerExpression,
     int streamCountIncoming,
     ObjectArrayEventType type,
     EPType resultType)
     : base(innerExpression, streamCountIncoming, type)
 {
     this.resultType = resultType;
 }
Ejemplo n.º 10
0
 public EnumForgeDescFactoryEIU(
     EnumMethodEnum enumMethod,
     EPType type,
     ExprDotEnumerationSourceForge enumSrc)
 {
     _enumMethod = enumMethod;
     _type = type;
     _enumSrc = enumSrc;
 }
Ejemplo n.º 11
0
 public ExprDotEnumerationSourceForge(
     EPType returnType,
     int? streamOfProviderIfApplicable,
     ExprEnumerationForge enumeration)
 {
     ReturnType = returnType;
     StreamOfProviderIfApplicable = streamOfProviderIfApplicable;
     Enumeration = enumeration;
 }
Ejemplo n.º 12
0
 public ExprDotDTMethodDesc(
     ExprDotForge forge,
     EPType returnType,
     FilterExprAnalyzerAffector intervalFilterDesc)
 {
     this.forge = forge;
     this.returnType = returnType;
     this.intervalFilterDesc = intervalFilterDesc;
 }
Ejemplo n.º 13
0
 public TableMetadataColumnAggregation(string columnName, AggregationMethodFactory factory, int methodOffset, AggregationAccessorSlotPair accessAccessorSlotPair, EPType optionalEnumerationType, EventType optionalEventType)
     : base(columnName, false)
 {
     Factory                 = factory;
     MethodOffset            = methodOffset;
     AccessAccessorSlotPair  = accessAccessorSlotPair;
     OptionalEnumerationType = optionalEnumerationType;
     OptionalEventType       = optionalEventType;
 }
Ejemplo n.º 14
0
 public EnumForgeDescFactoryTake(
     EnumMethodEnum enumMethod,
     EPType type,
     bool isScalar)
 {
     _enumMethod = enumMethod;
     _type = type;
     _isScalar = isScalar;
 }
Ejemplo n.º 15
0
 public EnumMinMaxScalarForge(
     int streamCountIncoming,
     bool max,
     EPType resultType)
     : base(streamCountIncoming)
 {
     _max = max;
     _resultType = resultType;
 }
Ejemplo n.º 16
0
 protected override ThreeFormNoParamFactory.ForgeFunction NoParamsForge(
     EnumMethodEnum enumMethod,
     EPType type,
     StatementCompileTimeServices services)
 {
     return(streamCountIncoming => new EnumMostLeastFrequentScalarNoParam(
                streamCountIncoming,
                enumMethod == EnumMethodEnum.MOSTFREQUENT,
                type.GetNormalizedClass()));
 }
Ejemplo n.º 17
0
        public static ExprDotEnumerationSourceForge GetEnumerationSource(
            ExprNode inputExpression,
            StreamTypeService streamTypeService,
            bool hasEnumerationMethod,
            bool disablePropertyExpressionEventCollCache,
            StatementRawInfo statementRawInfo,
            StatementCompileTimeServices compileTimeServices)
        {
            var rootNodeForge = inputExpression.Forge;
            ExprEnumerationForge rootLambdaForge = null;
            EPType info = null;

            if (rootNodeForge is ExprEnumerationForge) {
                rootLambdaForge = (ExprEnumerationForge) rootNodeForge;
                var eventTypeCollection =
                    rootLambdaForge.GetEventTypeCollection(statementRawInfo, compileTimeServices);
                if (eventTypeCollection != null) {
                    info = EPTypeHelper.CollectionOfEvents(eventTypeCollection);
                }

                if (info == null) {
                    var eventTypeSingle =
                        rootLambdaForge.GetEventTypeSingle(statementRawInfo, compileTimeServices);
                    if (eventTypeSingle != null) {
                        info = EPTypeHelper.SingleEvent(eventTypeSingle);
                    }
                }

                if (info == null) {
                    var componentType = rootLambdaForge.ComponentTypeCollection;
                    if (componentType != null) {
                        info = EPTypeHelper.CollectionOfSingleValue(
                            rootLambdaForge.ComponentTypeCollection,
                            typeof(ICollection<>).MakeGenericType(componentType));
                    }
                }

                if (info == null) {
                    rootLambdaForge = null; // not a lambda evaluator
                }
            }
            else if (inputExpression is ExprIdentNode) {
                var identNode = (ExprIdentNode) inputExpression;
                var streamId = identNode.StreamId;
                var streamType = streamTypeService.EventTypes[streamId];
                return GetPropertyEnumerationSource(
                    identNode.ResolvedPropertyName,
                    streamId,
                    streamType,
                    hasEnumerationMethod,
                    disablePropertyExpressionEventCollCache);
            }

            return new ExprDotEnumerationSourceForge(info, null, rootLambdaForge);
        }
Ejemplo n.º 18
0
        private static Type GetMethodTarget(EPType currentInputType)
        {
            if (currentInputType is ClassEPType) {
                return ((ClassEPType) currentInputType).Clazz;
            }
            else if (currentInputType is EventEPType) {
                return ((EventEPType) currentInputType).EventType.UnderlyingType;
            }

            return null;
        }
Ejemplo n.º 19
0
 public static EventType GetEventType(this EPType epType)
 {
     if (epType is EventMultiValuedEPType)
     {
         return(((EventMultiValuedEPType)epType).Component);
     }
     if (epType is EventEPType)
     {
         return(((EventEPType)epType).EventType);
     }
     return(null);
 }
Ejemplo n.º 20
0
 public EnumMinMaxByScalarLambdaForge(
     ExprForge innerExpression,
     int streamCountIncoming,
     bool max,
     ObjectArrayEventType resultEventType,
     EPType resultType)
     : base(innerExpression, streamCountIncoming)
 {
     this.max = max;
     this.resultEventType = resultEventType;
     this.resultType = resultType;
 }
Ejemplo n.º 21
0
 public EnumMinMaxByScalar(
     ExprDotEvalParamLambda lambda,
     ObjectArrayEventType fieldEventType,
     int numParameters,
     bool max,
     EPType resultType) : base(lambda, fieldEventType, numParameters)
 {
     this._max             = max;
     this._resultType      = resultType;
     this._innerTypeBoxed  = Boxing.GetBoxedType(InnerExpression.EvaluationType);
     this._resultTypeBoxed = Boxing.GetBoxedType(EPTypeHelper.GetCodegenReturnType(resultType));
 }
Ejemplo n.º 22
0
        private static Type GetMethodTarget(EPType currentInputType)
        {
            if (currentInputType is ClassEPType classEpType)
            {
                return(classEpType.Clazz);
            }
            else if (currentInputType is EventEPType eventEpType)
            {
                return(eventEpType.EventType.UnderlyingType);
            }

            return(null);
        }
 public TwoLambdaThreeFormScalarFactory(
     ObjectArrayEventType typeFirst,
     ObjectArrayEventType typeSecond,
     int numParams,
     EPType returnType,
     TwoLambdaThreeFormScalarFactory.ForgeFunction function)
 {
     this._typeFirst  = typeFirst;
     this._typeSecond = typeSecond;
     this._numParams  = numParams;
     this._returnType = returnType;
     this._function   = function;
 }
 public TwoLambdaThreeFormEventPlainFactory(
     EventType eventType,
     string streamNameFirst,
     string streamNameSecond,
     EPType returnType,
     ForgeFunction function)
 {
     this.eventType        = eventType;
     this.streamNameFirst  = streamNameFirst;
     this.streamNameSecond = streamNameSecond;
     this.returnType       = returnType;
     this.function         = function;
 }
Ejemplo n.º 25
0
 protected override ThreeFormNoParamFactory.ForgeFunction NoParamsForge(
     EnumMethodEnum enumMethod,
     EPType type,
     StatementCompileTimeServices services)
 {
     if (enumMethod == EnumMethodEnum.FIRSTOF)
     {
         return(streamCountIncoming => new EnumFirstOf(streamCountIncoming, type));
     }
     else
     {
         return(streamCountIncoming => new EnumLastOf(streamCountIncoming, type));
     }
 }
Ejemplo n.º 26
0
        public EnumForgeDesc MakeEnumForgeDesc(
            IList <ExprDotEvalParam> bodiesAndParameters,
            int streamCountIncoming,
            StatementCompileTimeServices services)
        {
            if (bodiesAndParameters.IsEmpty())
            {
                throw new UnsupportedOperationException();
            }

            ExprDotEvalParamLambda first = (ExprDotEvalParamLambda)bodiesAndParameters[0];
            EPType    typeInfo           = _returnType.Invoke(first);
            EnumForge forge = MakeForgeWithParam(first, typeInfo, services);

            return(new EnumForgeDesc(typeInfo, forge));
        }
 public TableMetadataColumnAggregation(
     string columnName,
     bool key,
     int column,
     AggregationPortableValidation aggregationPortableValidation,
     string aggregationExpression,
     bool methodAgg,
     EPType optionalEnumerationType)
     : base(columnName, key)
 {
     Column = column;
     AggregationPortableValidation = aggregationPortableValidation;
     AggregationExpression = aggregationExpression;
     IsMethodAgg = methodAgg;
     OptionalEnumerationType = optionalEnumerationType;
 }
Ejemplo n.º 28
0
 /// <summary>Returns a nice text detailing the expression result type. </summary>
 /// <returns>descriptive text</returns>
 public static String ToTypeDescriptive(this EPType epType)
 {
     if (epType is EventEPType)
     {
         var type = (EventEPType)epType;
         return("event type '" + type.EventType.Name + "'");
     }
     else if (epType is EventMultiValuedEPType)
     {
         var type = (EventMultiValuedEPType)epType;
         if (type.Container == typeof(EventType[]))
         {
             return("array of events of type '" + type.Component.Name + "'");
         }
         else
         {
             return("collection of events of type '" + type.Component.Name + "'");
         }
     }
     else if (epType is ClassMultiValuedEPType)
     {
         var type = (ClassMultiValuedEPType)epType;
         if (type.Container.IsArray)
         {
             return("array of " + type.Component.Name);
         }
         else
         {
             return("collection of " + type.Component.Name);
         }
     }
     else if (epType is ClassEPType)
     {
         var type = (ClassEPType)epType;
         return("class " + type.Clazz.GetTypeNameFullyQualPretty());
     }
     else if (epType is NullEPType)
     {
         return("null type");
     }
     else
     {
         throw new ArgumentException("Unrecognized type " + epType);
     }
 }
 public TwoLambdaThreeFormEventPlusFactory(
     EventType inputEventType,
     string streamNameFirst,
     string streamNameSecond,
     ObjectArrayEventType typeKey,
     ObjectArrayEventType typeValue,
     int numParams,
     EPType returnType,
     ForgeFunction function)
 {
     this.inputEventType   = inputEventType;
     this.streamNameFirst  = streamNameFirst;
     this.streamNameSecond = streamNameSecond;
     this.typeKey          = typeKey;
     this.typeValue        = typeValue;
     this.numParams        = numParams;
     this.returnType       = returnType;
     this.function         = function;
 }
Ejemplo n.º 30
0
        protected override void ValidateBindingInternal(ExprValidationContext validationContext, TableMetadata tableMetadata)
        {
            ValidateGroupKeys(tableMetadata);
            var column = ValidateSubpropertyGetCol(tableMetadata, _subpropName);

            if (column is TableMetadataColumnPlain)
            {
                _bindingReturnType = tableMetadata.InternalEventType.GetPropertyType(_subpropName);
                var enumerationSource = ExprDotNodeUtility.GetPropertyEnumerationSource(_subpropName, 0, tableMetadata.InternalEventType, true, true);
                _optionalEnumerationType       = enumerationSource.ReturnType;
                _optionalPropertyEnumEvaluator = enumerationSource.EnumerationGivenEvent;
            }
            else
            {
                var aggcol = (TableMetadataColumnAggregation)column;
                _optionalEnumerationType = aggcol.OptionalEnumerationType;
                _bindingReturnType       = aggcol.Factory.ResultType;
            }
        }