コード例 #1
0
ファイル: Collection.cs プロジェクト: omidm/naiad
        public static Collection <R, T> ToCollection <R, T>(this Stream <Weighted <R>, T> stream, bool immutable)
            where T : Time <T>
            where R : IEquatable <R>
        {
            var result = new DataflowCollection <R, T>(stream);

            result.immutable = immutable;
            return(result);
        }
コード例 #2
0
        /// <summary>
        /// Converts a stream of weighted records to a differential dataflow <see cref="Collection{TRecord,TTime}"/>.
        /// </summary>
        /// <typeparam name="TRecord">The type of the input records.</typeparam>
        /// <typeparam name="TTime">The type of timestamp on each record.</typeparam>
        /// <param name="stream">The input stream.</param>
        /// <param name="immutable"><code>true</code> if and only if the stream is immutable.</param>
        /// <returns>A <see cref="Collection{TRecord,TTime}"/> based on the given <paramref name="stream"/> of weighted records.</returns>
        public static Collection <TRecord, TTime> AsCollection <TRecord, TTime>(this Stream <Weighted <TRecord>, TTime> stream, bool immutable)
            where TRecord : IEquatable <TRecord>
            where TTime : Time <TTime>
        {
            var result = new DataflowCollection <TRecord, TTime>(stream);

            result.immutable = immutable;

            return(result);
        }