home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEPLOY / SYBASEAD.Z / SybaseChannel.h < prev    next >
Text File  |  1996-09-09  |  2KB  |  83 lines

  1. //  SybaseChannel.h
  2. //  Copyright 1994, NeXT Software, Inc.
  3.  
  4. #import    <EOAccess/EOAccess.h>
  5.  
  6. @class SybaseAdaptor;
  7. @class SybaseContext;
  8.  
  9. typedef enum
  10. {
  11.     SybaseRegularRow,
  12.     SybaseComputeRow,
  13.     SybaseReturnParameterRow,
  14.     SybaseReturnStatusRow
  15. } SybaseRowType;
  16.  
  17. typedef enum
  18. {
  19.     SybaseRowFetch,
  20.     SybaseReturnParameterFetch,
  21.     SybaseReturnStatusFetch,
  22.     SybaseTerminatedFetch
  23. } SybaseFetchState;
  24.  
  25. @interface SybaseChannel:EOAdaptorChannel
  26. {
  27.     void *_ct_cmd;
  28.     SybaseRowType _rowType;
  29.     SybaseFetchState _fetchState;
  30.     int _rowsAffected; 
  31.     int _computeRowId; // only valid when _resultType == SybaseComputeRow;
  32.     int _severityLevelToIgnore;
  33.     int _rowsProcessedCount;
  34.     NSMutableArray *_columns;
  35.     NSArray *_selectedAttributes;
  36.     unsigned _rowCapacity;
  37.     unsigned _nextRowInBuffer;
  38.     BOOL _columnsAreBound;
  39.     BOOL _beganTransaction;
  40.     NSMutableArray *_storedProcedureColumns;
  41.     NSMutableDictionary *_outOfBandValues;
  42.     struct
  43.     {
  44.     unsigned fetchInProgress:1;
  45.     unsigned relinquishConnectionAfterFetch:1;
  46.     unsigned isOpen:1;
  47.         unsigned canUseArrayFetch:1;
  48.     unsigned _RESERVED:28;
  49.     } _flags;
  50.     struct {
  51.     unsigned willFetchAttributes:1;
  52.     unsigned willReturnRow:1;
  53.     unsigned _RESERVED:30;
  54.     } _sybaseDelegateRespondsTo;
  55. }
  56.  
  57. - initWithSybaseContext:(SybaseContext *)adaptorContext;
  58. @end
  59.  
  60. @interface NSObject(SybaseChannelDelegation)
  61.  
  62. - (NSArray *)sybaseChannel:(SybaseChannel *)channel
  63.     willFetchAttributes:(NSArray *)attributes
  64.     forRowOfType:(SybaseRowType)rowType
  65.     withComputeRowId:(int)computeRowId;
  66.     // Invoked whenever a row fetched, the delegate can return nil which
  67.     // will cause the row to be skipped, or replace the attributes with a
  68.     // set of attributes that is appropriate for the type of row that is
  69.     // being fetched. Delegates can have the channel fabricate a set of
  70.     // attributes for the current non-regular row by calling describe
  71.     // attributes at this point.
  72.     
  73. - (BOOL)sybaseChannel:(SybaseChannel *)channel
  74.     willReturnRow:(NSDictionary *)row ofType:(SybaseRowType)rowType 
  75.     withComputeRowId:(int)computeRowId;
  76.     // Invoked once a row has been read in an packaged into the dictionary.
  77.     // Delegates return YES to cause the row to be returned from
  78.     // fetchAttributes:WithZone: or they can return NO to cause the row to
  79.     // be skipped.
  80.     
  81. @end
  82.  
  83.