public PropertyCompositeEventTableImpl(IList <Type> optKeyCoercedTypes, IList <Type> optRangeCoercedTypes, EventTableOrganization organization, bool isHashKeyed, CompositeIndexEnterRemove chain) : base(optKeyCoercedTypes, optRangeCoercedTypes, organization) { _chain = chain; _index = isHashKeyed ? (IDictionary <object, object>) new Dictionary <object, object>() : (IDictionary <object, object>) new OrderedDictionary <object, object>(); }
public PropertyCompositeEventTable(bool isHashKeyed, CompositeIndexEnterRemove chain, IList <Type> optKeyCoercedTypes, IList <Type> optRangeCoercedTypes, EventTableOrganization organization) { _chain = chain; _optKeyCoercedTypes = optKeyCoercedTypes; _optRangeCoercedTypes = optRangeCoercedTypes; _organization = organization; if (isHashKeyed) { _index = new Dictionary <Object, Object>(); } else { _index = new OrderedDictionary <Object, Object>(); } }
public PropertyCompositeEventTableFactory( int streamNum, string[] optionalKeyedProps, Type[] optKeyCoercedTypes, EventPropertyValueGetter hashGetter, MultiKeyFromObjectArray transformFireAndForget, string[] rangeProps, Type[] optRangeCoercedTypes, EventPropertyValueGetter[] rangeGetters) { this.StreamNum = streamNum; this.OptionalKeyedProps = optionalKeyedProps; this.OptKeyCoercedTypes = optKeyCoercedTypes; this.HashGetter = hashGetter; this.TransformFireAndForget = transformFireAndForget; this.RangeProps = rangeProps; this.OptRangeCoercedTypes = optRangeCoercedTypes; this.RangeGetters = rangeGetters; // construct chain IList<CompositeIndexEnterRemove> enterRemoves = new List<CompositeIndexEnterRemove>(); if (optionalKeyedProps != null && optionalKeyedProps.Length > 0) { enterRemoves.Add(new CompositeIndexEnterRemoveKeyed(hashGetter)); } foreach (var rangeGetter in rangeGetters) { enterRemoves.Add(new CompositeIndexEnterRemoveRange(rangeGetter)); } // Hook up as chain for remove CompositeIndexEnterRemove last = null; foreach (var action in enterRemoves) { if (last != null) { last.Next = action; } last = action; } Chain = enterRemoves[0]; }
/// <summary> /// Ctor. /// </summary> /// <param name="streamNum">the stream number that is indexed</param> /// <param name="eventType">types of events indexed</param> /// <param name="optionalKeyedProps">The optional keyed props.</param> /// <param name="optKeyCoercedTypes">The opt key coerced types.</param> /// <param name="rangeProps">The range props.</param> /// <param name="optRangeCoercedTypes">property types</param> public PropertyCompositeEventTableFactory(int streamNum, EventType eventType, IList <String> optionalKeyedProps, IList <Type> optKeyCoercedTypes, IList <String> rangeProps, IList <Type> optRangeCoercedTypes) { _streamNum = streamNum; _rangeProps = rangeProps; _optionalKeyedProps = optionalKeyedProps; _optKeyCoercedTypes = optKeyCoercedTypes; _optRangeCoercedTypes = optRangeCoercedTypes; // construct chain var enterRemoves = new List <CompositeIndexEnterRemove>(); if (optionalKeyedProps != null && optionalKeyedProps.Count > 0) { enterRemoves.Add(new CompositeIndexEnterRemoveKeyed(eventType, optionalKeyedProps, optKeyCoercedTypes)); } int count = 0; foreach (String rangeProp in rangeProps) { var coercionType = optRangeCoercedTypes == null ? null : optRangeCoercedTypes[count]; enterRemoves.Add(new CompositeIndexEnterRemoveRange(eventType, rangeProp, coercionType)); count++; } // Hook up as chain for remove CompositeIndexEnterRemove last = null; foreach (CompositeIndexEnterRemove action in enterRemoves) { if (last != null) { last.SetNext(action); } last = action; } _chain = enterRemoves[0]; }
public void SetNext(CompositeIndexEnterRemove next) { _next = next; }