-
Notifications
You must be signed in to change notification settings - Fork 2
ITuple Interface
sequenze edited this page Jun 19, 2017
·
11 revisions
Provides the primitives required to define a tuple.
Object
public abstract interface ITuple : IFields
Name | Description |
---|---|
Size | Returns the size of the tuple. |
Item[Int32] | Gets or sets the i'th element of 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)
{
FifoSpace ts = new FifoSpace();
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!
*/