xref: /xnu-11417.101.15/iokit/DriverKit/OSObject.iig (revision e3723e1f17661b24996789d8afc084c0c3303b26)
1*e3723e1fSApple OSS Distributions/*
2*e3723e1fSApple OSS Distributions * Copyright (c) 2019-2019 Apple Inc. All rights reserved.
3*e3723e1fSApple OSS Distributions *
4*e3723e1fSApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5*e3723e1fSApple OSS Distributions *
6*e3723e1fSApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code
7*e3723e1fSApple OSS Distributions * as defined in and that are subject to the Apple Public Source License
8*e3723e1fSApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in
9*e3723e1fSApple OSS Distributions * compliance with the License. The rights granted to you under the License
10*e3723e1fSApple OSS Distributions * may not be used to create, or enable the creation or redistribution of,
11*e3723e1fSApple OSS Distributions * unlawful or unlicensed copies of an Apple operating system, or to
12*e3723e1fSApple OSS Distributions * circumvent, violate, or enable the circumvention or violation of, any
13*e3723e1fSApple OSS Distributions * terms of an Apple operating system software license agreement.
14*e3723e1fSApple OSS Distributions *
15*e3723e1fSApple OSS Distributions * Please obtain a copy of the License at
16*e3723e1fSApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this file.
17*e3723e1fSApple OSS Distributions *
18*e3723e1fSApple OSS Distributions * The Original Code and all software distributed under the License are
19*e3723e1fSApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20*e3723e1fSApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21*e3723e1fSApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22*e3723e1fSApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23*e3723e1fSApple OSS Distributions * Please see the License for the specific language governing rights and
24*e3723e1fSApple OSS Distributions * limitations under the License.
25*e3723e1fSApple OSS Distributions *
26*e3723e1fSApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27*e3723e1fSApple OSS Distributions */
28*e3723e1fSApple OSS Distributions
29*e3723e1fSApple OSS Distributions#if !__IIG
30*e3723e1fSApple OSS Distributions#if KERNEL
31*e3723e1fSApple OSS Distributions#include <libkern/c++/OSObject.h>
32*e3723e1fSApple OSS Distributions#endif
33*e3723e1fSApple OSS Distributions#endif
34*e3723e1fSApple OSS Distributions
35*e3723e1fSApple OSS Distributions#ifndef _IOKIT_UOSOBJECT_H
36*e3723e1fSApple OSS Distributions#define _IOKIT_UOSOBJECT_H
37*e3723e1fSApple OSS Distributions
38*e3723e1fSApple OSS Distributions#if !KERNEL
39*e3723e1fSApple OSS Distributions#include <stddef.h>
40*e3723e1fSApple OSS Distributions#include <stdint.h>
41*e3723e1fSApple OSS Distributions#include <DriverKit/IOReturn.h>
42*e3723e1fSApple OSS Distributions#if DRIVERKIT_PRIVATE
43*e3723e1fSApple OSS Distributions#include <mach/port.h>
44*e3723e1fSApple OSS Distributions#endif /* DRIVERKIT_PRIVATE */
45*e3723e1fSApple OSS Distributions#if !__IIG
46*e3723e1fSApple OSS Distributions#include <string.h>
47*e3723e1fSApple OSS Distributions#include <DriverKit/OSMetaClass.h>
48*e3723e1fSApple OSS Distributions#endif	/* !__IIG */
49*e3723e1fSApple OSS Distributionsclass OSObject;
50*e3723e1fSApple OSS Distributionstypedef OSObject * OSObjectPtr;
51*e3723e1fSApple OSS Distributions#endif /* !KERNEL */
52*e3723e1fSApple OSS Distributions
53*e3723e1fSApple OSS Distributions#if !__IIG_ATTRIBUTES_DEFINED__
54*e3723e1fSApple OSS Distributions
55*e3723e1fSApple OSS Distributions#define __IIG_ATTRIBUTES_DEFINED__	1
56*e3723e1fSApple OSS Distributions
57*e3723e1fSApple OSS Distributions#if __IIG || __DOCUMENTATION__
58*e3723e1fSApple OSS Distributions
59*e3723e1fSApple OSS Distributions#define IIG_KERNEL				__attribute__((annotate("kernel")))
60*e3723e1fSApple OSS Distributions#define IIG_NATIVE       		__attribute__((annotate("native")))
61*e3723e1fSApple OSS Distributions#define IIG_LOCAL        		__attribute__((annotate("local")))
62*e3723e1fSApple OSS Distributions#define IIG_LOCALONLY    		__attribute__((annotate("localonly")))
63*e3723e1fSApple OSS Distributions#define IIG_REMOTE       		__attribute__((annotate("remote")))
64*e3723e1fSApple OSS Distributions#define IIG_LOCALHOST    		__attribute__((annotate("localhost")))
65*e3723e1fSApple OSS Distributions#define IIG_INVOKEREPLY  		__attribute__((annotate("invokereply")))
66*e3723e1fSApple OSS Distributions#define IIG_REPLY        		__attribute__((annotate("reply")))
67*e3723e1fSApple OSS Distributions#define IIG_PORTMAKESEND 		__attribute__((annotate("MACH_MSG_TYPE_MAKE_SEND")))
68*e3723e1fSApple OSS Distributions#define IIG_PORTCOPYSEND 		__attribute__((annotate("MACH_MSG_TYPE_COPY_SEND")))
69*e3723e1fSApple OSS Distributions#define IIG_TARGET       		__attribute__((annotate("target")))
70*e3723e1fSApple OSS Distributions#define IIG_TYPE(p)      		__attribute__((annotate("type=" # p)))
71*e3723e1fSApple OSS Distributions//#define IIG_ARRAY(maxcount)	__attribute__((annotate(# maxcount), annotate("array")))
72*e3723e1fSApple OSS Distributions#define IIG_EXTENDS(cls) 		__attribute__((annotate("extends=" # cls)))
73*e3723e1fSApple OSS Distributions//#define IIG_INTERFACE  		__attribute__((annotate("interface")))
74*e3723e1fSApple OSS Distributions//#define IIG_IMPLEMENTS(i)		void __implements(i *);
75*e3723e1fSApple OSS Distributions#define IIG_QUEUENAME(name)		__attribute__((annotate("queuename=" # name)))
76*e3723e1fSApple OSS Distributions#define IIG_SERIALIZABLE		__attribute__((annotate("serializable")))
77*e3723e1fSApple OSS Distributions#define IIG_CONCRETE			__attribute__((annotate("concrete")))
78*e3723e1fSApple OSS Distributions
79*e3723e1fSApple OSS Distributions#if __IIG
80*e3723e1fSApple OSS Distributions#define KERNEL					IIG_KERNEL
81*e3723e1fSApple OSS Distributions#endif /* __IIG */
82*e3723e1fSApple OSS Distributions#define NATIVE					IIG_NATIVE
83*e3723e1fSApple OSS Distributions#define LOCAL					IIG_LOCAL
84*e3723e1fSApple OSS Distributions#define LOCALONLY				IIG_LOCALONLY
85*e3723e1fSApple OSS Distributions#define REMOTE					IIG_REMOTE
86*e3723e1fSApple OSS Distributions#define LOCALHOST				IIG_LOCALHOST
87*e3723e1fSApple OSS Distributions#define INVOKEREPLY				IIG_INVOKEREPLY
88*e3723e1fSApple OSS Distributions#define REPLY					IIG_REPLY
89*e3723e1fSApple OSS Distributions#define PORTMAKESEND			IIG_PORTMAKESEND
90*e3723e1fSApple OSS Distributions#define PORTCOPYSEND			IIG_PORTCOPYSEND
91*e3723e1fSApple OSS Distributions#define TARGET					IIG_TARGET
92*e3723e1fSApple OSS Distributions#define TYPE(p)					IIG_TYPE(p)
93*e3723e1fSApple OSS Distributions//#define ARRAY(maxcount)		IIG_ARRAY(maxcount)
94*e3723e1fSApple OSS Distributions#define EXTENDS(cls)			IIG_EXTENDS(cls)
95*e3723e1fSApple OSS Distributions//#define INTERFACE				IIG_INTERFACE
96*e3723e1fSApple OSS Distributions//#define IMPLEMENTS(i)			IIG_IMPLEMENTS(i)
97*e3723e1fSApple OSS Distributions#define QUEUENAME(name)			IIG_QUEUENAME(name)
98*e3723e1fSApple OSS Distributions
99*e3723e1fSApple OSS Distributions#else /* __IIG || __DOCUMENTATION__ */
100*e3723e1fSApple OSS Distributions
101*e3723e1fSApple OSS Distributions#define IIG_KERNEL
102*e3723e1fSApple OSS Distributions#define IIG_NATIVE
103*e3723e1fSApple OSS Distributions#define IIG_LOCAL
104*e3723e1fSApple OSS Distributions#define IIG_LOCALONLY
105*e3723e1fSApple OSS Distributions#define IIG_REMOTE
106*e3723e1fSApple OSS Distributions#define IIG_LOCALHOST
107*e3723e1fSApple OSS Distributions#define IIG_INVOKEREPLY
108*e3723e1fSApple OSS Distributions#define IIG_REPLY
109*e3723e1fSApple OSS Distributions#define IIG_PORTMAKESEND
110*e3723e1fSApple OSS Distributions#define IIG_PORTCOPYSEND
111*e3723e1fSApple OSS Distributions#define IIG_TARGET
112*e3723e1fSApple OSS Distributions#define IIG_TYPE(p)
113*e3723e1fSApple OSS Distributions//#define IIG_ARRAY(maxcount)
114*e3723e1fSApple OSS Distributions#define IIG_EXTENDS(cls)
115*e3723e1fSApple OSS Distributions//#define IIG_INTERFACE
116*e3723e1fSApple OSS Distributions//#define IIG_IMPLEMENTS(i)
117*e3723e1fSApple OSS Distributions#define IIG_QUEUENAME(name)
118*e3723e1fSApple OSS Distributions#define IIG_SERIALIZABLE
119*e3723e1fSApple OSS Distributions
120*e3723e1fSApple OSS Distributions#endif /* __IIG || __DOCUMENTATION__ */
121*e3723e1fSApple OSS Distributions
122*e3723e1fSApple OSS Distributions#endif /* __IIG_ATTRIBUTES_DEFINED__ */
123*e3723e1fSApple OSS Distributions
124*e3723e1fSApple OSS Distributions
125*e3723e1fSApple OSS Distributions#if !__IIG
126*e3723e1fSApple OSS Distributions#if KERNEL
127*e3723e1fSApple OSS Distributionstypedef OSObject OSContainer;
128*e3723e1fSApple OSS Distributions#else /* KERNEL */
129*e3723e1fSApple OSS Distributionsclass IIG_SERIALIZABLE OSContainer;
130*e3723e1fSApple OSS Distributions#endif /* KERNEL */
131*e3723e1fSApple OSS Distributions#else /* !__IIG */
132*e3723e1fSApple OSS Distributionsclass IIG_SERIALIZABLE OSContainer;
133*e3723e1fSApple OSS Distributions#endif  /* !__IIG */
134*e3723e1fSApple OSS Distributions
135*e3723e1fSApple OSS Distributions/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
136*e3723e1fSApple OSS Distributions
137*e3723e1fSApple OSS Distributions/*
138*e3723e1fSApple OSS Distributions * DRIVERKIT_ macros below can be used to describe the ownership semantics
139*e3723e1fSApple OSS Distributions * of functions handling subclasses of OSObject.
140*e3723e1fSApple OSS Distributions * The attributes propagate with inheritance, but can be overriden.
141*e3723e1fSApple OSS Distributions * New versions of the Clang Static Analyzer can use this knowledge to
142*e3723e1fSApple OSS Distributions * check the code for leaks or uses-after-free.
143*e3723e1fSApple OSS Distributions */
144*e3723e1fSApple OSS Distributions
145*e3723e1fSApple OSS Distributions#ifndef KERNEL
146*e3723e1fSApple OSS Distributions/*
147*e3723e1fSApple OSS Distributions * By default, methods returning OSObjects are assumed to have the following
148*e3723e1fSApple OSS Distributions * owneship semantics:
149*e3723e1fSApple OSS Distributions *   - Functions and methods that have "Get" in their name are assumed to be
150*e3723e1fSApple OSS Distributions *  getters. They return at "+0" and the caller is not responsible for releasing
151*e3723e1fSApple OSS Distributions *  the returned object.
152*e3723e1fSApple OSS Distributions *
153*e3723e1fSApple OSS Distributions *  - All other methods are assumed to return at "+1", and the caller is
154*e3723e1fSApple OSS Distributions *  responsible for releasing the returned object.
155*e3723e1fSApple OSS Distributions *
156*e3723e1fSApple OSS Distributions *  The semantics implied by the naming convention described above can be
157*e3723e1fSApple OSS Distributions *  overriden using either DRIVERKIT_RETURNS_RETAINED or
158*e3723e1fSApple OSS Distributions *  DRIVERKIT_RETURNS_NOT_RETAINED attribute applied to a function.
159*e3723e1fSApple OSS Distributions *  In the former case, it stipulates that the function is returning at "+1",
160*e3723e1fSApple OSS Distributions *  and in the latter case "+0".
161*e3723e1fSApple OSS Distributions *  DRIVERKIT_RETURNS_RETAINED and DRIVERKIT_RETURNS_NOT_RETAINED attributes
162*e3723e1fSApple OSS Distributions *  can be also applied to out parameters, in which case they specify
163*e3723e1fSApple OSS Distributions *  that an out parameter is written into at +1 or +0 respectively.
164*e3723e1fSApple OSS Distributions *  Behavior of out parameters of non-void functions can be additionally
165*e3723e1fSApple OSS Distributions *  customized via annotations that explain how a function returns a retained
166*e3723e1fSApple OSS Distributions *  or a non-retained value through its out-parameter depending on its
167*e3723e1fSApple OSS Distributions *  return value: DRIVERKIT_RETURNS_RETAINED_ON_ZERO and
168*e3723e1fSApple OSS Distributions *  DRIVERKIT_RETURNS_RETAINED_ON_NONZERO.
169*e3723e1fSApple OSS Distributions */
170*e3723e1fSApple OSS Distributions#if __has_attribute(os_returns_retained)
171*e3723e1fSApple OSS Distributions#define DRIVERKIT_RETURNS_RETAINED __attribute__((os_returns_retained))
172*e3723e1fSApple OSS Distributions#else
173*e3723e1fSApple OSS Distributions#define DRIVERKIT_RETURNS_RETAINED
174*e3723e1fSApple OSS Distributions#endif
175*e3723e1fSApple OSS Distributions#if __has_attribute(os_returns_not_retained)
176*e3723e1fSApple OSS Distributions#define DRIVERKIT_RETURNS_NOT_RETAINED __attribute__((os_returns_not_retained))
177*e3723e1fSApple OSS Distributions#else
178*e3723e1fSApple OSS Distributions#define DRIVERKIT_RETURNS_NOT_RETAINED
179*e3723e1fSApple OSS Distributions#endif
180*e3723e1fSApple OSS Distributions
181*e3723e1fSApple OSS Distributions/*
182*e3723e1fSApple OSS Distributions * DRIVERKIT_CONSUMED attribute can be applied to parameters.
183*e3723e1fSApple OSS Distributions * It specifies that this function call would consume the reference to the
184*e3723e1fSApple OSS Distributions * annotated parameter.
185*e3723e1fSApple OSS Distributions */
186*e3723e1fSApple OSS Distributions#if __has_attribute(os_consumed)
187*e3723e1fSApple OSS Distributions#define DRIVERKIT_CONSUMED __attribute__((os_consumed))
188*e3723e1fSApple OSS Distributions#else
189*e3723e1fSApple OSS Distributions#define DRIVERKIT_CONSUMED
190*e3723e1fSApple OSS Distributions#endif
191*e3723e1fSApple OSS Distributions
192*e3723e1fSApple OSS Distributions/*
193*e3723e1fSApple OSS Distributions * DRIVERKIT_CONSUMES_THIS attribute can be applied to C++ methods.
194*e3723e1fSApple OSS Distributions * It specifies that this method call consumes a reference to "this" (e.g.
195*e3723e1fSApple OSS Distributions * by storing a reference to "this" in a passed parameter).
196*e3723e1fSApple OSS Distributions */
197*e3723e1fSApple OSS Distributions#if __has_attribute(os_consumes_this)
198*e3723e1fSApple OSS Distributions#define DRIVERKIT_CONSUMES_THIS __attribute__((os_consumes_this))
199*e3723e1fSApple OSS Distributions#else
200*e3723e1fSApple OSS Distributions#define DRIVERKIT_CONSUMES_THIS
201*e3723e1fSApple OSS Distributions#endif
202*e3723e1fSApple OSS Distributions
203*e3723e1fSApple OSS Distributions/*
204*e3723e1fSApple OSS Distributions * DRIVERKIT_RETURNS_RETAINED_ON_ZERO is an attribute applicable to out
205*e3723e1fSApple OSS Distributions * parameters.
206*e3723e1fSApple OSS Distributions * It specifies that an out parameter at +1 is written into an argument iff
207*e3723e1fSApple OSS Distributions * the function returns a zero return value.
208*e3723e1fSApple OSS Distributions */
209*e3723e1fSApple OSS Distributions#if __has_attribute(os_returns_retained_on_zero)
210*e3723e1fSApple OSS Distributions#define DRIVERKIT_RETURNS_RETAINED_ON_ZERO __attribute__((os_returns_retained_on_zero))
211*e3723e1fSApple OSS Distributions#else
212*e3723e1fSApple OSS Distributions#define DRIVERKIT_RETURNS_RETAINED_ON_ZERO
213*e3723e1fSApple OSS Distributions#endif
214*e3723e1fSApple OSS Distributions
215*e3723e1fSApple OSS Distributions/*
216*e3723e1fSApple OSS Distributions * DRIVERKIT_RETURNS_RETAINED_ON_NON_ZERO is an attribute applicable to out
217*e3723e1fSApple OSS Distributions * parameters.
218*e3723e1fSApple OSS Distributions * It specifies that an out parameter at +1 is written into an argument iff
219*e3723e1fSApple OSS Distributions * the function returns a non-zero return value.
220*e3723e1fSApple OSS Distributions */
221*e3723e1fSApple OSS Distributions#if __has_attribute(os_returns_retained_on_non_zero)
222*e3723e1fSApple OSS Distributions#define DRIVERKIT_RETURNS_RETAINED_ON_NONZERO __attribute__((os_returns_retained_on_non_zero))
223*e3723e1fSApple OSS Distributions#else
224*e3723e1fSApple OSS Distributions#define DRIVERKIT_RETURNS_RETAINED_ON_NONZERO
225*e3723e1fSApple OSS Distributions#endif
226*e3723e1fSApple OSS Distributions
227*e3723e1fSApple OSS Distributions
228*e3723e1fSApple OSS Distributions/*
229*e3723e1fSApple OSS Distributions * Macros below are equivalent to their DRIVERKIT_ counterparts.
230*e3723e1fSApple OSS Distributions * They are provided for source-compatibility with IOKit code so they can
231*e3723e1fSApple OSS Distributions * be used in code that gets compiled for both platforms.
232*e3723e1fSApple OSS Distributions */
233*e3723e1fSApple OSS Distributions#define LIBKERN_RETURNS_RETAINED DRIVERKIT_RETURNS_RETAINED
234*e3723e1fSApple OSS Distributions#define LIBKERN_RETURNS_NOT_RETAINED DRIVERKIT_RETURNS_NOT_RETAINED
235*e3723e1fSApple OSS Distributions#define LIBKERN_CONSUMED DRIVERKIT_CONSUMED
236*e3723e1fSApple OSS Distributions#define LIBKERN_CONSUMES_THIS DRIVERKIT_CONSUMES_THIS
237*e3723e1fSApple OSS Distributions#define LIBKERN_RETURNS_RETAINED_ON_ZERO DRIVERKIT_RETURNS_RETAINED_ON_ZERO
238*e3723e1fSApple OSS Distributions#define LIBKERN_RETURNS_RETAINED_ON_NONZERO DRIVERKIT_RETURNS_RETAINED_ON_NONZERO
239*e3723e1fSApple OSS Distributions
240*e3723e1fSApple OSS Distributions#endif  /* !defined(KERNEL) */
241*e3723e1fSApple OSS Distributions
242*e3723e1fSApple OSS Distributions/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
243*e3723e1fSApple OSS Distributions
244*e3723e1fSApple OSS Distributions
245*e3723e1fSApple OSS Distributionsclass IIG_SERIALIZABLE OSData;
246*e3723e1fSApple OSS Distributionsclass IIG_SERIALIZABLE OSNumber;
247*e3723e1fSApple OSS Distributionsclass IIG_SERIALIZABLE OSString;
248*e3723e1fSApple OSS Distributionsclass IIG_SERIALIZABLE OSBoolean;
249*e3723e1fSApple OSS Distributionsclass IIG_SERIALIZABLE OSDictionary;
250*e3723e1fSApple OSS Distributionsclass IIG_SERIALIZABLE OSArray;
251*e3723e1fSApple OSS Distributionsclass IIG_SERIALIZABLE OSSet;
252*e3723e1fSApple OSS Distributionsclass IIG_SERIALIZABLE OSOrderedSet;
253*e3723e1fSApple OSS Distributions
254*e3723e1fSApple OSS Distributionsclass OSMetaClass;
255*e3723e1fSApple OSS Distributionsclass IODispatchQueue;
256*e3723e1fSApple OSS Distributionstypedef char IODispatchQueueName[256];
257*e3723e1fSApple OSS Distributions
258*e3723e1fSApple OSS Distributions#if __IIG
259*e3723e1fSApple OSS Distributionsclass OSMetaClassBase
260*e3723e1fSApple OSS Distributions{
261*e3723e1fSApple OSS Distributions	virtual const OSMetaClass *
262*e3723e1fSApple OSS Distributions	getMetaClass() const LOCALONLY;
263*e3723e1fSApple OSS Distributions
264*e3723e1fSApple OSS Distributions    virtual void
265*e3723e1fSApple OSS Distributions    retain() const LOCALONLY;
266*e3723e1fSApple OSS Distributions
267*e3723e1fSApple OSS Distributions    virtual void
268*e3723e1fSApple OSS Distributions    release() const LOCALONLY;
269*e3723e1fSApple OSS Distributions
270*e3723e1fSApple OSS Distributions	virtual bool
271*e3723e1fSApple OSS Distributions    isEqualTo(const OSMetaClassBase * anObject) const LOCALONLY;
272*e3723e1fSApple OSS Distributions};
273*e3723e1fSApple OSS Distributions#endif /* __IIG */
274*e3723e1fSApple OSS Distributions
275*e3723e1fSApple OSS Distributions
276*e3723e1fSApple OSS Distributions/*!
277*e3723e1fSApple OSS Distributions@iig implementation
278*e3723e1fSApple OSS Distributions#include <DriverKit/IODispatchQueue.h>
279*e3723e1fSApple OSS Distributions@iig end
280*e3723e1fSApple OSS Distributions*/
281*e3723e1fSApple OSS Distributions
282*e3723e1fSApple OSS Distributionsclass OSObject : public OSMetaClassBase
283*e3723e1fSApple OSS Distributions{
284*e3723e1fSApple OSS Distributionspublic:
285*e3723e1fSApple OSS Distributions
286*e3723e1fSApple OSS Distributions	virtual bool
287*e3723e1fSApple OSS Distributions	init() LOCALONLY;
288*e3723e1fSApple OSS Distributions
289*e3723e1fSApple OSS Distributions	virtual void
290*e3723e1fSApple OSS Distributions	free() LOCALONLY;
291*e3723e1fSApple OSS Distributions
292*e3723e1fSApple OSS Distributions    virtual void
293*e3723e1fSApple OSS Distributions    retain() const override;
294*e3723e1fSApple OSS Distributions
295*e3723e1fSApple OSS Distributions    virtual void
296*e3723e1fSApple OSS Distributions    release() const override;
297*e3723e1fSApple OSS Distributions
298*e3723e1fSApple OSS Distributions	virtual kern_return_t
299*e3723e1fSApple OSS Distributions	SetDispatchQueue(
300*e3723e1fSApple OSS Distributions		const IODispatchQueueName name,
301*e3723e1fSApple OSS Distributions		IODispatchQueue         * queue) KERNEL = 0;
302*e3723e1fSApple OSS Distributions
303*e3723e1fSApple OSS Distributions	virtual kern_return_t
304*e3723e1fSApple OSS Distributions	CopyDispatchQueue(
305*e3723e1fSApple OSS Distributions		const IODispatchQueueName name,
306*e3723e1fSApple OSS Distributions		IODispatchQueue        ** queue) KERNEL = 0;
307*e3723e1fSApple OSS Distributions};
308*e3723e1fSApple OSS Distributions
309*e3723e1fSApple OSS Distributions#define DEFN(classname, name)                                       \
310*e3723e1fSApple OSS Distributionsname ## _Impl(classname ## _ ## name ## _Args)
311*e3723e1fSApple OSS Distributions
312*e3723e1fSApple OSS Distributions/*
313*e3723e1fSApple OSS Distributions * Use of the IMPL macro is discouraged and should be replaced by a normal c++
314*e3723e1fSApple OSS Distributions * method implementation (with the all method arguments) and the name of the method
315*e3723e1fSApple OSS Distributions * given a suffix '_Impl'
316*e3723e1fSApple OSS Distributions */
317*e3723e1fSApple OSS Distributions
318*e3723e1fSApple OSS Distributions#define IMPL(classname, name)                                       \
319*e3723e1fSApple OSS Distributionsclassname :: DEFN(classname, name)
320*e3723e1fSApple OSS Distributions
321*e3723e1fSApple OSS Distributions/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
322*e3723e1fSApple OSS Distributions
323*e3723e1fSApple OSS Distributions#endif /* ! _IOKIT_UOSOBJECT_H */
324