本文整理匯總了C++中CFPlugInRemoveInstanceForFactory函數的典型用法代碼示例。如果您正苦於以下問題:C++ CFPlugInRemoveInstanceForFactory函數的具體用法?C++ CFPlugInRemoveInstanceForFactory怎麽用?C++ CFPlugInRemoveInstanceForFactory使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了CFPlugInRemoveInstanceForFactory函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: IUnknownRelease
/* =============================================================================
Name: IUnknownRelease()
Description:
This function takes a tick from a plugin instance's reference count.
When the reference count goes down to zero the object self-destructs.
Input Parameters:
obj - The 'this' pointer.
Output Parameters:
None. Return Value:
ULONG - Updated value of the reference count, or zero
in case of an error.
* ========================================================================== */
static ULONG IUnknownRelease(void* obj)
{
IUnknownInstance* instance = (IUnknownInstance*) obj;
ULONG refCount = 0;
// We can't do much with errors here since we can only return
// updated reference count value.
if (instance != NULL)
{
// Get updated refCount value (should be under mutex):
// Make sure refCount is non-zero:
if (0 == instance->refCount)
{
instance = NULL;
return(refCount);
}
refCount = --instance->refCount;
// Is it time to self-destruct?
if (0 == refCount)
{
// Unregister 'instance for factory' with CoreFoundation:
CFPlugInRemoveInstanceForFactory(instance->factoryID);
// Release used factoryID:
CFRelease(instance->factoryID);
instance->factoryID = NULL;
// Deallocate object's memory block:
free((void*) instance);
instance = NULL;
}
}
return refCount;
}
示例2: _deallocCFPlugType
static void _deallocCFPlugType(CFPlugType *myInstance)
{
CFUUIDRef factoryID = myInstance->_factoryID;
free(myInstance);
if (factoryID) {
CFPlugInRemoveInstanceForFactory(factoryID);
CFRelease(factoryID);
}
}
示例3: DeallocMetadataImporterPluginType
// Utility function that deallocates the instance when
// the refCount goes to zero.
// In the current implementation importer interfaces are never deallocated
// but implement this as this might change in the future
void DeallocMetadataImporterPluginType(MetadataImporterPluginType *thisInstance)
{
CFUUIDRef theFactoryID = thisInstance->factoryID;
free(thisInstance);
if (theFactoryID)
{
CFPlugInRemoveInstanceForFactory(theFactoryID);
CFRelease(theFactoryID);
}
}
示例4: DeallocSampleCMPluginType
// -----------------------------------------------------------------------------
// DeallocSampleCMPluginType
// -----------------------------------------------------------------------------
// Utility function that deallocates the instance when
// the refCount goes to zero.
//
static void DeallocSampleCMPluginType( SampleCMPluginType* thisInstance )
{
CFUUIDRef theFactoryID = thisInstance->factoryID;
free( thisInstance );
if ( theFactoryID )
{
CFPlugInRemoveInstanceForFactory( theFactoryID );
CFRelease( theFactoryID );
}
}
示例5: CFPlugInRemoveInstanceForFactory
void IOHIDIUnknown::factoryRelease()
{
if (1 == factoryRefCount--) {
CFUUIDRef factoryId = kIOHIDDeviceFactoryID;
CFPlugInRemoveInstanceForFactory(factoryId);
CFRelease(factoryId);
}
else if (factoryRefCount < 0)
factoryRefCount = 0;
}
示例6: DeallocMetadataImporterPluginType
// -----------------------------------------------------------------------------
// DeallocKoanLogImporterMDImporterPluginType
// -----------------------------------------------------------------------------
// Utility function that deallocates the instance when
// the refCount goes to zero.
// In the current implementation importer interfaces are never deallocated
// but implement this as this might change in the future
//
void
DeallocMetadataImporterPluginType (MetadataImporterPluginType *instance)
{
CFUUIDRef factoryID = instance->factoryID;
free (instance);
if (factoryID)
{
CFPlugInRemoveInstanceForFactory ((CFUUIDRef) instance);
CFRelease (instance);
}
}
示例7: _deallocMyType
// Utility function that deallocates the instance when
// the refCount goes to zero.
static void _deallocMyType(MyType * obj) {
#if PRINTDEBUG
printf("JAS: _deallocMyType\n");
#endif
CFUUIDRef factoryID = obj->_factoryID;
free(obj);
if (factoryID) {
CFPlugInRemoveInstanceForFactory(factoryID);
CFRelease(factoryID);
}
}
示例8: Dealloc
/*****************************************************************************
* Dealloc
* -
* Much like Obj-C dealloc this method is responsible for releasing any object
* this plugin is holding. Unlike ObjC, you call directly free() instead of
* [super dalloc].
*****************************************************************************/
static void Dealloc(BonjourUserEventsPlugin* plugin)
{
CFUUIDRef factoryID = plugin->_factoryID;
if (factoryID)
{
CFPlugInRemoveInstanceForFactory(factoryID);
CFRelease(factoryID);
}
if (plugin->_tokenToBrowserMap)
CFRelease(plugin->_tokenToBrowserMap);
if (plugin->_browsers)
CFRelease(plugin->_browsers);
if (plugin->_onAddEvents)
CFRelease(plugin->_onAddEvents);
if (plugin->_onRemoveEvents)
CFRelease(plugin->_onRemoveEvents);
if (plugin->_whileServiceExist)
CFRelease(plugin->_whileServiceExist);
if (plugin->_timers)
{
CFIndex i;
CFIndex count = CFArrayGetCount(plugin->_timers);
CFRunLoopRef crl = CFRunLoopGetCurrent();
for (i = 0; i < count; ++i)
{
CFRunLoopTimerRef timer = (CFRunLoopTimerRef)CFArrayGetValueAtIndex(plugin->_timers, i);
CFRunLoopRemoveTimer(crl, timer, kCFRunLoopCommonModes);
}
CFRelease(plugin->_timers);
}
free(plugin);
}
示例9: CFPlugInRemoveInstanceForFactory
void
SATSMARTClient::sFactoryRelease ( void )
{
if ( sFactoryRefCount-- == 1 )
{
CFUUIDRef factoryID = kIOATASMARTLibFactoryID;
CFPlugInRemoveInstanceForFactory ( factoryID );
CFRelease ( factoryID );
}
else if ( sFactoryRefCount < 0 )
{
sFactoryRefCount = 0;
}
}
示例10: Dealloc
/*****************************************************************************
* Dealloc
* -
* Much like Obj-C dealloc this method is responsible for releasing any object
* this plugin is holding. Unlike ObjC, you call directly free() instead of
* [super dalloc].
*****************************************************************************/
static void Dealloc(BonjourUserEventsPlugin* plugin)
{
CFUUIDRef factoryID = plugin->_factoryID;
if (factoryID)
{
CFPlugInRemoveInstanceForFactory(factoryID);
CFRelease(factoryID);
}
if (plugin->_tokenToBrowserMap)
CFRelease(plugin->_tokenToBrowserMap);
if (plugin->_browsers)
CFRelease(plugin->_browsers);
if (plugin->_onAddEvents)
CFRelease(plugin->_onAddEvents);
if (plugin->_onRemoveEvents)
CFRelease(plugin->_onRemoveEvents);
free(plugin);
}
示例11: CFPlugInRemoveInstanceForFactory
HP_HardwarePlugIn::~HP_HardwarePlugIn()
{
CFPlugInRemoveInstanceForFactory(mFactoryUUID.GetCFObject());
}
示例12: CFPlugInRemoveInstanceForFactory
//------------------------------------------------------------------------------
// IOHIDEventSystemStatistics::IOHIDEventSystemStatistics
//------------------------------------------------------------------------------
IOHIDEventSystemStatistics::~IOHIDEventSystemStatistics()
{
CFPlugInRemoveInstanceForFactory( _factoryID );
CFRelease( _factoryID );
}