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