home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / Foundation.framework / Versions / B / Headers / NSInvocation.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-08  |  2.0 KB  |  96 lines

  1. /*      NSInvocation.h
  2.     An Objective C message object
  3.     Copyright 1994-1996, NeXT Software, Inc.  All rights reserved.
  4. */
  5.  
  6. #import <Foundation/NSObject.h>
  7.  
  8. @class NSMutableArray, NSMethodSignature;
  9.  
  10. #if !defined(STRICT_OPENSTEP)
  11.  
  12. enum _NSObjCValueType {
  13.     NSObjCNoType = 0,
  14.     NSObjCVoidType = 'v',
  15.     NSObjCCharType = 'c',
  16.     NSObjCShortType = 's',
  17.     NSObjCLongType = 'l',
  18.     NSObjCLonglongType = 'q',
  19.     NSObjCFloatType = 'f',
  20.     NSObjCDoubleType = 'd',
  21.     NSObjCSelectorType = ':',
  22.     NSObjCObjectType = '@',
  23.     NSObjCStructType = '{',
  24.     NSObjCPointerType = '^',
  25.     NSObjCStringType = '*',
  26.     NSObjCArrayType = '[',
  27.     NSObjCUnionType = '(',
  28.     NSObjCBitfield = 'b'
  29. };
  30.  
  31. typedef struct {
  32.     enum _NSObjCValueType type;
  33.     union {
  34.         char charValue;
  35.     short shortValue;
  36.     long longValue;
  37.     long long longlongValue;
  38.     float floatValue;
  39.     double doubleValue;
  40.     SEL selectorValue;
  41.     id objectValue;
  42.     void *pointerValue;
  43.     void *structLocation;
  44.     char *cStringLocation;
  45.     } value;
  46. } NSObjCValue;
  47.  
  48. #else /* STRICT_OPENSTEP */
  49.  
  50. typedef struct {
  51.     int        type;
  52.     long long    value;
  53. } NSObjCValue;
  54.  
  55. #endif /* !STRICT_OPENSTEP */
  56.     
  57. @interface NSInvocation : NSObject <NSCoding> {
  58.     @private
  59.     NSObjCValue    returnValue;
  60.     void    *argumentFrame;
  61.     NSMethodSignature    *signature;
  62.     NSMutableArray    *container;
  63.     unsigned     retainedArgs:1;
  64.     unsigned    isInvalid:1;
  65.     unsigned    signatureValid:1;
  66.     unsigned    retainedRet:1;
  67.     unsigned    unused:4;
  68.     unsigned    refCount:24;
  69.     void    *reserved;
  70. }
  71.  
  72. + (NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)sig;
  73.  
  74. - (SEL)selector;
  75. - (void)setSelector:(SEL)selector;
  76.  
  77. - (id)target;
  78. - (void)setTarget:(id)target;
  79.  
  80. - (void)retainArguments;
  81. - (BOOL)argumentsRetained;
  82.  
  83. - (void)getReturnValue:(void *)retLoc;
  84. - (void)setReturnValue:(void *)retLoc;
  85.  
  86. - (void)getArgument:(void *)argumentLocation atIndex:(int)index;
  87. - (void)setArgument:(void *)argumentLocation atIndex:(int)index;
  88.  
  89. - (NSMethodSignature *)methodSignature;
  90.  
  91. - (void)invoke;
  92. - (void)invokeWithTarget:(id)target;
  93.  
  94. @end
  95.  
  96.