/*
* WARNING: Auto-generated file (11/21/2013 11:07:25 AM)
* Run Rx's auto-homoiconizer tool to generate this file (in the HomoIcon directory).
*/
#pragma warning disable 1591
#if !NO_EXPRESSIONS
using System;
using System.Reactive.Concurrency;
using System.Collections.Generic;
using System.Reactive.Joins;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading;
using System.Reactive;
using System.Reactive.Subjects;
#if !NO_TPL
using System.Threading.Tasks;
#endif
#if !NO_REMOTING
using System.Runtime.Remoting.Lifetime;
#endif
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 IQbservable<T> 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("provider");
if (iteratorMethod == null)
throw new ArgumentNullException("iteratorMethod");
return provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => QbservableEx.Create(default(IQbservableProvider), default(Expression>>>))),
#else
(MethodInfo)MethodInfo.GetCurrentMethod(),
#endif
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 IQbservable<T> 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("provider");
if (iteratorMethod == null)
throw new ArgumentNullException("iteratorMethod");
return provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => QbservableEx.Create(default(IQbservableProvider), default(Expression, IEnumerable>>>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)),
#endif
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("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => QbservableEx.Expand(default(IQbservable), default(Expression>>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
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("source");
if (selector == null)
throw new ArgumentNullException("selector");
if (scheduler == null)
throw new ArgumentNullException("scheduler");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => QbservableEx.Expand(default(IQbservable), default(Expression>>), default(IScheduler))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
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 IQbservable<T> 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("provider");
if (sources == null)
throw new ArgumentNullException("sources");
return provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => QbservableEx.ForkJoin(default(IQbservableProvider), default(IObservable[]))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
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 IQbservable<T> 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("provider");
if (sources == null)
throw new ArgumentNullException("sources");
return provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => QbservableEx.ForkJoin(default(IQbservableProvider), default(IEnumerable>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
#endif
Expression.Constant(provider, typeof(IQbservableProvider)),
GetSourceExpression(sources)
)
);
}
#endif
#if !STABLE
///
/// Runs two observable sequences in parallel and combines their last elemenets.
///
/// 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("first");
if (second == null)
throw new ArgumentNullException("second");
if (resultSelector == null)
throw new ArgumentNullException("resultSelector");
return first.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => QbservableEx.ForkJoin(default(IQbservable), default(IObservable), default(Expression>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource1), typeof(TSource2), typeof(TResult)),
#endif
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("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => QbservableEx.Let(default(IQbservable), default(Expression, IObservable>>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)),
#endif
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("source");
if (selector == null)
throw new ArgumentNullException("selector");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => QbservableEx.ManySelect(default(IQbservable), default(Expression, TResult>>))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)),
#endif
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("source");
if (selector == null)
throw new ArgumentNullException("selector");
if (scheduler == null)
throw new ArgumentNullException("scheduler");
return source.Provider.CreateQuery(
Expression.Call(
null,
#if CRIPPLED_REFLECTION
InfoOf(() => QbservableEx.ManySelect(default(IQbservable), default(Expression, TResult>>), default(IScheduler))),
#else
((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)),
#endif
source.Expression,
selector,
Expression.Constant(scheduler, typeof(IScheduler))
)
);
}
#endif
}
}
#endif
#pragma warning restore 1591