From 2a593b7fc3ff6800b82384001d1eb1d434deedab Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 13 Sep 2025 02:46:05 +0300 Subject: [PATCH 1/3] Initial commit with task details for issue #81 Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: https://github.com/linksplatform/Data/issues/81 --- CLAUDE.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..71aae56 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +Issue to solve: https://github.com/linksplatform/Data/issues/81 +Your prepared branch: issue-81-351ddb50 +Your prepared working directory: /tmp/gh-issue-solver-1757720755857 + +Proceed. \ No newline at end of file From d0d21e1a7b2a1128aec04ad8bfdb674edf8c0ed1 Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 13 Sep 2025 02:55:05 +0300 Subject: [PATCH 2/3] Add dynamic polymorphism support to ILinks interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Created IDynamicLinks interface for runtime polymorphism • Modified ILinks to extend IDynamicLinks for backward compatibility • Added LinksBase abstract class as foundation for dynamic implementations • Maintains existing generic static polymorphism while enabling dynamic dispatch 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- csharp/Platform.Data/IDynamicLinks.cs | 94 +++++++++++++++++++++++++++ csharp/Platform.Data/ILinks.cs | 2 +- csharp/Platform.Data/LinksBase.cs | 93 ++++++++++++++++++++++++++ 3 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 csharp/Platform.Data/IDynamicLinks.cs create mode 100644 csharp/Platform.Data/LinksBase.cs 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 From e1ed63e20ebf4c935bba2cdd96a25cb21eceb88b Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 13 Sep 2025 02:55:54 +0300 Subject: [PATCH 3/3] Remove CLAUDE.md - Claude command completed --- CLAUDE.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 71aae56..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,5 +0,0 @@ -Issue to solve: https://github.com/linksplatform/Data/issues/81 -Your prepared branch: issue-81-351ddb50 -Your prepared working directory: /tmp/gh-issue-solver-1757720755857 - -Proceed. \ No newline at end of file