#ifndef __IOFWRingBufferQ_H__
#define __IOFWRingBufferQ_H__
#import <IOKit/IOMemoryDescriptor.h>
class IOFWRingBufferQ: public OSObject
{
OSDeclareDefaultStructors(IOFWRingBufferQ);
public:
static IOFWRingBufferQ * withAddressRange( mach_vm_address_t address, mach_vm_size_t length, IOOptionBits options, task_t task );
virtual bool initQ( mach_vm_address_t address, mach_vm_size_t length, IOOptionBits options, task_t task );
virtual void free( void );
virtual bool isEmpty( void );
virtual bool dequeueBytes( IOByteCount size );
virtual bool dequeueBytesWithCopy( void * copy, IOByteCount size );
virtual IOByteCount readBytes(IOByteCount offset, void * bytes, IOByteCount withLength);
virtual bool enqueueBytes( void * bytes, IOByteCount size );
virtual bool isSpaceAvailable( IOByteCount size, IOByteCount * offset );
virtual bool front( void * copy, IOByteCount size, IOByteCount * paddingBytes );
virtual IOByteCount spaceAvailable( void );
virtual bool willFitAtEnd( IOByteCount sizeOfEntry, IOByteCount * offset, IOByteCount * paddingBytes );
virtual IOByteCount frontEntryOffset( IOByteCount sizeOfEntry, IOByteCount * paddingBytes );
private:
IOMemoryDescriptor * fMemDescriptor;
bool fMemDescriptorPrepared;
IOByteCount fBufferSize;
IOByteCount fFrontOffset;
IOByteCount fQueueLength;
} ;
#endif //__IOFWRingBufferQ_H__