/* * WARNING: Auto-generated file (05/28/2018 22:20:19) * Run Rx's auto-homoiconizer tool to generate this file (in the HomoIcon directory). */ #pragma warning disable 1591 using System.Collections.Generic; using System.Linq.Expressions; using System.Reactive.Concurrency; using System.Reflection; namespace System.Reactive.Linq { public static partial class QbservableEx { #if !STABLE /// /// Subscribes to each observable sequence returned by the iteratorMethod in sequence and produces a Unit value on the resulting sequence for each step of the iteration. /// /// Query provider used to construct the data source. /// Iterator method that drives the resulting observable sequence. /// An observable sequence obtained by running the iterator and returning Unit values for each iteration step. /// /// is null. [Experimental] public static IQbservable Create(this IQbservableProvider provider, Expression>>> iteratorMethod) { if (provider == null) throw new ArgumentNullException(nameof(provider)); if (iteratorMethod == null) throw new ArgumentNullException(nameof(iteratorMethod)); return provider.CreateQuery( Expression.Call( null, (MethodInfo)MethodInfo.GetCurrentMethod(), Expression.Constant(provider, typeof(IQbservableProvider)), iteratorMethod ) ); } #endif #if !STABLE /// /// Subscribes to each observable sequence returned by the iteratorMethod in sequence and returns the observable sequence of values sent to the observer given to the iteratorMethod. /// /// Query provider used to construct the data source. /// The type of the elements in the produced sequence. /// Iterator method that produces elements in the resulting sequence by calling the given observer. /// An observable sequence obtained by running the iterator and returning the elements that were sent to the observer. /// /// is null. [Experimental] public static IQbservable Create(this IQbservableProvider provider, Expression, IEnumerable>>> iteratorMethod) { if (provider == null) throw new ArgumentNullException(nameof(provider)); if (iteratorMethod == null) throw new ArgumentNullException(nameof(iteratorMethod)); return provider.CreateQuery( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), Expression.Constant(provider, typeof(IQbservableProvider)), iteratorMethod ) ); } #endif #if !STABLE /// /// Expands an observable sequence by recursively invoking selector. /// /// The type of the elements in the source sequence and each of the recursively expanded sources obtained by running the selector function. /// Source sequence with the initial elements. /// Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again. /// An observable sequence containing all the elements produced by the recursive expansion. /// /// or is null. [Experimental] public static IQbservable Expand(this IQbservable source, Expression>> selector) { if (source == null) throw new ArgumentNullException(nameof(source)); if (selector == null) throw new ArgumentNullException(nameof(selector)); return source.Provider.CreateQuery( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector ) ); } #endif #if !STABLE /// /// Expands an observable sequence by recursively invoking selector, using the specified scheduler to enumerate the queue of obtained sequences. /// /// The type of the elements in the source sequence and each of the recursively expanded sources obtained by running the selector function. /// Source sequence with the initial elements. /// Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again. /// Scheduler on which to perform the expansion by enumerating the internal queue of obtained sequences. /// An observable sequence containing all the elements produced by the recursive expansion. /// /// or or is null. [Experimental] public static IQbservable Expand(this IQbservable source, Expression>> selector, IScheduler scheduler) { if (source == null) throw new ArgumentNullException(nameof(source)); if (selector == null) throw new ArgumentNullException(nameof(selector)); if (scheduler == null) throw new ArgumentNullException(nameof(scheduler)); return source.Provider.CreateQuery( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } #endif #if !STABLE /// /// Runs all specified observable sequences in parallel and collects their last elements. /// /// Query provider used to construct the data source. /// The type of the elements in the source sequences. /// Observable sequence to collect the last elements for. /// An observable sequence with an array collecting the last elements of all the input sequences. /// /// is null. [Experimental] public static IQbservable ForkJoin(this IQbservableProvider provider, params IObservable[] sources) { if (provider == null) throw new ArgumentNullException(nameof(provider)); if (sources == null) throw new ArgumentNullException(nameof(sources)); return provider.CreateQuery( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } #endif #if !STABLE /// /// Runs all observable sequences in the enumerable sources sequence in parallel and collect their last elements. /// /// Query provider used to construct the data source. /// The type of the elements in the source sequences. /// Observable sequence to collect the last elements for. /// An observable sequence with an array collecting the last elements of all the input sequences. /// /// is null. [Experimental] public static IQbservable ForkJoin(this IQbservableProvider provider, IEnumerable> sources) { if (provider == null) throw new ArgumentNullException(nameof(provider)); if (sources == null) throw new ArgumentNullException(nameof(sources)); return provider.CreateQuery( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), Expression.Constant(provider, typeof(IQbservableProvider)), GetSourceExpression(sources) ) ); } #endif #if !STABLE /// /// Runs two observable sequences in parallel and combines their last elements. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// The type of the elements in the result sequence, returned by the selector function. /// First observable sequence. /// Second observable sequence. /// Result selector function to invoke with the last elements of both sequences. /// An observable sequence with the result of calling the selector function with the last elements of both input sequences. /// /// or or is null. [Experimental] public static IQbservable ForkJoin(this IQbservable first, IObservable second, Expression> resultSelector) { if (first == null) throw new ArgumentNullException(nameof(first)); if (second == null) throw new ArgumentNullException(nameof(second)); if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector)); return first.Provider.CreateQuery( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TResult)), first.Expression, GetSourceExpression(second), resultSelector ) ); } #endif #if !STABLE /// /// Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. /// This operator allows for a fluent style of writing queries that use the same sequence multiple times. /// /// The type of the elements in the source sequence. /// The type of the elements in the result sequence. /// Source sequence that will be shared in the selector function. /// Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. /// An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. /// /// or is null. [Experimental] public static IQbservable Let(this IQbservable source, Expression, IObservable>> selector) { if (source == null) throw new ArgumentNullException(nameof(source)); if (selector == null) throw new ArgumentNullException(nameof(selector)); return source.Provider.CreateQuery( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector ) ); } #endif #if !STABLE /// /// Comonadic bind operator. /// [Experimental] public static IQbservable ManySelect(this IQbservable source, Expression, TResult>> selector) { if (source == null) throw new ArgumentNullException(nameof(source)); if (selector == null) throw new ArgumentNullException(nameof(selector)); return source.Provider.CreateQuery( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector ) ); } #endif #if !STABLE /// /// Comonadic bind operator. /// [Experimental] public static IQbservable ManySelect(this IQbservable source, Expression, TResult>> selector, IScheduler scheduler) { if (source == null) throw new ArgumentNullException(nameof(source)); if (selector == null) throw new ArgumentNullException(nameof(selector)); if (scheduler == null) throw new ArgumentNullException(nameof(scheduler)); return source.Provider.CreateQuery( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(scheduler, typeof(IScheduler)) ) ); } #endif /// /// Merges two observable sequences into one observable sequence by combining each element from the first source with the latest element from the second source, if any. /// /// The type of the elements in the first source sequence. /// The type of the elements in the second source sequence. /// First observable source. /// Second observable source. /// An observable sequence containing the result of combining each element of the first source with the latest element from the second source, if any, as a tuple value. /// or is null. public static IQbservable<(TFirst First, TSecond Second)> WithLatestFrom(this IQbservable first, IObservable second) { if (first == null) throw new ArgumentNullException(nameof(first)); if (second == null) throw new ArgumentNullException(nameof(second)); return first.Provider.CreateQuery<(TFirst First, TSecond Second)>( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TFirst), typeof(TSecond)), first.Expression, GetSourceExpression(second) ) ); } /// /// Merges an observable sequence and an enumerable sequence into one observable sequence of tuple values. /// /// The type of the elements in the first observable source sequence. /// The type of the elements in the second enumerable source sequence. /// First observable source. /// Second enumerable source. /// An observable sequence containing the result of pairwise combining the elements of the first and second source as a tuple value. /// or is null. public static IQbservable<(TFirst First, TSecond Second)> Zip(this IQbservable first, IEnumerable second) { if (first == null) throw new ArgumentNullException(nameof(first)); if (second == null) throw new ArgumentNullException(nameof(second)); return first.Provider.CreateQuery<(TFirst First, TSecond Second)>( Expression.Call( null, ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TFirst), typeof(TSecond)), first.Expression, GetSourceExpression(second) ) ); } } } #pragma warning restore 1591