diff --git a/csharp/Platform.Data/IDynamicLinks.cs b/csharp/Platform.Data/IDynamicLinks.cs new file mode 100644 index 0000000..4a54334 --- /dev/null +++ b/csharp/Platform.Data/IDynamicLinks.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using Platform.Delegates; + +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +namespace Platform.Data +{ + /// + /// Represents a dynamic polymorphic interface for manipulating data in the Links format. + /// Представляет динамический полиморфный интерфейс для манипуляции с данными в формате Links. + /// + /// + /// This interface enables runtime polymorphism through virtual method dispatch, allowing different implementations to be used interchangeably at runtime. + /// Этот интерфейс обеспечивает полиморфизм времени выполнения через виртуальную диспетчеризацию методов, позволяя использовать различные реализации взаимозаменяемо во время выполнения. + /// + public interface IDynamicLinks + { + /// + /// Counts and returns the total number of links in the storage that meet the specified restriction. + /// Подсчитывает и возвращает общее число связей находящихся в хранилище, соответствующих указанному ограничению. + /// + /// Restriction on the contents of links.Ограничение на содержимое связей. + /// The total number of links in the storage that meet the specified restriction.Общее число связей находящихся в хранилище, соответствующих указанному ограничению. + object Count(IList? restriction); + + /// + /// Passes through all the links matching the pattern, invoking a handler for each matching link. + /// Выполняет проход по всем связям, соответствующим шаблону, вызывая обработчик для каждой подходящей связи. + /// + /// + /// Restriction on the contents of links. Each constraint can have values: null - reference to void, any object - absence of constraint, specific values - concrete link indices. + /// Ограничение на содержимое связей. Каждое ограничение может иметь значения: null - ссылка на пустоту, любой объект - отсутствие ограничения, конкретные значения - индексы связей. + /// + /// A handler for each matching link.Обработчик для каждой подходящей связи. + /// Continue constant if the pass through the links was not interrupted, and Break constant otherwise.Константа Continue, в случае если проход по связям не был прерван и константа Break в обратном случае. + object Each(IList? restriction, Delegate? handler); + + /// + /// Creates a link. + /// Создаёт связь. + /// + /// The content of a new link. This argument is optional, if null is passed as value that means no content of a link is set. + /// Содержимое новой связи. Этот аргумент опционален, если null передан в качестве значения это означает, что никакого содержимого для связи не установлено. + /// + /// + /// A function to handle each executed change. This function can return continue constant to continue processing each change. Break constant can be used to stop receiving executed changes. + /// Функция для обработки каждого выполненного изменения. Эта функция может вернуть константу continue чтобы продолжить обрабатывать каждое изменение. Константа Break может быть использована для остановки получения выполненных изменений. + /// + /// + /// + /// Continue constant if all executed changes are handled. Break constant if processing of handled changes is stopped. + /// Константа Continue если все выполненные изменения обработаны. Константа Break если обработка выполненных изменений остановлена. + /// + object Create(IList? substitution, Delegate? handler); + + /// + /// Updates a link with the specified restriction to a link with the specified new content. + /// Обновляет связь с указанным ограничением на связь с указанным новым содержимым. + /// + /// + /// Restriction on the contents of links. It is assumed that the link index will be specified and then its content will follow. + /// Ограничение на содержимое связей. Предполагается, что будет указан индекс связи и далее за ним будет следовать содержимое связи. + /// + /// New content for the link.Новое содержимое для связи. + /// + /// A function to handle each executed change. This function can return continue constant to continue processing each change. Break constant can be used to stop receiving executed changes. + /// Функция для обработки каждого выполненного изменения. Эта функция может вернуть константу continue чтобы продолжить обрабатывать каждое изменение. Константа Break может быть использована для остановки получения выполненных изменений. + /// + /// + /// Continue constant if all executed changes are handled. Break constant if processing of handled changes is stopped. + /// Константа Continue если все выполненные изменения обработаны. Константа Break если обработка выполненных изменений остановлена. + /// + object Update(IList? restriction, IList? substitution, Delegate? handler); + + /// + /// Deletes links that match the specified restriction. + /// Удаляет связи соответствующие указанному ограничению. + /// + /// + /// Restriction on the content of a link. This argument is optional, if null is passed as value that means no restriction on the content of a link is set. + /// Ограничение на содержимое связи. Этот аргумент опционален, если null передан в качестве значения это означает, что никаких ограничений на содержимое связи не установлено. + /// + /// + /// A function to handle each executed change. This function can return continue constant to continue processing each change. Break constant can be used to stop receiving executed changes. + /// Функция для обработки каждого выполненного изменения. Эта функция может вернуть константу continue чтобы продолжить обрабатывать каждое изменение. Константа Break может быть использована для остановки получения выполненных изменений. + /// + /// + /// Continue constant if all executed changes are handled. Break constant if processing of handled changes is stopped. + /// Константа Continue если все выполненные изменения обработаны. Константа Break если обработка выполненных изменений остановлена. + /// + object Delete(IList? restriction, Delegate? handler); + } +} \ No newline at end of file diff --git a/csharp/Platform.Data/ILinks.cs b/csharp/Platform.Data/ILinks.cs index 7438b68..2ddc49d 100644 --- a/csharp/Platform.Data/ILinks.cs +++ b/csharp/Platform.Data/ILinks.cs @@ -16,7 +16,7 @@ namespace Platform.Data /// This interface is independent of the size of the content of the link, meaning it is suitable for both doublets, triplets, and link sequences of any size. /// Этот интерфейс не зависит от размера содержимого связи, а значит подходит как для дуплетов, триплетов и последовательностей связей любого размера. /// - public interface ILinks + public interface ILinks : IDynamicLinks where TLinkAddress : IUnsignedNumber where TConstants : LinksConstants { diff --git a/csharp/Platform.Data/LinksBase.cs b/csharp/Platform.Data/LinksBase.cs new file mode 100644 index 0000000..8ed58ce --- /dev/null +++ b/csharp/Platform.Data/LinksBase.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; + +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +namespace Platform.Data +{ + /// + /// Provides a base class for implementing dynamic polymorphic links storage. + /// Предоставляет базовый класс для реализации динамического полиморфного хранилища связей. + /// + /// + /// This abstract class enables runtime polymorphism by providing virtual methods that can be overridden by derived classes. + /// Этот абстрактный класс обеспечивает полиморфизм времени выполнения, предоставляя виртуальные методы, которые могут быть переопределены в производных классах. + /// + public abstract class LinksBase : IDynamicLinks + { + /// + /// Counts and returns the total number of links in the storage that meet the specified restriction. + /// Подсчитывает и возвращает общее число связей находящихся в хранилище, соответствующих указанному ограничению. + /// + /// Restriction on the contents of links.Ограничение на содержимое связей. + /// The total number of links in the storage that meet the specified restriction.Общее число связей находящихся в хранилище, соответствующих указанному ограничению. + public abstract object Count(IList? restriction); + + /// + /// Passes through all the links matching the pattern, invoking a handler for each matching link. + /// Выполняет проход по всем связям, соответствующим шаблону, вызывая обработчик для каждой подходящей связи. + /// + /// + /// Restriction on the contents of links. Each constraint can have values: null - reference to void, any object - absence of constraint, specific values - concrete link indices. + /// Ограничение на содержимое связей. Каждое ограничение может иметь значения: null - ссылка на пустоту, любой объект - отсутствие ограничения, конкретные значения - индексы связей. + /// + /// A handler for each matching link.Обработчик для каждой подходящей связи. + /// Continue constant if the pass through the links was not interrupted, and Break constant otherwise.Константа Continue, в случае если проход по связям не был прерван и константа Break в обратном случае. + public abstract object Each(IList? restriction, Delegate? handler); + + /// + /// Creates a link. + /// Создаёт связь. + /// + /// The content of a new link. This argument is optional, if null is passed as value that means no content of a link is set. + /// Содержимое новой связи. Этот аргумент опционален, если null передан в качестве значения это означает, что никакого содержимого для связи не установлено. + /// + /// + /// A function to handle each executed change. This function can return continue constant to continue processing each change. Break constant can be used to stop receiving executed changes. + /// Функция для обработки каждого выполненного изменения. Эта функция может вернуть константу continue чтобы продолжить обрабатывать каждое изменение. Константа Break может быть использована для остановки получения выполненных изменений. + /// + /// + /// + /// Continue constant if all executed changes are handled. Break constant if processing of handled changes is stopped. + /// Константа Continue если все выполненные изменения обработаны. Константа Break если обработка выполненных изменений остановлена. + /// + public abstract object Create(IList? substitution, Delegate? handler); + + /// + /// Updates a link with the specified restriction to a link with the specified new content. + /// Обновляет связь с указанным ограничением на связь с указанным новым содержимым. + /// + /// + /// Restriction on the contents of links. It is assumed that the link index will be specified and then its content will follow. + /// Ограничение на содержимое связей. Предполагается, что будет указан индекс связи и далее за ним будет следовать содержимое связи. + /// + /// New content for the link.Новое содержимое для связи. + /// + /// A function to handle each executed change. This function can return continue constant to continue processing each change. Break constant can be used to stop receiving executed changes. + /// Функция для обработки каждого выполненного изменения. Эта функция может вернуть константу continue чтобы продолжить обрабатывать каждое изменение. Константа Break может быть использована для остановки получения выполненных изменений. + /// + /// + /// Continue constant if all executed changes are handled. Break constant if processing of handled changes is stopped. + /// Константа Continue если все выполненные изменения обработаны. Константа Break если обработка выполненных изменений остановлена. + /// + public abstract object Update(IList? restriction, IList? substitution, Delegate? handler); + + /// + /// Deletes links that match the specified restriction. + /// Удаляет связи соответствующие указанному ограничению. + /// + /// + /// Restriction on the content of a link. This argument is optional, if null is passed as value that means no restriction on the content of a link is set. + /// Ограничение на содержимое связи. Этот аргумент опционален, если null передан в качестве значения это означает, что никаких ограничений на содержимое связи не установлено. + /// + /// + /// A function to handle each executed change. This function can return continue constant to continue processing each change. Break constant can be used to stop receiving executed changes. + /// Функция для обработки каждого выполненного изменения. Эта функция может вернуть константу continue чтобы продолжить обрабатывать каждое изменение. Константа Break может быть использована для остановки получения выполненных изменений. + /// + /// + /// Continue constant if all executed changes are handled. Break constant if processing of handled changes is stopped. + /// Константа Continue если все выполненные изменения обработаны. Константа Break если обработка выполненных изменений остановлена. + /// + public abstract object Delete(IList? restriction, Delegate? handler); + } +} \ No newline at end of file