Skip to content

Commit

Permalink
Added missing members to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mgnsm committed Mar 6, 2024
1 parent 50cd942 commit 5ee24f5
Showing 1 changed file with 111 additions and 0 deletions.
111 changes: 111 additions & 0 deletions Source/Millistream.Streaming/IMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ public interface IMessage
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddNumeric(uint tag, string value) overload instead.")]
bool AddNumeric(Field tag, string value);

/// <summary>
/// Adds a numeric field to the current active message.
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The numeric field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false"/> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
bool AddNumeric(uint tag, ReadOnlySpan<byte> value);
/// <summary>
/// Adds a numeric field to the current active message.
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The numeric field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false"/> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddNumeric(uint tag, ReadOnlySpan<byte> value) overload instead.")]
bool AddNumeric(Field tag, ReadOnlySpan<byte> value);

/// <summary>
/// Adds a scaled and signed 64-bit integer field to the current active message. <paramref name="decimals"/> can be between 0 and 19. A value of 12345 with <paramref name="decimals"/> set to 2 will be encoded as "123.45".
/// </summary>
Expand Down Expand Up @@ -146,6 +162,42 @@ public interface IMessage
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddString(uint tag, string value, int length) overload instead.")]
bool AddString(Field tag, string value, int length);

/// <summary>
/// Adds a UTF-8 encoded string field to the current active message. The string is compressed with zlib using the compression level as set by <see cref="CompressionLevel" /> which is <see cref="CompressionLevel.Z_BEST_SPEED"/> by default.
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false" /> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
bool AddString(uint tag, ReadOnlySpan<byte> value);

/// <summary>
/// Adds a UTF-8 encoded string field to the current active message. The string is compressed with zlib using the compression level as set by <see cref="CompressionLevel" /> which is <see cref="CompressionLevel.Z_BEST_SPEED"/> by default.
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <param name="length">The number of bytes in <paramref name="value"/> to be added to the message.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false" /> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
bool AddString(uint tag, ReadOnlySpan<byte> value, int length);

/// <summary>
/// Adds a UTF-8 encoded string field to the current active message. The string is compressed with zlib using the compression level as set by <see cref="CompressionLevel" /> which is <see cref="CompressionLevel.Z_BEST_SPEED"/> by default.
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false" /> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddString(uint tag, ReadOnlySpan<byte> value) overload instead.")]
bool AddString(Field tag, ReadOnlySpan<byte> value);

/// <summary>
/// Adds a UTF-8 encoded string field to the current active message. The string is compressed with zlib using the compression level as set by <see cref="CompressionLevel" /> which is <see cref="CompressionLevel.Z_BEST_SPEED"/> by default.
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <param name="length">The number of bytes in <paramref name="value"/> to be added to the message.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false" /> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddString(uint tag, ReadOnlySpan<byte> value, int length) overload instead.")]
bool AddString(Field tag, ReadOnlySpan<byte> value, int length);

/// <summary>
/// Adds a date field to the current active message. Please note that all dates and times are expressed in UTC. The format of value must be one of "YYYY-MM-DD", "YYYY-MM", "YYYY-H1", "YYYY-H2", "YYYY-T1", "YYYY-T2", "YYYY-T3", "YYYY-Q1", "YYYY-Q2", "YYYY-Q3", "YYYYQ4" or "YYYY-W[1-52]".
/// </summary>
Expand Down Expand Up @@ -184,6 +236,23 @@ public interface IMessage
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddDate(uint tag, int year, int month, int day) overload instead.")]
bool AddDate(Field tag, int year, int month, int day);

/// <summary>
/// Adds a date field to the current active message. Please note that all dates and times are expressed in UTC. The format of value must be one of "YYYY-MM-DD", "YYYY-MM", "YYYY-H1", "YYYY-H2", "YYYY-T1", "YYYY-T2", "YYYY-T3", "YYYY-Q1", "YYYY-Q2", "YYYY-Q3", "YYYYQ4" or "YYYY-W[1-52]".
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The date field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false" /> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
bool AddDate(uint tag, ReadOnlySpan<byte> value);

/// <summary>
/// Adds a date field to the current active message. Please note that all dates and times are expressed in UTC. The format of value must be one of "YYYY-MM-DD", "YYYY-MM", "YYYY-H1", "YYYY-H2", "YYYY-T1", "YYYY-T2", "YYYY-T3", "YYYY-Q1", "YYYY-Q2", "YYYY-Q3", "YYYYQ4" or "YYYY-W[1-52]".
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The date field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false" /> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddDate(uint tag, ReadOnlySpan<byte> value) overload instead.")]
bool AddDate(Field tag, ReadOnlySpan<byte> value);

/// <summary>
/// Adds a time field to the current active message. Please note that all times and dates are expressed in UTC. The format of value must be "HH:MM:SS" or "HH:MM:SS.mmm" (where mmm is the milliseconds). libmdf 1.0.24 accepts up to nanoseconds resolution, i.e. "HH:MM:SS.nnnnnnnnn".
/// </summary>
Expand Down Expand Up @@ -247,6 +316,23 @@ public interface IMessage
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddTime3(uint tag, int hour, int minute, int second, int nanosecond) overload instead.")]
bool AddTime3(Field tag, int hour, int minute, int second, int nanosecond);

/// <summary>
/// Adds a time field to the current active message. Please note that all times and dates are expressed in UTC. The format of value must be "HH:MM:SS" or "HH:MM:SS.mmm" (where mmm is the milliseconds). libmdf 1.0.24 accepts up to nanoseconds resolution, i.e. "HH:MM:SS.nnnnnnnnn".
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The time field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false" /> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
bool AddTime(uint tag, ReadOnlySpan<byte> value);

/// <summary>
/// Adds a time field to the current active message. Please note that all times and dates are expressed in UTC. The format of value must be "HH:MM:SS" or "HH:MM:SS.mmm" (where mmm is the milliseconds). libmdf 1.0.24 accepts up to nanoseconds resolution, i.e. "HH:MM:SS.nnnnnnnnn".
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The time field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false" /> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddTime(uint tag, ReadOnlySpan<byte> value) overload instead.")]
bool AddTime(Field tag, ReadOnlySpan<byte> value);

/// <summary>
/// Adds a list field to the current active message. A list field is a space separated list of instrument references. The first position in the value can be:
/// <para>'+' (the supplied list should be added to the current value)<br/>
Expand All @@ -272,6 +358,31 @@ public interface IMessage
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddList(uint tag, string value) overload instead.")]
bool AddList(Field tag, string value);

/// <summary>
/// Adds a list field to the current active message. A list field is a space separated list of instrument references. The first position in the value can be:
/// <para>'+' (the supplied list should be added to the current value)<br/>
/// '-' (the supplied list should be removed from the current value)<br/>
/// '=' (the supplied list is the current value)</para>
/// If there is no such prefix it is interpreted as if it was prefixed with a '='. There is a current soft limit of 1.000.000 instrument references per list.
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The list field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false" /> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
bool AddList(uint tag, ReadOnlySpan<byte> value);

/// <summary>
/// Adds a list field to the current active message. A list field is a space separated list of instrument references. The first position in the value can be:
/// <para>'+' (the supplied list should be added to the current value)<br/>
/// '-' (the supplied list should be removed from the current value)<br/>
/// '=' (the supplied list is the current value)</para>
/// If there is no such prefix it is interpreted as if it was prefixed with a '='. There is a current soft limit of 1.000.000 instrument references per list.
/// </summary>
/// <param name="tag">The field tag.</param>
/// <param name="value">The list field value as a memory span that contains a null-terminated sequence of UTF-8 encoded bytes.</param>
/// <returns><see langword="true" /> if the field was successfully added, or <see langword="false" /> if the value could not be added (because there was no more memory, the message handle does not contain any messages, or the supplied value is not of the type specified).</returns>
[Obsolete("This overload is deprecated and will be removed in a future version. Use the AddList(uint tag, ReadOnlySpan<byte> value) overload instead.")]
bool AddList(Field tag, ReadOnlySpan<byte> value);

/// <summary>
/// Resets the message handle (sets the number of active messages to zero) so it can be reused. The memory allocated for the current messages in the handle is retained for performance reasons and will be reused when you add new messages to the handle.
/// </summary>
Expand Down

0 comments on commit 5ee24f5

Please sign in to comment.