-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1941 from glopesdev/issue-1518
Rename CombineTimestamp to CreateTimestamped
- Loading branch information
Showing
2 changed files
with
35 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,13 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Reactive; | ||
using System.Reactive.Linq; | ||
using System.Xml.Serialization; | ||
using System.ComponentModel; | ||
|
||
namespace Bonsai.Reactive | ||
{ | ||
/// <summary> | ||
/// Represents an operator that converts element-timestamp pairs of an observable | ||
/// sequence into proper timestamped elements. | ||
/// This type is obsolete. Please use the <see cref="CreateTimestamped"/> operator instead. | ||
/// </summary> | ||
[Combinator] | ||
[XmlType(Namespace = Constants.XmlNamespace)] | ||
[Description("Converts a pair of element and timestamp into a proper timestamped type.")] | ||
public class CombineTimestamp | ||
[Obsolete] | ||
[ProxyType(typeof(CreateTimestamped))] | ||
public class CombineTimestamp : CreateTimestamped | ||
{ | ||
/// <summary> | ||
/// Converts element-timestamp pairs of an observable sequence into proper | ||
/// timestamped elements. | ||
/// </summary> | ||
/// <typeparam name="TSource">The type of the value being timestamped.</typeparam> | ||
/// <param name="source">The sequence of element-timestamp pairs.</param> | ||
/// <returns>An observable sequence of timestamped values.</returns> | ||
public IObservable<Timestamped<TSource>> Process<TSource>(IObservable<Tuple<TSource, DateTimeOffset>> source) | ||
{ | ||
return source.Select(xs => new Timestamped<TSource>(xs.Item1, xs.Item2)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Reactive; | ||
using System.Reactive.Linq; | ||
using System.Xml.Serialization; | ||
using System.ComponentModel; | ||
|
||
namespace Bonsai.Reactive | ||
{ | ||
/// <summary> | ||
/// Represents an operator that converts element-timestamp pairs in an observable | ||
/// sequence into <see cref="Timestamped{T}"/> values. | ||
/// </summary> | ||
[Combinator] | ||
[XmlType(Namespace = Constants.XmlNamespace)] | ||
[Description("Converts a sequence of element-timestamp pairs into a sequence of timestamped values.")] | ||
public class CreateTimestamped | ||
{ | ||
/// <summary> | ||
/// Converts element-timestamp pairs in an observable sequence into | ||
/// <see cref="Timestamped{T}"/> values. | ||
/// </summary> | ||
/// <typeparam name="TSource">The type of the value being timestamped.</typeparam> | ||
/// <param name="source">The sequence of element-timestamp pairs.</param> | ||
/// <returns>An observable sequence of <see cref="Timestamped{T}"/> values.</returns> | ||
public IObservable<Timestamped<TSource>> Process<TSource>(IObservable<Tuple<TSource, DateTimeOffset>> source) | ||
{ | ||
return source.Select(xs => new Timestamped<TSource>(xs.Item1, xs.Item2)); | ||
} | ||
} | ||
} |