1
/** Declaration of extension methods for base additions
3
Copyright (C) 2003-2010 Free Software Foundation, Inc.
5
Written by: Richard Frith-Macdonald <rfm@gnu.org>
6
and: Adam Fedor <fedor@gnu.org>
8
This file is part of the GNUstep Base Library.
10
This library is free software; you can redistribute it and/or
11
modify it under the terms of the GNU Lesser General Public
12
License as published by the Free Software Foundation; either
13
version 2 of the License, or (at your option) any later version.
15
This library is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
Library General Public License for more details.
20
You should have received a copy of the GNU Lesser General Public
21
License along with this library; if not, write to the Free
22
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27
#ifndef INCLUDED_NSObject_GNUstepBase_h
28
#define INCLUDED_NSObject_GNUstepBase_h
30
#import <GNUstepBase/GSVersionMacros.h>
31
#import <Foundation/NSObject.h>
33
#if defined(__cplusplus)
37
#if OS_API_VERSION(GS_API_NONE,GS_API_LATEST)
39
@interface NSObject (GNUstepBase)
42
WARNING: The -compare: method for NSObject is deprecated
43
due to subclasses declaring the same selector with
44
conflicting signatures.
45
Comparision of arbitrary objects is not just meaningless
46
but also dangerous as most concrete implementations
47
expect comparable objects as arguments often accessing
48
instance variables directly.
49
This method will be removed in a future release.
51
- (NSComparisonResult) compare: (id)anObject;
53
/** For backward compatibility only ... use class_isMetaClass() on the
54
* class of the receiver instead.
59
* Transmutes the receiver into an immutable version of the same object
60
* and returns the result.<br />
61
* If the receiver is not a mutable object or cannot be simply transmuted,
62
* then this method either returns the receiver unchanged or,
63
* if the force flag is set to YES, returns an autoreleased copy of the
65
* Mutable classes should override this default implementation.<br />
66
* This method is used in methods which are declared to return immutable
67
* objects (eg. an NSArray), but which create and build mutable ones
70
- (id) makeImmutableCopyOnFail: (BOOL)force;
73
* Message sent when an implementation wants to explicitly exclude a method
74
* (but cannot due to compiler constraint), and wants to make sure it is not
75
* called by mistake. Default implementation raises an exception at runtime.
77
- (id) notImplemented: (SEL)aSel;
80
* Message sent when an implementation wants to explicitly require a subclass
81
* to implement a method (but cannot at compile time since there is no
82
* <code>abstract</code> keyword in Objective-C). Default implementation
83
* raises an exception at runtime to alert developer that he/she forgot to
86
- (id) subclassResponsibility: (SEL)aSel;
89
* Message sent when an implementation wants to explicitly exclude a method
90
* (but cannot due to compiler constraint) and forbid that subclasses
91
* implement it. Default implementation raises an exception at runtime. If a
92
* subclass <em>does</em> implement this method, however, the superclass's
93
* implementation will not be called, so this is not a perfect mechanism.
95
- (id) shouldNotImplement: (SEL)aSel;
99
#endif /* OS_API_VERSION */
101
#if defined(__cplusplus)
105
#endif /* INCLUDED_NSObject_GNUstepBase_h */