Added NSDiscardableContent protocol from Snow Leopard.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28577 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2009-08-30 16:40:24 +00:00
parent 9ddfb17425
commit 019f6b1da6
2 changed files with 36 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2009-08-30 David Chisnall <csdavec@swan.ac.uk>
* Headers/Foundation/NSObject.h: Added NSDicardableContent protocol from
Snow Leopard.
2009-08-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSCategories.m:

View file

@ -407,7 +407,38 @@ GS_EXPORT NSRecursiveLock *gnustep_global_lock;
afterDelay: (NSTimeInterval)seconds
inModes: (NSArray*)modes;
@end
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
/**
* The NSDiscardableContent protocol is used by objects which encapsulate data
* which may be discarded if resource constraints are exceeded. These
* constraints are typically, but not always, related memory.
*/
@protocol NSDiscardableContent
/**
* This method is called before any access to the object. It returns YES if
* the object's content is still valid. The caller must call -endContentAccess
* once for every call to -beginContentAccess;
*/
- (BOOL)beginContentAccess;
/**
* This method indicates that the caller has finished accessing the contents of
* the object adopting this protocol. Every call to -beginContentAccess must
* be be paired with a call to this method after the caller has finished
* accessing the contents.
*/
- (void)endContentAccess;
/**
* Discards the contents of the object if it is not currently being edited.
*/
- (void)discardContentIfPossible;
/**
* Returns YES if the contents of the object have been discarded, either via a
* call to -discardContentIfPossible while the object is not in use, or by some
* implementation-dependent mechanism.
*/
- (BOOL)isContentDiscarded;
@end
#endif
#if defined(__cplusplus)
}
#endif