//---------------------------------------------------------------------------
// Copyright (C) DSTC Pty Ltd (ACN 052 372 577) 1997, 1998, 1999
// All Rights Reserved.
//
// The software contained on this media is the property of the DSTC Pty
// Ltd.  Use of this software is strictly in accordance with the
// license agreement in the accompanying LICENSE.HTML file.  If your
// distribution of this software does not contain a LICENSE.HTML file
// then you have no rights to use this software in any manner and
// should contact DSTC at the address below to determine an appropriate
// licensing arrangement.
// 
//      DSTC Pty Ltd
//      Level 7, GP SOuth
//      Staff House Road
//      University of Queensland
//      St Lucia, 4072
//      Australia
//      Tel: +61 7 3365 4310
//      Fax: +61 7 3365 4311
//      Email: enquiries@dstc.edu.au
// 
// This software is being provided "AS IS" without warranty of any
// kind.  In no event shall DSTC Pty Ltd be liable for damage of any
// kind arising out of or in connection with the use or performance of
// this software.
//
// Project:      Distributed Environment
// File:         $Source: /units/arch/src/Fnorb/examples/misc/RCS/Example.idl,v $
// Version:      @(#)$RCSfile: Example.idl,v $ $Revision: 1.3 $
//
//---------------------------------------------------------------------------

#pragma prefix "dstc.edu.au"

//
// This module attempts to cover most aspects of the mapping from IDL to
// Python.
//
module Example {

	interface ExampleIF {
		//
		// Ok, for starters, lets take a look at an IDL version of the
		// old faithful, 'hello world'!
		//
		// This operation takes no parameters and returns a string.
		//
		string hello_world();

		//
		// Well that was easy, now lets look at passing an 'in'
		// parameter.
		//
		// This operation takes a single long parameter and returns a
		// long.
		//
		long double_it(in long n);

		//
		// Now lets do the same with an 'inout' parameter.
		//
		void double_it_again(inout long n);

		//
		// And finally, with an 'in' and an 'out'!!
		//
		void double_it_one_last_time(in long n, out long result);

		//
		// Now lets take a look at some complex types.
		//
		// Structures.
		//
		struct Point {
			long x;
			long y;
		};
		Point move_by(in Point p, in long delta_x, in long delta_y);

		//
		// Unions.
		//
		union OneOfThese switch(short) {
		case 0:
			long l;

		case 1:
			float f;
	
		default:
			string s;
		};
		void take_that(in OneOfThese u);

		//
		// Arrays.
		typedef string StringArray[10];
		void ten_hello_worlds(inout StringArray x);		

		//
		// Sequences.
		//
		typedef sequence<string> StringSeq;
		StringSeq lots_of_hello_worlds(in long n);

		//
		// Enums
		//
		enum color {red, green, blue};
		color next_color(in color c);

		//
		// Lets try raising a user exception!!
		//
		exception DOH {
			string message;
		};
		void get_beer() raises(DOH);		

		//
		// And now a system exception.
		///
		void get_peanuts();

		//
		// Oops, nearly forgot, here are a couple of attributes.
		//
		attribute long width;
		readonly attribute string quality;

		//
		// And finally, a one-way operation that will close down the
		// server!
		oneway void quit();
	};			
};
