-
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #4 from Arlodotexe/rel/0.8.0
Release 0.8.0. New interfaces, added WritableLazySeekStream.
- Loading branch information
Showing
12 changed files
with
252 additions
and
109 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
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
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,16 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace OwlCore.ComponentModel; | ||
|
||
/// <summary> | ||
/// Represents a resource that can be flushed from memory to an underlying source. | ||
/// </summary> | ||
public interface IFlushable | ||
{ | ||
/// <summary> | ||
/// Flushes the resource to the underlying device. | ||
/// </summary> | ||
/// <param name="cancellationToken">A token that can be used to cancel the ongoing operation.</param> | ||
Task FlushAsync(CancellationToken cancellationToken); | ||
} |
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,12 @@ | ||
namespace OwlCore.ComponentModel; | ||
|
||
/// <summary> | ||
/// Represents an object with a unique instance Id. This Id should be identical across runs and environments. | ||
/// </summary> | ||
public interface IHasId | ||
{ | ||
/// <summary> | ||
/// An Id corresponding to this object instance. This Id should be unique for the object, but identical across runs and environments. | ||
/// </summary> | ||
string Id { get; init; } | ||
} |
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,15 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace OwlCore.ComponentModel; | ||
|
||
/// <summary> | ||
/// Indicates an object that has a list of sources that cannot be modified. | ||
/// </summary> | ||
/// <typeparam name="T">The inner collection type.</typeparam> | ||
public interface IReadOnlySources<T> | ||
{ | ||
/// <summary> | ||
/// The sources for this event stream. Each contains timestamped event data from all participating nodes. | ||
/// </summary> | ||
IReadOnlyCollection<T> Sources { get; init; } | ||
} |
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,65 +1,64 @@ | ||
using System; | ||
|
||
namespace OwlCore.ComponentModel | ||
namespace OwlCore.ComponentModel; | ||
|
||
/// <summary> | ||
/// An interface that allows serializing data to and from <typeparamref name="TSerialized"/> synchronously. | ||
/// </summary> | ||
/// <typeparam name="TSerialized">The type that data is serialized to.</typeparam> | ||
public interface ISerializer<TSerialized> | ||
{ | ||
/// <summary> | ||
/// An interface that allows serializing data to and from <typeparamref name="TSerialized"/> synchronously. | ||
/// Serializes the provided <paramref name="data"/> into <typeparamref name="TSerialized"/>. | ||
/// </summary> | ||
/// <typeparam name="TSerialized">The type that data is serialized to.</typeparam> | ||
public interface ISerializer<TSerialized> | ||
{ | ||
/// <summary> | ||
/// Serializes the provided <paramref name="data"/> into <typeparamref name="TSerialized"/>. | ||
/// </summary> | ||
/// <param name="data">The object instance to serialize.</param> | ||
/// <typeparam name="T">The type of the object being serialized.</typeparam> | ||
/// <returns>A serialized instance of <paramref name="data"/>.</returns> | ||
public TSerialized Serialize<T>(T data); | ||
/// <param name="data">The object instance to serialize.</param> | ||
/// <typeparam name="T">The type of the object being serialized.</typeparam> | ||
/// <returns>A serialized instance of <paramref name="data"/>.</returns> | ||
TSerialized Serialize<T>(T data); | ||
|
||
/// <summary> | ||
/// Serializes the provided <paramref name="data"/> into <typeparamref name="TSerialized"/>. | ||
/// </summary> | ||
/// <param name="data">The object instance to serialize.</param> | ||
/// <param name="type">The type of the object being serialized.</param> | ||
/// <returns>A serialized instance of <paramref name="data"/>.</returns> | ||
public TSerialized Serialize(Type type, object data); | ||
/// <summary> | ||
/// Serializes the provided <paramref name="data"/> into <typeparamref name="TSerialized"/>. | ||
/// </summary> | ||
/// <param name="data">The object instance to serialize.</param> | ||
/// <param name="type">The type of the object being serialized.</param> | ||
/// <returns>A serialized instance of <paramref name="data"/>.</returns> | ||
TSerialized Serialize(Type type, object data); | ||
|
||
/// <summary> | ||
/// Deserializes the provided <paramref name="serialized"/> data into the given type. | ||
/// </summary> | ||
/// <param name="serialized">A serialized instance to deserialize.</param> | ||
/// <typeparam name="TResult">The type to deserialize to.</typeparam> | ||
/// <returns>A deserialized instance of the provided serialized data.</returns> | ||
public TResult Deserialize<TResult>(TSerialized serialized); | ||
/// <summary> | ||
/// Deserializes the provided <paramref name="serialized"/> data into the given type. | ||
/// </summary> | ||
/// <param name="serialized">A serialized instance to deserialize.</param> | ||
/// <typeparam name="TResult">The type to deserialize to.</typeparam> | ||
/// <returns>A deserialized instance of the provided serialized data.</returns> | ||
TResult Deserialize<TResult>(TSerialized serialized); | ||
|
||
/// <summary> | ||
/// Deserializes the provided <paramref name="serialized"/> data into the given type. | ||
/// </summary> | ||
/// <param name="serialized">A serialized instance to deserialize.</param> | ||
/// <param name="type">The type of the object being serialized.</param> | ||
/// <returns>A deserialized instance of the provided serialized data.</returns> | ||
public object Deserialize(Type type, TSerialized serialized); | ||
} | ||
/// <summary> | ||
/// Deserializes the provided <paramref name="serialized"/> data into the given type. | ||
/// </summary> | ||
/// <param name="serialized">A serialized instance to deserialize.</param> | ||
/// <param name="type">The type of the object being serialized.</param> | ||
/// <returns>A deserialized instance of the provided serialized data.</returns> | ||
object Deserialize(Type type, TSerialized serialized); | ||
} | ||
|
||
/// <summary> | ||
/// An interface that allows serializing data to <typeparamref name="TDeserialized"/> and from <typeparamref name="TSerialized"/> synchronously. | ||
/// </summary> | ||
/// <typeparam name="TSerialized">The type that data is serialized to.</typeparam> | ||
/// <typeparam name="TDeserialized">The type that data is deserialized to.</typeparam> | ||
public interface ISerializer<TSerialized, TDeserialized> | ||
{ | ||
/// <summary> | ||
/// An interface that allows serializing data to <typeparamref name="TDeserialized"/> and from <typeparamref name="TSerialized"/> synchronously. | ||
/// Serializes the provided <paramref name="data"/> into <typeparamref name="TSerialized"/>. | ||
/// </summary> | ||
/// <typeparam name="TSerialized">The type that data is serialized to.</typeparam> | ||
/// <typeparam name="TDeserialized">The type that data is deserialized to.</typeparam> | ||
public interface ISerializer<TSerialized, TDeserialized> | ||
{ | ||
/// <summary> | ||
/// Serializes the provided <paramref name="data"/> into <typeparamref name="TSerialized"/>. | ||
/// </summary> | ||
/// <param name="data">The object instance to serialize.</param> | ||
/// <returns>A serialized instance of <paramref name="data"/>.</returns> | ||
public TSerialized Serialize(TDeserialized data); | ||
/// <param name="data">The object instance to serialize.</param> | ||
/// <returns>A serialized instance of <paramref name="data"/>.</returns> | ||
TSerialized Serialize(TDeserialized data); | ||
|
||
/// <summary> | ||
/// Deserializes the provided <paramref name="serialized"/> data into the given type. | ||
/// </summary> | ||
/// <param name="serialized">A serialized instance to deserialize.</param> | ||
/// <returns>A deserialized instance of the provided serialized data.</returns> | ||
public TDeserialized Deserialize(TSerialized serialized); | ||
} | ||
/// <summary> | ||
/// Deserializes the provided <paramref name="serialized"/> data into the given type. | ||
/// </summary> | ||
/// <param name="serialized">A serialized instance to deserialize.</param> | ||
/// <returns>A deserialized instance of the provided serialized data.</returns> | ||
TDeserialized Deserialize(TSerialized serialized); | ||
} |
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,15 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace OwlCore.ComponentModel; | ||
|
||
/// <summary> | ||
/// Indicates an object that has a reference to a list of sources that can be changed. | ||
/// </summary> | ||
/// <typeparam name="T">The inner collection type.</typeparam> | ||
public interface ISources<T> | ||
{ | ||
/// <summary> | ||
/// The sources for this event stream. Each contains timestamped event data from all participating nodes. | ||
/// </summary> | ||
ICollection<T> Sources { get; init; } | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.