]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/IONotifier.h
xnu-792.6.56.tar.gz
[apple/xnu.git] / iokit / IOKit / IONotifier.h
1 /*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
25 *
26 * HISTORY
27 *
28 */
29
30 #ifndef _IOKIT_IONOTIFIER_H
31 #define _IOKIT_IONOTIFIER_H
32
33 #include <libkern/c++/OSObject.h>
34
35 /*! @class IONotifier : public OSObject
36 @abstract An abstract base class defining common methods for controlling a notification request.
37 @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. */
38
39 class IONotifier : public OSObject
40 {
41 OSDeclareAbstractStructors(IONotifier)
42
43 public:
44
45 /*! @function remove
46 @abstract Removes the notification request and releases it.
47 @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. */
48
49 virtual void remove() = 0;
50
51 /*! @function disable
52 @abstract Disables the notification request.
53 @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.
54 @result Returns the previous enable state of the IONotifier. */
55
56 virtual bool disable() = 0;
57
58 /*! @function enable
59 @abstract Sets the enable state of the notification request.
60 @discussion Restores the enable state of the notification request, given the previous state passed in.
61 @param was The enable state of the notifier to restore. */
62
63 virtual void enable( bool was ) = 0;
64
65 };
66
67 #endif /* ! _IOKIT_IONOTIFIER_H */