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