]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
37839358 A |
6 | * The contents of this file constitute Original Code as defined in and |
7 | * are subject to the Apple Public Source License Version 1.1 (the | |
8 | * "License"). You may not use this file except in compliance with the | |
9 | * License. Please obtain a copy of the License at | |
10 | * http://www.apple.com/publicsource and read it before using this file. | |
1c79356b | 11 | * |
37839358 A |
12 | * This Original Code and all software distributed under the License are |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
1c79356b A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
37839358 A |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the |
17 | * License for the specific language governing rights and limitations | |
18 | * under the License. | |
1c79356b A |
19 | * |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | /* | |
23 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. | |
24 | * | |
25 | * HISTORY | |
26 | * | |
27 | */ | |
28 | ||
29 | #ifndef _IOKIT_IONOTIFIER_H | |
30 | #define _IOKIT_IONOTIFIER_H | |
31 | ||
32 | #include <libkern/c++/OSObject.h> | |
33 | ||
34 | /*! @class IONotifier : public OSObject | |
35 | @abstract An abstract base class defining common methods for controlling a notification request. | |
36 | @discussion IOService notification requests are represented as implementations of the IONotifier object. It defines methods to enable, disable and remove notification requests. These actions are synchronized with invocations of the notification handler, so removing a notification request will guarantee the handler is not being executed. */ | |
37 | ||
38 | class IONotifier : public OSObject | |
39 | { | |
40 | OSDeclareAbstractStructors(IONotifier) | |
41 | ||
42 | public: | |
43 | ||
44 | /*! @function remove | |
45 | @abstract Removes the notification request and releases it. | |
46 | @discussion Removes the notification request and release it. Since creating an IONotifier instance will leave it with a retain count of one, creating an IONotifier and then removing it will destroy it. This method is synchronous with any handler invocations, so when this method returns its guaranteed the handler will not be in entered. */ | |
47 | ||
48 | virtual void remove() = 0; | |
49 | ||
50 | /*! @function disable | |
51 | @abstract Disables the notification request. | |
52 | @discussion Disables the notification request. This method is synchronous with any handler invocations, so when this method returns its guaranteed the handler will not be in entered. | |
53 | @result Returns the previous enable state of the IONotifier. */ | |
54 | ||
55 | virtual bool disable() = 0; | |
56 | ||
57 | /*! @function enable | |
58 | @abstract Sets the enable state of the notification request. | |
59 | @discussion Restores the enable state of the notification request, given the previous state passed in. | |
60 | @param was The enable state of the notifier to restore. */ | |
61 | ||
62 | virtual void enable( bool was ) = 0; | |
63 | ||
64 | }; | |
65 | ||
66 | #endif /* ! _IOKIT_IONOTIFIER_H */ |