Skip to content

ITuple Interface

sequenze edited this page Jun 19, 2017 · 11 revisions

Provides the primitives required to define a tuple.

Inheritance Hierarchy

Object

Syntax

public abstract interface ITuple : IFields

Properties

Name               Description
Size Returns the size of the tuple.
Item[Int32] Gets or sets the i'th element of the tuple.

Remarks

ITuple is the base interface of all tuples.

Examples

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!
    */

See Also

IFields

Clone this wiki locally