RE: [INTERFACES] IDL :)
| От | Taral |
|---|---|
| Тема | RE: [INTERFACES] IDL :) |
| Дата | |
| Msg-id | 000801be10f4$33ea2480$8a14f7d0@taral.dobiecenter.com обсуждение исходный текст |
| Ответ на | Re: [INTERFACES] IDL :) (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-interfaces |
> We need some way of not having to enumerate all the possible field
> datatypes in advance.
[ suggestions snipped ]
d) none of the above
CORBA provides the "any" type, and it turns out that those discriminated
unions are TERRIBLE memory hogs in C++. So see attached.
There are now two files because some ORBs require a special switch to enable
a type to be extracted from/represented by an "any".
So now our user-defined types will have to work via the dynamic
interfaces... someone explain to me how those types work!
Taral
--- cut here: pgsql.idl ---
module PostgreSQL {
// Discriminated unions removed due to inefficiency in C++
implementation
typedef any Cell;
typedef sequence<Cell> Column;
interface Row {
typedef sequence<Cell> type;
attribute type data; // throws BAD_OPERATION on set until BE
supports this
};
interface QueryResult {
typedef sequence<Column> type;
typedef sequence<string> headerType;
readonly attribute headerType header;
attribute type data; // throws BAD_OPERATION on set until
implemented
Row fetch(in long rownum); // returns nil or BAD_OPERATION until
implemented
// zero based numbering of rows
};
interface Database {
QueryResult exec(in string query);
oneway void disconnect();
};
interface Server {
Database connect(in string db, in string user, in string password);
};
};
--- cut here: pgsql_types.idl ---
// This file compiled for support of any for new types
module PostgreSQL {
enum celltype {
int2,
int4,
int8
// more types
};
typedef short int2type;
typedef long int4type;
struct int8type {
long lsw;
long msw;
};
};
В списке pgsql-interfaces по дате отправления: