Example #1
0
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="variantEventType">the event type</param>
 /// <param name="underlying">the event</param>
 public VariantEventBean(
     VariantEventType variantEventType,
     EventBean underlying)
 {
     this.variantEventType = variantEventType;
     UnderlyingEventBean = underlying;
 }
Example #2
0
 public VariantEventPropertyGetterAny(
     VariantEventType variantEventType,
     string propertyName)
 {
     this.variantEventType = variantEventType;
     this.propertyName = propertyName;
 }
 public VariantEventPropertyGetterAnyWCast(
     VariantEventType variantEventType,
     string propertyName,
     SimpleTypeCaster caster)
 {
     this.variantEventType = variantEventType;
     this.propertyName = propertyName;
     this.caster = caster;
 }
Example #4
0
 public static CodegenExpressionInstanceField GetField(
     VariantEventType variantEventType,
     CodegenClassScope codegenClassScope)
 {
     return codegenClassScope.AddDefaultFieldUnshared(
         true,
         typeof(VariantEventType),
         Cast(
             typeof(VariantEventType),
             EventTypeUtility.ResolveTypeCodegen(variantEventType, EPStatementInitServicesConstants.REF)));
 }
Example #5
0
        public static void ValidateInsertedIntoEventType(
            EventType eventType,
            VariantEventType variantEventType)
        {
            if (variantEventType.IsVariantAny) {
                return;
            }

            if (eventType == null) {
                throw new ExprValidationException(GetMessage(variantEventType.Name));
            }

            // try each permitted type
            var variants = variantEventType.Variants;
            foreach (var variant in variants) {
                if (variant == eventType) {
                    return;
                }
            }

            // test if any of the supertypes of the eventtype is a variant type
            foreach (var variant in variants) {
                // Check all the supertypes to see if one of the matches the full or delta types
                var deepSupers = eventType.DeepSuperTypes;
                if (deepSupers == null) {
                    continue;
                }

                EventType superType;
                foreach (var nextSuperType in deepSupers) {
                    superType = nextSuperType;
                    if (Equals(superType, variant)) {
                        return;
                    }
                }
            }

            throw new ExprValidationException(GetMessage(variantEventType.Name));
        }
Example #6
0
 public VariantPropertyGetterCacheCodegenField(VariantEventType variantEventType)
 {
     this.variantEventType = variantEventType;
 }
Example #7
0
 public VariantPropResolutionStrategyAny(VariantEventType variantEventType)
 {
     this.variantEventType = variantEventType;
 }