/*****************************************************************************
FILE:               Oracle7Channel.h
LANGUAGE:           Objective-C
SYSTEM:             GNUstep
USER-INTERFACE:     None
DESCRIPTION

    This class is the GNUstep/db channel to the Oracle7 databases.
    Its implementation is based on the OCI v8, and should be compatible
    with, both Oracle77, Oracle78 and future Oracle79 databases.

AUTHORS
    <PJB> Pascal J. Bourguignon <pjb@imaginet.fr>
MODIFICATIONS
    1999/07/24 Creation.
BUGS
    - ...
LEGAL
    Written by:  Pascal J. Bourguignon <pjb@imaginet.fr>
    Funds from:  Orange Concept (http://www.orange-concept.com/)
    Date:        August 1999 - February 2000

    This file is part of the Oracle7 Adaptor, GNUstep Database Library.
    The Oracle7 Adaptor allows access to Oracle[678] databases from GDL.

    Copyright (C) 2000 Free Software Foundation, Inc.

    This  library is  free software;  you can  redistribute  it and/or
    modify it under the terms of the GNU Lesser General Public License
    as published by the Free  Software Foundation; either version 2 of
    the License, or (at your option) any later version.

    This library  is distributed in the  hope that it  will be useful,
    but  WITHOUT ANY WARRANTY;  without even  the implied  warranty of
    MERCHANTABILITY or FITNESS FOR  A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have  received a copy of the  GNU Lesser General Public
    License  along  with this  library;  if  not,  write to  the  Free
    Software  Foundation, Inc.,  59 Temple  Place, Suite  330, Boston,
    MA 02111-1307 USA
*****************************************************************************/
#ifndef __Oracle7Channel_h__
#define __Oracle7Channel_h__

#include <eoaccess/eoaccess.h>  // Let's leave  the  compiler  handle 
                                // intelligently pre-compiled headers!


@class O2CI7Context; // is a private class.
@class O2CI7Cursor;  // is a private class.



//exceptions:
extern NSString* Oracle7Channel_eAttributeNotInResultSet;


@interface Oracle7Channel:EOAdaptorChannel
{
    O2CI7Context*       ociContext;
    O2CI7Cursor*        ociCursor;

    /*
        Attributes used for fetching.
        All these arrays are corelated:
            attributesPassedToSelect[i]==fetchAttributes[i]
            fetchAttributes[i]<-->fetchColumns[i]<-->fetchBuffer[i],
    */
    NSArray*            attributesPassedToSelect; // not retained.
    NSArray*            fetchAttributes;
        /*
            Either a copy of attributesPassedToSelect,
            or a list of attributes built from the columns selected.
            In both cases, [fetchAttributes isMemberOf:[NSArray class]]
            to be able to be returned by describeAttributes directly.
        */
    NSMutableArray*     fetchColumns;
        /*
            fetchColumns contains O2CI7Column instances that will be fetched.
        */
    NSMutableArray*     fetchBuffers;      
        /*
            fetchBuffers contains one Oracle7Buffer instance for each
            O2CI7Column in fetchColumns.
        */
    BOOL                canUseAttributesPassedToSelect;
        /*
            Caches the fact that attributesPassedToSelect is not mutable.
            When it's the case, we can test quickly if the attributes passed
            to fetchAttributes:... are the same than those passed to 
            selectAttributes:...
        */
}


// NSObject methods:

    -(id)init;
        /*
            RAISE the bad initializer exception.
        */

    -(void)dealloc;


// EOAdaptorChannel methods:

    -(id)initWithAdaptorContext:(EOAdaptorContext*)anAdaptorContext;
    -(BOOL)openChannel;
    -(NSArray*)describeResults;
    -(void)cancelFetch;
    -(NSMutableDictionary*)primaryFetchAttributes:(NSArray*)attributes 
            withZone:(NSZone*)zone;
    -(BOOL)evaluateExpression:(NSString*)anExpression;
    -(EOModel*)describeModelWithTableNames:(NSArray*)tableNames;
    -(NSArray*)describeTableNames;
    -(BOOL)readTypesForEntity:(EOEntity*)anEntity;
    -(BOOL)readTypeForAttribute:(EOAttribute*)anAttribute;



// Oracle7Channel methods:

    // None. What would be the purpose of an EO adaptor layer if each and every
    // one EOAdaptorChannel subclass would add it's own specific methods?
    // Let the client use only the EOAdaptorChannel API to access "portably" 
    // our database.


@end // Oracle7Channel;



#endif /* __Oracle7Channel_h__ */
/*** Oracle7Channel.h                 -- 2000-02-21 07:11:22 -- PJB ***/
