/** $Id: README,v 1.2 1998/10/09 17:31:33 spreitze Exp $
 BeginILUCopyright

 Copyright (c) 1991-1998 Xerox Corporation.  All Rights Reserved.

 Unlimited use, reproduction, modification, and distribution of this
 software and modified versions thereof is permitted.  Permission is
 granted to make derivative works from this software or a modified
 version thereof.  Any copy of this software, a modified version
 thereof, or a derivative work must include both the above copyright
 notice of Xerox Corporation and this paragraph.  Any distribution of
 this software, a modified version thereof, or a derivative work must
 comply with all applicable United States export control laws.  This
 software is made available AS IS, and XEROX CORPORATION DISCLAIMS ALL
 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE, AND NOTWITHSTANDING ANY OTHER PROVISION CONTAINED HEREIN, ANY
 LIABILITY FOR DAMAGES RESULTING FROM THE SOFTWARE OR ITS USE IS
 EXPRESSLY DISCLAIMED, WHETHER ARISING IN CONTRACT, TORT (INCLUDING
 NEGLIGENCE) OR STRICT LIABILITY, EVEN IF XEROX CORPORATION IS ADVISED
 OF THE POSSIBILITY OF SUCH DAMAGES.

 EndILUCopyright
*/
/* Last edited by Mike Spreitzer October 9, 1998 10:29 am PDT */
This example is modeled after the Orbix grid example with
the following OMG IDL, and will only work if you configured
ILU with support for OMG IDL (--enable-omg-idl-support),
support for Python, and support for the OMG IIOP protocol
(--enable-corba-iiop):

// grid.idl

#pragma ID grid "IDL:grid:1.0"

// IDL defintion of a 2-D grid (in row major order):

interface grid {
	readonly attribute short height;  // height of the grid
	readonly attribute short width;   // width of the grid

	// set the element [n,m] of the grid, to value:
	void set(in short n, in short m, in long value);

	// return element [n,m] of the grid:
	long get(in short n, in short m);
};

Or, in ISL:

INTERFACE grid;

TYPE grid = OBJECT OPTIONAL TYPEID "IDL:grid:1.0"
  METHODS
    ilu--prefix-idlAttribute--get-height () : SHORT INTEGER,
    ilu--prefix-idlAttribute--get-width () : SHORT INTEGER,
    set (n : SHORT INTEGER, m : SHORT INTEGER, value : INTEGER),
    get (n : SHORT INTEGER, m : SHORT INTEGER) : INTEGER
  END;

To use, first stub the OMG IDL file with the Python stubber:

    % python-stubber grid.idl
    client stubs for interface "grid" to grid.py ...
    server stubs for interface "grid" to grid__skel.py ...
    % 

Then run the server:

    % python gridServer.py &
    [2] 15873
    % IOR:000000000000001C49444...6E6B2F00
    %

To try it, run the client:

    % python gridClient.py IOR:000000000000001C49444...6E6B2F00
    width = 10, height = 10
    set of (1,1) succeeded
    %
