mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
* Headers/Foundation/Foundation.h
* Headers/Foundation/NSOperation.h * Source/GNUmakefile * Source/NSOperation.m: Initial implementation of NSOperation class. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28393 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2e2d640c4d
commit
8ee18b36c7
5 changed files with 240 additions and 0 deletions
82
Headers/Foundation/NSOperation.h
Normal file
82
Headers/Foundation/NSOperation.h
Normal file
|
@ -0,0 +1,82 @@
|
|||
/**Interface for NSOperation for GNUStep
|
||||
Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Gregory Casamento <greg.casamento@gmail.com>
|
||||
Date: 2009
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
AutogsdocSource: NSOperation.m
|
||||
*/
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@class NSMutableArray;
|
||||
|
||||
enum {
|
||||
NSOperationQueuePriorityVeryLow = -8,
|
||||
NSOperationQueuePriorityLow = -4,
|
||||
NSOperationQueuePriorityNormal = 0,
|
||||
NSOperationQueuePriorityHigh = 4,
|
||||
NSOperationQueuePriorityVeryHigh = 8
|
||||
};
|
||||
|
||||
typedef NSInteger NSOperationQueuePriority;
|
||||
|
||||
@interface NSOperation : NSObject
|
||||
{
|
||||
// Priority...
|
||||
NSOperationQueuePriority priority;
|
||||
|
||||
// Status...
|
||||
BOOL cancelled;
|
||||
BOOL concurrent;
|
||||
BOOL executing;
|
||||
BOOL finished;
|
||||
BOOL ready;
|
||||
|
||||
// Dependencies
|
||||
NSMutableArray *dependencies;
|
||||
}
|
||||
|
||||
// Initialization
|
||||
- (id) init;
|
||||
|
||||
// Executing the operation
|
||||
- (void) start;
|
||||
- (void) main;
|
||||
|
||||
// Cancelling the operation
|
||||
- (void) cancel;
|
||||
|
||||
// Getting the operation status
|
||||
- (BOOL) isCancelled;
|
||||
- (BOOL) isExecuting;
|
||||
- (BOOL) isFinished;
|
||||
- (BOOL) isConcurrent;
|
||||
- (BOOL) isReady;
|
||||
|
||||
// Managing dependencies
|
||||
- (void) addDependency: (NSOperation *)op;
|
||||
- (void) removeDependency: (NSOperation *)op;
|
||||
- (NSArray *)dependencies;
|
||||
|
||||
// Prioritization
|
||||
- (NSOperationQueuePriority) queuePriority;
|
||||
- (void) setQueuePriority: (NSOperationQueuePriority)priority;
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue