-
Notifications
You must be signed in to change notification settings - Fork 2
ITuple Interface
sequenze edited this page Jun 9, 2017
·
11 revisions
Represents a finite list of elements that can be used to represent a data item.
public interface ITuple : IFields
Name | Description |
---|---|
Size | Gets the cardinality of the ITuple. |
Item[Int32] | Gets or sets the field at the specified index. |
IFields.Fields | Gets or sets the array of fields contained within the tuple. |
ITuple is the base interface of all tuples.
The following example demonstrates the usage of ITuple when fetching data from a tuple space.
static void Main(string[] args)
{
Space ts = new Space();
ts.Put("Hello world!");
ITuple result = ts.Query(typeof(string));
ts.Put(result);
IEnumerable<ITuple> results = ts.QueryAll(typeof(string));
foreach (ITuple tuple in results)
{
Console.WriteLine("{0}", tuple[0]);
}
Console.Read();
}
/*
The following is printed to the console:
Hello world!
Hello world!
*/