1995-03-23 03:42:04 +00:00
|
|
|
/* Interface for NSMethodSignature for GNUStep
|
1998-08-13 20:41:28 +00:00
|
|
|
Copyright (C) 1995, 1998 Free Software Foundation, Inc.
|
1995-07-01 19:01:11 +00:00
|
|
|
|
1996-04-17 20:17:45 +00:00
|
|
|
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
|
1995-07-01 19:01:11 +00:00
|
|
|
Date: 1995
|
1998-08-13 20:41:28 +00:00
|
|
|
Rewritten: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
|
|
|
Date: 1998
|
1995-03-23 03:42:04 +00:00
|
|
|
|
1996-05-12 00:56:10 +00:00
|
|
|
This file is part of the GNUstep Base Library.
|
1995-03-23 03:42:04 +00:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
1995-03-23 03:42:04 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
1995-03-23 03:42:04 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
1995-03-23 03:42:04 +00:00
|
|
|
License along with this library; if not, write to the Free
|
2006-10-31 07:05:46 +00:00
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
1995-03-23 03:42:04 +00:00
|
|
|
*/
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#ifndef __NSMethodSignature_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSMethodSignature_h_GNUSTEP_BASE_INCLUDE
|
2006-10-31 07:05:46 +00:00
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
1994-11-08 16:44:01 +00:00
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
#import <Foundation/NSObject.h>
|
1994-11-08 16:44:01 +00:00
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* <p>Class encapsulating type information for method arguments and return
|
|
|
|
* value. It is used as a component of [NSInvocation] to implement message
|
|
|
|
* forwarding, such as within the distributed objects framework. Instances
|
|
|
|
* can be obtained from the [NSObject] method
|
|
|
|
* [NSObject-methodSignatureForSelector:].</p>
|
|
|
|
*
|
|
|
|
* <p>Basically, types are represented as Objective-C <code>@encode(...)</code>
|
2009-10-05 16:00:28 +00:00
|
|
|
* compatible strings. The arguments are
|
2004-06-22 22:27:39 +00:00
|
|
|
* numbered starting from 0, including the implicit arguments
|
|
|
|
* <code><em>self</em></code> (type <code>id</code>, at position 0) and
|
|
|
|
* <code><em>_cmd</em></code> (type <code>SEL</code>, at position 1).</p>
|
|
|
|
*/
|
1994-11-08 16:44:01 +00:00
|
|
|
@interface NSMethodSignature : NSObject
|
|
|
|
{
|
2010-02-14 10:48:10 +00:00
|
|
|
#if GS_EXPOSE(NSMethodSignature)
|
|
|
|
@private
|
1999-09-16 07:21:34 +00:00
|
|
|
const char *_methodTypes;
|
2009-02-23 20:42:32 +00:00
|
|
|
NSUInteger _argFrameLength;
|
|
|
|
NSUInteger _numArgs;
|
2004-08-20 17:53:16 +00:00
|
|
|
void *_info;
|
2010-02-14 10:48:10 +00:00
|
|
|
#endif
|
1994-11-08 16:44:01 +00:00
|
|
|
}
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Build a method signature directly from string description of return type and
|
|
|
|
* argument types, using the Objective-C <code>@encode(...)</code> type codes.
|
|
|
|
*/
|
2001-12-17 14:31:42 +00:00
|
|
|
+ (NSMethodSignature*) signatureWithObjCTypes: (const char*)t;
|
1994-11-08 16:44:01 +00:00
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Number of bytes that the full set of arguments occupies on the stack, which
|
2005-11-06 13:53:40 +00:00
|
|
|
* is platform(hardware)-dependent.
|
2004-06-22 22:27:39 +00:00
|
|
|
*/
|
2009-02-23 20:42:32 +00:00
|
|
|
- (NSUInteger) frameLength;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns Objective-C <code>@encode(...)</code> compatible string. Arguments
|
|
|
|
* are numbered starting from 0, including the implicit arguments
|
|
|
|
* <code><em>self</em></code> (type <code>id</code>, at position 0) and
|
2009-10-05 16:00:28 +00:00
|
|
|
* <code><em>_cmd</em></code> (type <code>SEL</code>, at position 1).<br />
|
|
|
|
* Type strings may include leading type qualifiers.
|
2004-06-22 22:27:39 +00:00
|
|
|
*/
|
2009-02-23 20:42:32 +00:00
|
|
|
- (const char*) getArgumentTypeAtIndex: (NSUInteger)index;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Pertains to distributed objects; method is asynchronous when invoked and
|
|
|
|
* return should not be waited for.
|
|
|
|
*/
|
1994-11-08 16:44:01 +00:00
|
|
|
- (BOOL) isOneway;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Number of bytes that the return value occupies on the stack, which is
|
2005-11-06 13:53:40 +00:00
|
|
|
* platform(hardware)-dependent.
|
2004-06-22 22:27:39 +00:00
|
|
|
*/
|
2009-02-23 20:42:32 +00:00
|
|
|
- (NSUInteger) methodReturnLength;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
2009-10-05 16:00:28 +00:00
|
|
|
* Returns an Objective-C <code>@encode(...)</code> compatible string
|
|
|
|
* describing the return type of the method. This may include type
|
|
|
|
* qualifiers.
|
2004-06-22 22:27:39 +00:00
|
|
|
*/
|
1998-08-13 20:41:28 +00:00
|
|
|
- (const char*) methodReturnType;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns number of arguments to method, including the implicit
|
|
|
|
* <code><em>self</em></code> and <code><em>_cmd</em></code>.
|
|
|
|
*/
|
2009-02-23 20:42:32 +00:00
|
|
|
- (NSUInteger) numberOfArguments;
|
1994-11-08 16:44:01 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#endif /* __NSMethodSignature_h_GNUSTEP_BASE_INCLUDE */
|