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"
struct MyConnectionAndPortContext
{
io_connect_t connection;
mach_port_t asyncPort;
};
typedef struct MyConnectionAndPortContext MyConnectionAndPortContext;
class SCSITaskDeviceClass
{
public:
struct InterfaceMap
{
IUnknownVTbl * pseudoVTable;
SCSITaskDeviceClass * obj;
};
SCSITaskDeviceClass ( void );
virtual ~SCSITaskDeviceClass ( void );
virtual void RemoveTaskFromTaskSet ( SCSITaskInterface ** task );
protected:
static IOCFPlugInInterface sIOCFPlugInInterface;
InterfaceMap fIOCFPlugInInterface;
static SCSITaskDeviceInterface sSCSITaskDeviceInterface;
InterfaceMap fSCSITaskDeviceInterfaceMap;
CFUUIDRef fFactoryId;
UInt32 fRefCount;
io_service_t fService;
io_connect_t fConnection;
bool fAddedConnectRef;
bool fHasExclusiveAccess;
bool fIsServicesLayerInterface;
CFMutableSetRef fTaskSet;
mach_port_t fAsyncPort;
CFRunLoopRef fCFRunLoop;
CFRunLoopSourceRef fCFRunLoopSource;
static inline SCSITaskDeviceClass * getThis ( void * self )
{ return ( SCSITaskDeviceClass * ) ( ( InterfaceMap * ) self)->obj; };
static HRESULT staticQueryInterface ( void * self, REFIID iid, void **ppv );
virtual HRESULT QueryInterface ( REFIID iid, void **ppv );
static UInt32 staticAddRef ( void * self );
virtual UInt32 AddRef ( void );
static UInt32 staticRelease ( void * self );
virtual UInt32 Release ( void );
static IOReturn staticProbe ( void * self, CFDictionaryRef propertyTable,
io_service_t service, SInt32 * order );
virtual IOReturn Probe ( CFDictionaryRef propertyTable, io_service_t service, SInt32 * order );
static IOReturn staticStart ( void * self, CFDictionaryRef propertyTable, io_service_t service );
virtual IOReturn Start ( CFDictionaryRef propertyTable, io_service_t service );
static IOReturn staticStop ( void * self );
virtual IOReturn Stop ( void );
static Boolean staticIsExclusiveAccessAvailable ( void * self );
virtual Boolean IsExclusiveAccessAvailable ( void );
static IOReturn staticAddCallbackDispatcherToRunLoop ( void * self, CFRunLoopRef cfRunLoopRef );
virtual IOReturn AddCallbackDispatcherToRunLoop ( CFRunLoopRef cfRunLoopRef );
static void staticRemoveCallbackDispatcherFromRunLoop ( void * self );
virtual void RemoveCallbackDispatcherFromRunLoop ( void );
static IOReturn staticObtainExclusiveAccess ( void * self );
virtual IOReturn ObtainExclusiveAccess ( void );
static IOReturn staticReleaseExclusiveAccess ( void * self );
virtual IOReturn ReleaseExclusiveAccess ( void );
static SCSITaskInterface ** staticCreateSCSITask ( void * self );
virtual SCSITaskInterface ** CreateSCSITask ( void );
private:
SCSITaskDeviceClass ( SCSITaskDeviceClass &src );
void operator = ( SCSITaskDeviceClass &src );
public:
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 );
};
#endif