home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OpenStep 4.2J (Developer)
/
os42jdev.iso
/
NextDeveloper
/
OpenStepConversion
/
IntermediateFrameworks3
/
Foundation.framework
/
Headers
/
NSInvocation.h
< prev
next >
Wrap
Text File
|
1996-03-27
|
2KB
|
90 lines
/* NSInvocation.h
An Objective C message object
Copyright 1994, NeXT Computer, Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
@class NSMutableArray, NSMethodSignature;
#if !defined(STRICT_OPENSTEP)
typedef struct {
enum {
NSObjCNoType = 0,
NSObjCVoidType = 'v',
NSObjCCharType = 'c',
NSObjCShortType = 's',
NSObjCLongType = 'l',
NSObjCLonglongType = 'q',
NSObjCFloatType = 'f',
NSObjCDoubleType = 'd',
NSObjCSelectorType = ':',
NSObjCObjectType = '@',
NSObjCStructType = '{',
NSObjCPointerType = '^',
NSObjCStringType = '*',
NSObjCArrayType = '[', // not used in return values
NSObjCUnionType = '(', // not used in return values
NSObjCBitfield = 'b', // not used in return values
} type;
union {
char charValue;
short shortValue;
long longValue;
long long longlongValue;
float floatValue;
double doubleValue;
SEL selectorValue;
id objectValue;
void *pointerValue;
void *structLocation;
char *cStringLocation;
} value;
} NSObjCValue;
#else /* STRICT_OPENSTEP */
typedef struct {
int type;
long long value;
} NSObjCValue;
#endif /* !STRICT_OPENSTEP */
@interface NSInvocation : NSObject <NSCoding> {
@private
NSObjCValue returnValue; // first since it has largest alignment
void *argumentFrame;
NSMethodSignature *signature;
NSMutableArray *container;
unsigned retainedArgs:1;
unsigned isInvalid:1;
unsigned signatureValid:1;
unsigned unused:5;
unsigned refCount:24;
void *reserved;
}
+ (NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)sig;
- (SEL)selector;
- (void)setSelector:(SEL)selector;
- (id)target;
- (id)setTarget:(id)target;
- (void)retainArguments; // retain objects; copy char * strings
- (BOOL)argumentsRetained;
- (void)getReturnValue:(void *)retLoc;
- (void)setReturnValue:(void *)retLoc;
- (void)getArgument:(void *)argumentLocation atIndex:(int)index;
// 0 target; 1 selector; ...
- (void)setArgument:(void *)argumentLocation atIndex:(int)index;
- (NSMethodSignature *)methodSignature;
- (void)invoke;
- (void)invokeWithTarget:(id)target;
// dispatch the message and collect the result
@end