Exemple #1
0
        public virtual SetWithRoles <TValue, TValueQuery, TValueImmutable> NewFastSet <TValue, TValueQuery, TValueImmutable>(ISet <TValue> setToUse = null, ISet <TValueQuery> queriesSet = null, ISet <TValueImmutable> immutablesSet = null)
            where TValue : Mutable <TValueQuery, TValueImmutable>
            where TValueQuery : MutableQuery <TValueImmutable>
        {
            if (setToUse == null)
            {
                if ((queriesSet != null && queriesSet.Count > 0) ||
                    (immutablesSet != null && immutablesSet.Count > 0))
                {
                    throw new ArgumentException("The set of mutable typed objects was null, however the set of either query or immutable query contained at least one element.");
                }
            }
            else
            {
                var count = setToUse.Count;
                if ((count > 0 && queriesSet == null) ||
                    (queriesSet != null && queriesSet.Count != count) ||
                    (count > 0 && immutablesSet == null) ||
                    (immutablesSet != null && immutablesSet.Count != count))
                {
                    throw new ArgumentException("The set of mutable type objects was not null, however there was a count mismatch in either query or immutable query sets.");
                }
            }
            setToUse      = setToUse ?? new HashSet <TValue>();
            queriesSet    = queriesSet ?? new HashSet <TValueQuery>();
            immutablesSet = immutablesSet ?? new HashSet <TValueImmutable>();
            var state = new FastSetState <TValue, TValueQuery, TValueImmutable>(setToUse, queriesSet, immutablesSet);
            var setIQ = new FastSetImmutableQueryImpl <TValue, TValueQuery, TValueImmutable>(state);

            return(new SetWithRolesImpl <TValue, TValueQuery, TValueImmutable>(new SetQueryOfMutablesImpl <TValue, TValueQuery, TValueImmutable>(setIQ, new FastSetQueryOfQueriesImpl <TValue, TValueQuery, TValueImmutable>(setIQ, state), state), state));
        }
Exemple #2
0
 internal FastSetImmutableQueryImpl(FastSetState <TValue, TValueQuery, TValueImmutable> state)
     : base(state)
 {
     this._state = state;
 }
Exemple #3
0
 internal FastSetQueryOfQueriesImpl(SetQuery <TValueImmutable> immutableQuery, FastSetState <TValue, TValueQuery, TValueImmutable> state)
     : base(immutableQuery, state)
 {
     this._state = state;
 }