SCSITaskDeviceClass.h [plain text]
#ifndef __SCSI_TASK_DEVICE_USER_CLIENT_CLASS_H__
#define __SCSI_TASK_DEVICE_USER_CLIENT_CLASS_H__
#include <IOKit/IOCFPlugIn.h>
#include "SCSITaskLib.h"
#include "SCSITaskLibPriv.h"
#include "SCSITaskIUnknown.h"
struct MyConnectionAndPortContext
{
io_connect_t connection;
mach_port_t asyncPort;
};
typedef struct MyConnectionAndPortContext MyConnectionAndPortContext;
class SCSITaskDeviceClass : public SCSITaskIUnknown
{
public:
SCSITaskDeviceClass ( void );
virtual ~SCSITaskDeviceClass ( void );
virtual void RemoveTaskFromTaskSet ( SCSITaskInterface ** task );
static IOCFPlugInInterface ** alloc ( void );
static SCSITaskDeviceInterface ** alloc ( io_service_t service,
io_connect_t connection );
virtual IOReturn InitWithConnection ( io_service_t service,
io_connect_t connection );
virtual IOReturn Init ( void );
protected:
static IOCFPlugInInterface sIOCFPlugInInterface;
static SCSITaskDeviceInterface sSCSITaskDeviceInterface;
struct InterfaceMap fSCSITaskDeviceInterfaceMap;
io_service_t fService;
io_connect_t fConnection;
bool fHasExclusiveAccess;
bool fIsServicesLayerInterface;
CFMutableSetRef fTaskSet;
mach_port_t fAsyncPort;
CFRunLoopSourceRef fCFRunLoopSource;
CFRunLoopRef fCFRunLoop;
static inline SCSITaskDeviceClass * getThis ( void * self )
{ return ( SCSITaskDeviceClass * ) ( ( InterfaceMap * ) self )->obj; };
virtual HRESULT QueryInterface ( REFIID iid, void ** ppv );
virtual IOReturn Probe ( CFDictionaryRef propertyTable, io_service_t service, SInt32 * order );
virtual IOReturn Start ( CFDictionaryRef propertyTable, io_service_t service );
virtual IOReturn Stop ( void );
virtual Boolean IsExclusiveAccessAvailable ( void );
virtual IOReturn AddCallbackDispatcherToRunLoop ( CFRunLoopRef cfRunLoopRef );
virtual void RemoveCallbackDispatcherFromRunLoop ( void );
virtual IOReturn ObtainExclusiveAccess ( void );
virtual IOReturn ReleaseExclusiveAccess ( void );
virtual SCSITaskInterface ** CreateSCSITask ( void );
virtual IOReturn CreateDeviceAsyncEventSource ( CFRunLoopSourceRef * source );
virtual CFRunLoopSourceRef GetDeviceAsyncEventSource ( void );
virtual IOReturn CreateDeviceAsyncPort ( mach_port_t * port );
virtual mach_port_t GetDeviceAsyncPort ( void );
static IOReturn sProbe ( void * self, CFDictionaryRef propertyTable, io_service_t service, SInt32 * order );
static IOReturn sStart ( void * self, CFDictionaryRef propertyTable, io_service_t service );
static IOReturn sStop ( void * self );
static Boolean sIsExclusiveAccessAvailable ( void * self );
static IOReturn sCreateDeviceAsyncEventSource ( void * self, CFRunLoopSourceRef * source );
static CFRunLoopSourceRef sGetDeviceAsyncEventSource ( void * self );
static IOReturn sCreateDeviceAsyncPort ( void * self, mach_port_t * port );
static mach_port_t sGetDeviceAsyncPort ( void * self );
static IOReturn sAddCallbackDispatcherToRunLoop ( void * self, CFRunLoopRef cfRunLoopRef );
static void sRemoveCallbackDispatcherFromRunLoop ( void * self );
static IOReturn sObtainExclusiveAccess ( void * self );
static IOReturn sReleaseExclusiveAccess ( void * self );
static SCSITaskInterface ** sCreateSCSITask ( void * self );
private:
SCSITaskDeviceClass ( SCSITaskDeviceClass &src );
void operator = ( SCSITaskDeviceClass &src );
};
#endif