Re: Our (real) problems



On Fri, 2001-08-31 at 14:16, Mark McLoughlin wrote:
> Hi Rodrigo,
> 
> On 31 Aug 2001, Rodrigo Moya wrote:
> 
> > On Fri, 2001-08-31 at 13:35, Christian Schaller wrote:
> >
> > also, now that you mention it, ORBit2 does not support case statements
> > in unions on the IDL, although this is completely valid in CORBA.
> 
> 	Ahah - well it should ;) In fact our regression tests have
> quite a few unions..
> 
oh, my god, if so, you'll make me very happy, since yesterday I tried to
find where the bug was, and I was a bit overwhelmed by the code, since I
don't know too much about ORBit's code :-)

> 	Could you send the IDL that's causing the problem - now's a
> good time because I've had my head buried in the IDL compiler all
> morning - specifically dealing with unions ;)
>
Here it is. With latest ORBit2, it still hangs. Removing all the union
stuff made orbit-idl work perfectly on this IDL. And this IDL has been
working with ORBit1 for ages. So, that's why I assumed unions are not
supported in ORBit2.

cheers
 
-- 
Rodrigo Moya <rodrigo gnome-db org> - <rodrigo ximian com>
http://www.gnome-db.org/ - http://www.ximian.com/
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

#ifndef __gda_field__
#define __gda_field__ 1

module GDA {
	enum ValueType {
		TypeNull,    TypeBigint, TypeBinary,
		TypeBoolean, TypeBstr,   TypeChar,
		TypeCurrency,TypeDate,   TypeDbDate,
		TypeDbTime,  TypeDbTimestamp, TypeDecimal,
		TypeDouble,  TypeError,  TypeInteger,
		TypeLongvarbin, TypeLongvarchar, TypeLongvarwchar,
		TypeNumeric, TypeSingle, TypeSmallint,
		TypeTinyint, TypeUBigint, TypeUSmallint,
		TypeVarchar, TypeVarbin,  TypeVarwchar,
		TypeFixchar, TypeFixbin,  TypeFixwchar,
		TypeUnknown, TypeLastValue
	};

	typedef long Date;
	struct  DbDate{
		short year;
		unsigned short month;
		unsigned short day;
	};
	struct DbTime {
		unsigned short hour;
		unsigned short minute;
		unsigned short second;
	};
	struct DbTimestamp {
		short year;
		unsigned short month;
		unsigned short day;
		unsigned short hour;
		unsigned short minute;
		unsigned short second;
		unsigned long  fraction;
	};

	typedef sequence<octet> VarBinString; 
	
	union Value switch (ValueType) {
		case TypeTinyint:
			char c;
		case TypeBigint:
			long long ll;
		case TypeBoolean:
			boolean b;
		case TypeDate:
			Date d;
		case TypeDbDate:
			DbDate dbd;
		case TypeDbTime:
			DbTime dbt;
		case TypeDbTimestamp:
			DbTimestamp dbtstamp;
		case TypeDouble:
			double dp;    
		/* case TypeError: NYI */
		case TypeInteger:
			long i;
		case TypeBinary:
		case TypeVarbin:
		case TypeVarwchar:
		case TypeLongvarwchar:
		case TypeLongvarbin:
		case TypeUnknown:
			VarBinString lvb;
		case TypeFixbin:
		case TypeFixwchar:
		case TypeFixchar:
			VarBinString fb;
		case TypeCurrency:
		case TypeDecimal:
		case TypeNumeric:
		case TypeChar:
		case TypeVarchar:
		case TypeLongvarchar:
			string  lvc;
		case TypeSingle:
			float  f;
		case TypeSmallint:
			short  si;
		case TypeUBigint:
			unsigned long long ull;
		case TypeUSmallint:
			unsigned short us;
	};
	union FieldValue switch (boolean) {
		case FALSE:
			Value v;
	};
	struct Field {
		long       actualSize;
		FieldValue originalValue;
		FieldValue shadowValue;
		FieldValue realValue;
	};
	struct FieldAttributes {
		long       definedSize;
		string     name;
		long       scale;
		ValueType  gdaType;
		long       cType;
		long       nativeType;
	};
	typedef sequence<Field>           Row;
	typedef sequence<FieldAttributes> RowAttributes;

/*
	interface Fieldx {
		long             appendChunk(in VarBinString data);
		VarBinString     getChunk   (in long amount);
	};
*/

};

#endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]