-
-
Notifications
You must be signed in to change notification settings - Fork 13
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 #9 from koculu/8-feature-create-an-interface-to-ex…
…tract-meta-information-from-topazfunction Add ITopazFunction interface to expose function functionality and meta information.
- Loading branch information
Showing
5 changed files
with
139 additions
and
13 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
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,41 @@ | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Tenray.Topaz; | ||
|
||
public interface ITopazFunction | ||
{ | ||
/// <summary> | ||
/// Gets name of the function. | ||
/// </summary> | ||
string Name { get; } | ||
|
||
/// <summary> | ||
/// Gets the number of arguments of the function. | ||
/// </summary> | ||
int Length { get; } | ||
|
||
/// <summary> | ||
/// Gets the nth argument name of the function. | ||
/// </summary> | ||
/// <param name="index">The index of the argument.</param> | ||
/// <returns>Name of the argument.</returns> | ||
string this[int index] { get; } | ||
|
||
/// <summary> | ||
/// Invokes the function using arguments. | ||
/// </summary> | ||
/// <param name="token">CancellationToken.</param> | ||
/// <param name="args">Arguments.</param> | ||
/// <returns>The object returned from function implementation.</returns> | ||
object Invoke(CancellationToken token, params object[] args); | ||
|
||
/// <summary> | ||
/// Invokes the function asynchronously using arguments. | ||
/// </summary> | ||
/// <param name="args">Arguments.</param> | ||
/// <param name="token">CancellationToken.</param> | ||
/// <returns>The object returned from function implementation.</returns> | ||
ValueTask<object> InvokeAsync(CancellationToken token, params object[] args); | ||
} |
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