Convert files from DOS format to normal text.

This commit is contained in:
Thomas G. Lockhart 2000-12-03 14:43:59 +00:00
parent 48781d44e4
commit 20efb264f6
4 changed files with 258 additions and 258 deletions

View File

@ -1,89 +1,89 @@
/* RCS $Id: CosQuery.idl,v 1.1 1998/11/17 03:10:35 scrappy Exp $ /* RCS $Id: CosQuery.idl,v 1.2 2000/12/03 14:43:59 thomas Exp $
* *
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
* This is unmarked software provided by the Object Management Group,Inc. (OMG) * This is unmarked software provided by the Object Management Group,Inc. (OMG)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
/** /**
* CosQuery is the Common Object Services Specification query module * CosQuery is the Common Object Services Specification query module
* as it it appears in COSS1, v1.0. * as it it appears in COSS1, v1.0.
*/ */
#ifndef CosQuery_idl #ifndef CosQuery_idl
#define CosQuery_idl #define CosQuery_idl
#ifndef CosQueryCollection_idl #ifndef CosQueryCollection_idl
#include "CosQueryCollection.idl" #include "CosQueryCollection.idl"
#endif #endif
module CosQuery { module CosQuery {
exception QueryInvalid {string why;}; exception QueryInvalid {string why;};
exception QueryProcessingError {string why;}; exception QueryProcessingError {string why;};
exception QueryTypeInvalid {}; exception QueryTypeInvalid {};
enum QueryStatus {complete, incomplete}; enum QueryStatus {complete, incomplete};
typedef CosQueryCollection::ParameterList ParameterList; typedef CosQueryCollection::ParameterList ParameterList;
typedef CORBA::InterfaceDef QLType; typedef CORBA::InterfaceDef QLType;
typedef sequence<QLType> QLTypeSeq; typedef sequence<QLType> QLTypeSeq;
interface Query; interface Query;
interface QueryLanguageType {}; interface QueryLanguageType {};
interface SQLQuery : QueryLanguageType {}; interface SQLQuery : QueryLanguageType {};
interface SQL_92Query : SQLQuery {}; interface SQL_92Query : SQLQuery {};
interface OQL : QueryLanguageType {}; interface OQL : QueryLanguageType {};
interface OQLBasic : OQL {}; interface OQLBasic : OQL {};
interface OQL_93 : OQL {}; interface OQL_93 : OQL {};
interface OQL_93Basic : OQL_93, OQLBasic {}; interface OQL_93Basic : OQL_93, OQLBasic {};
interface QueryEvaluator { interface QueryEvaluator {
readonly attribute QLTypeSeq ql_types; readonly attribute QLTypeSeq ql_types;
readonly attribute QLType default_ql_type; readonly attribute QLType default_ql_type;
any evaluate (in string query, any evaluate (in string query,
in QLType ql_type, in QLType ql_type,
in ParameterList params) in ParameterList params)
raises(QueryTypeInvalid, raises(QueryTypeInvalid,
QueryInvalid, QueryInvalid,
QueryProcessingError); QueryProcessingError);
}; };
interface QueryableCollection : QueryEvaluator, interface QueryableCollection : QueryEvaluator,
CosQueryCollection::Collection { CosQueryCollection::Collection {
}; };
interface QueryManager : QueryEvaluator { interface QueryManager : QueryEvaluator {
Query create (in string query, Query create (in string query,
in QLType ql_type, in QLType ql_type,
in ParameterList params) in ParameterList params)
raises(QueryTypeInvalid, raises(QueryTypeInvalid,
QueryInvalid); QueryInvalid);
}; };
interface Query { interface Query {
readonly attribute QueryManager query_mgr; readonly attribute QueryManager query_mgr;
void prepare (in ParameterList params) void prepare (in ParameterList params)
raises(QueryProcessingError); raises(QueryProcessingError);
void execute (in ParameterList params) void execute (in ParameterList params)
raises(QueryProcessingError); raises(QueryProcessingError);
QueryStatus get_status (); QueryStatus get_status ();
any get_result (); any get_result ();
}; };
}; };
#endif // CosQuery_idl #endif // CosQuery_idl

View File

@ -1,83 +1,83 @@
/* RCS $Id: CosQueryCollection.idl,v 1.1 1998/11/16 18:03:34 scrappy Exp $ /* RCS $Id: CosQueryCollection.idl,v 1.2 2000/12/03 14:43:59 thomas Exp $
* *
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
* This is unmarked software provided by the Object Management Group,Inc. (OMG) * This is unmarked software provided by the Object Management Group,Inc. (OMG)
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
/** /**
* CosQueryCollection is the Common Object Services Specification query * CosQueryCollection is the Common Object Services Specification query
* query colleciton module as it it appears in COSS1, v1.0. * query colleciton module as it it appears in COSS1, v1.0.
*/ */
#ifndef CosQueryCollection_idl #ifndef CosQueryCollection_idl
#define CosQueryCollection_idl #define CosQueryCollection_idl
module CosQueryCollection { module CosQueryCollection {
exception ElementInvalid {}; exception ElementInvalid {};
exception IteratorInvalid {}; exception IteratorInvalid {};
exception PositionInvalid {}; exception PositionInvalid {};
typedef string Istring; typedef string Istring;
struct NVPair { struct NVPair {
Istring name; Istring name;
any value; any value;
}; };
typedef sequence<NVPair> ParameterList; typedef sequence<NVPair> ParameterList;
interface Collection; interface Collection;
interface Iterator; interface Iterator;
interface CollectionFactory { interface CollectionFactory {
Collection create (in ParameterList params); Collection create (in ParameterList params);
}; };
interface Collection { interface Collection {
readonly attribute long cardinality; readonly attribute long cardinality;
void add_element (in any element) void add_element (in any element)
raises(ElementInvalid); raises(ElementInvalid);
void add_all_elements (in Collection elements) void add_all_elements (in Collection elements)
raises(ElementInvalid); raises(ElementInvalid);
void insert_element_at (in any element, in Iterator where) void insert_element_at (in any element, in Iterator where)
raises(IteratorInvalid, raises(IteratorInvalid,
ElementInvalid); ElementInvalid);
void replace_element_at (in any element, in Iterator where) void replace_element_at (in any element, in Iterator where)
raises(IteratorInvalid, raises(IteratorInvalid,
PositionInvalid, PositionInvalid,
ElementInvalid); ElementInvalid);
void remove_element_at (in Iterator where) void remove_element_at (in Iterator where)
raises(IteratorInvalid, raises(IteratorInvalid,
PositionInvalid); PositionInvalid);
void remove_all_elements (); void remove_all_elements ();
any retrieve_element_at (in Iterator where) any retrieve_element_at (in Iterator where)
raises(IteratorInvalid, raises(IteratorInvalid,
PositionInvalid); PositionInvalid);
Iterator create_iterator (); Iterator create_iterator ();
}; };
interface Iterator { interface Iterator {
any next () any next ()
raises(IteratorInvalid, raises(IteratorInvalid,
PositionInvalid); PositionInvalid);
void reset (); void reset ();
boolean more (); boolean more ();
}; };
}; };
#endif // CosQueryCollection_idl #endif // CosQueryCollection_idl

View File

@ -12,82 +12,82 @@
#pragma prefix "" #pragma prefix ""
module PostgreSQL { module PostgreSQL {
// Built-in types // Built-in types
module Types { module Types {
// Arrays in network order // Arrays in network order
typedef short int2; typedef short int2;
typedef long int4; typedef long int4;
typedef long int8[2]; typedef long int8[2];
}; };
// NULL support // NULL support
typedef boolean Null; typedef boolean Null;
union Value switch (Null) { union Value switch (Null) {
case FALSE: any value; case FALSE: any value;
}; };
// Row definition // Row definition
typedef sequence<Value> Row; typedef sequence<Value> Row;
// <info> // <info>
// More about the application of COSS: // More about the application of COSS:
// //
// A Table will be a QueryableCollection of Rows // A Table will be a QueryableCollection of Rows
// A Database will be a QueryableCollection of Tables // A Database will be a QueryableCollection of Tables
// (Currently Tables are not exported... maybe later.) // (Currently Tables are not exported... maybe later.)
// Both will be queryable via the Query Service // Both will be queryable via the Query Service
// //
// Other relations will be representable using the Relationship Service // Other relations will be representable using the Relationship Service
// This includes primary/foreign keys and anything else :) // This includes primary/foreign keys and anything else :)
// //
// GRANT/REVOKE can be supplied via the Security Service // GRANT/REVOKE can be supplied via the Security Service
// //
// See a pattern here? The whole of SQL can be implemented by these services! // See a pattern here? The whole of SQL can be implemented by these services!
// The statements go through a parser. Queries and subqueries are passed to the // The statements go through a parser. Queries and subqueries are passed to the
// database for processing. Returned items are handled appropriately: // database for processing. Returned items are handled appropriately:
// //
// SELECT: return the items to the caller // SELECT: return the items to the caller
// UPDATE: modify the items (direct) // UPDATE: modify the items (direct)
// DELETE: call delete() on each Row (direct) // DELETE: call delete() on each Row (direct)
// GRANT/REVOKE: modify ACLs (via Security Service) // GRANT/REVOKE: modify ACLs (via Security Service)
// ALTER: modify the items (direct) and/or the relations (via Relationship Service) // ALTER: modify the items (direct) and/or the relations (via Relationship Service)
// etc. // etc.
// //
// I'm not sure yet about LOCK and UNLOCK. // I'm not sure yet about LOCK and UNLOCK.
// </info> // </info>
// Expirable object // Expirable object
interface Expirable { interface Expirable {
/* oneway? */ void keepalive(); /* oneway? */ void keepalive();
void remove(); void remove();
}; };
// Upcall object // Upcall object
interface Upcall { interface Upcall {
void notice(in string message); void notice(in string message);
void abort(); void abort();
}; };
// Connected database object // Connected database object
interface Database : CosQuery::QueryableCollection, Expirable { interface Database : CosQuery::QueryableCollection, Expirable {
void setupcall(in Upcall obj); void setupcall(in Upcall obj);
}; };
// Server object (stateless) // Server object (stateless)
interface Server { interface Server {
Database connect(in string db, in string user, in string password); Database connect(in string db, in string user, in string password);
}; };

View File

@ -1,59 +1,59 @@
#include <iostream> #include <iostream>
#include "pgsql_int.h" #include "pgsql_int.h"
bool terminate = false; bool terminate = false;
int main(int argc, char *argv) int main(int argc, char *argv)
{ {
CORBA::ORB_var orb = CORBA::ORB_init(argc,argv,""); CORBA::ORB_var orb = CORBA::ORB_init(argc,argv,"");
PortableManager::POA_var poa = PortableServer::POA::_narrow(orb->resolve_initial_references("RootPOA")); PortableManager::POA_var poa = PortableServer::POA::_narrow(orb->resolve_initial_references("RootPOA"));
PortableManager::POAManager_var mgr = poa->the_POAManager(); PortableManager::POAManager_var mgr = poa->the_POAManager();
Server_impl *server = new Server_impl; Server_impl *server = new Server_impl;
poa->activate_object(server); poa->activate_object(server);
CosNaming::NamingContext_var ctx = CosNaming::NamingContext::_narrow(orb->resolve_initial_references("NamingService")); CosNaming::NamingContext_var ctx = CosNaming::NamingContext::_narrow(orb->resolve_initial_references("NamingService"));
CosNaming::Name_var n = new CosNaming::Name(1); CosNaming::Name_var n = new CosNaming::Name(1);
n[0].id("PostgreSQL"); n[0].id("PostgreSQL");
n[0].name("service"); n[0].name("service");
bool bindok = false; bool bindok = false;
if (!CORBA::Object::is_nil(ctx)) { if (!CORBA::Object::is_nil(ctx)) {
try { try {
CosNaming::NamingContext_var myctx = ctx->bind_new_context(n); CosNaming::NamingContext_var myctx = ctx->bind_new_context(n);
CosNaming::Name_var n2 = new CosNaming::Name(1); CosNaming::Name_var n2 = new CosNaming::Name(1);
n2[0].id("Server"); n2[0].id("Server");
n2[0].name("Server"); n2[0].name("Server");
myctx->bind(n2,server->_this()); myctx->bind(n2,server->_this());
bindok = true; bindok = true;
} catch (CORBA::Exception &e) { } catch (CORBA::Exception &e) {
cerr << "Warning: Naming Service bind failed" << endl; cerr << "Warning: Naming Service bind failed" << endl;
bindok = false; bindok = false;
} }
} else { } else {
cerr << "Warning: Naming Service not found" << endl; cerr << "Warning: Naming Service not found" << endl;
} }
mgr->activate(); mgr->activate();
while (!terminate) { while (!terminate) {
if (orb->work_pending()) if (orb->work_pending())
orb->perform_work(); orb->perform_work();
if (expiry_needed()) if (expiry_needed())
expire_now(); expire_now();
} }
if (!CORBA::Object::is_nil(ctx) && bindok) { if (!CORBA::Object::is_nil(ctx) && bindok) {
try { try {
CosNaming::NamingContext myctx = ctx->resolve(n); CosNaming::NamingContext myctx = ctx->resolve(n);
ctx->unbind(n); ctx->unbind(n);
myctx->destroy(); myctx->destroy();
} catch (CORBA::Exception &e) { } catch (CORBA::Exception &e) {
cerr << "Warning: Naming Service unbind failed" << endl; cerr << "Warning: Naming Service unbind failed" << endl;
} }
} }
orb->shutdown(true); orb->shutdown(true);
delete server; delete server;
return 0; return 0;
} }