3324fc7f555d654ba5439e210325358e11925b01
2 * Copyright (c) 1998-2019 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
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.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
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.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
35 #ifndef _IOKIT_IONOTIFIER_H
36 #define _IOKIT_IONOTIFIER_H
38 #include <libkern/c++/OSObject.h>
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. */
44 class IONotifier
: public OSObject
46 OSDeclareAbstractStructors(IONotifier
);
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. */
54 virtual void remove() = 0;
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. */
61 virtual bool disable() = 0;
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. */
68 virtual void enable( bool was
) = 0;
71 #endif /* ! _IOKIT_IONOTIFIER_H */