/*
- * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1998-2019 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#ifndef _IOKIT_IOSHAREDDATAQUEUE_H
#define _IOKIT_IOSHAREDDATAQUEUE_H
-#ifdef dequeue
-#undef dequeue
-#endif
-#ifdef enqueue
-#undef enqueue
-#endif
-
#define DISABLE_DATAQUEUE_WARNING /* IODataQueue is deprecated, please use IOSharedDataQueue instead */
#include <IOKit/IODataQueue.h>
+#include <libkern/c++/OSPtr.h>
#undef DISABLE_DATAQUEUE_WARNING
*/
class IOSharedDataQueue : public IODataQueue
{
- OSDeclareDefaultStructors(IOSharedDataQueue)
+ OSDeclareDefaultStructors(IOSharedDataQueue);
struct ExpansionData {
UInt32 queueSize;
* @param size The size of the data queue memory region.
* @result Returns the newly allocated IOSharedDataQueue instance. Zero is returned on failure.
*/
- static IOSharedDataQueue *withCapacity(UInt32 size);
+ static OSPtr<IOSharedDataQueue> withCapacity(UInt32 size);
/*!
* @function withEntries
* @param entrySize Size of each entry.
* @result Reeturns the newly allocated IOSharedDataQueue instance. Zero is returned on failure.
*/
- static IOSharedDataQueue *withEntries(UInt32 numEntries, UInt32 entrySize);
+ static OSPtr<IOSharedDataQueue> withEntries(UInt32 numEntries, UInt32 entrySize);
/*!
* @function initWithCapacity
* @discussion The IOMemoryDescriptor instance returned by this method is intended to be mapped into a user process. This is the memory region that the IODataQueueClient code operates on.
* @result Returns a newly allocated IOMemoryDescriptor for the IODataQueueMemory region. Returns zero on failure.
*/
- virtual IOMemoryDescriptor *getMemoryDescriptor() APPLE_KEXT_OVERRIDE;
+ virtual OSPtr<IOMemoryDescriptor> getMemoryDescriptor() APPLE_KEXT_OVERRIDE;
/*!
* @function peek