本文整理匯總了C++中CFPlugInAddInstanceForFactory函數的典型用法代碼示例。如果您正苦於以下問題:C++ CFPlugInAddInstanceForFactory函數的具體用法?C++ CFPlugInAddInstanceForFactory怎麽用?C++ CFPlugInAddInstanceForFactory使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了CFPlugInAddInstanceForFactory函數的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: HP_Object
HP_HardwarePlugIn::HP_HardwarePlugIn(CFUUIDRef inFactoryUUID)
:
HP_Object(kAudioObjectUnknown, kAudioPlugInClassID, this),
mInterface(&sInterface),
mFactoryUUID((CFUUIDRef)CFRetain(inFactoryUUID)),
mRefCount(0)
{
CFPlugInAddInstanceForFactory(inFactoryUUID);
}
示例2: CFRetain
void IOHIDIUnknown::factoryAddRef()
{
if (0 == factoryRefCount++) {
CFUUIDRef factoryId = kIOHIDDeviceFactoryID;
CFRetain(factoryId);
CFPlugInAddInstanceForFactory(factoryId);
}
}
示例3: CFRetain
void
SATSMARTClient::sFactoryAddRef ( void )
{
if ( sFactoryRefCount++ == 0 )
{
CFUUIDRef factoryID = kIOATASMARTLibFactoryID;
CFRetain ( factoryID );
CFPlugInAddInstanceForFactory ( factoryID );
}
}
示例4: AllocMetadataImporterPluginType
MetadataImporterPluginType *
AllocMetadataImporterPluginType (CFUUIDRef inFactoryID)
{
MetadataImporterPluginType *newInstance = (MetadataImporterPluginType *) malloc (sizeof (MetadataImporterPluginType));
memset (newInstance, 0, sizeof (MetadataImporterPluginType));
newInstance->conduitInterface = &testInterfaceFunctionTable;
// Retain and keep an open instance refcount for each factory.
newInstance->factoryID = CFRetain (inFactoryID);
CFPlugInAddInstanceForFactory (inFactoryID);
// This function returns the IUnknown interface so set the refCount to one.
newInstance->refCount = 1;
return newInstance;
}
示例5: memset
// -----------------------------------------------------------------------------
// AllocMetadataImporterPluginType
// -----------------------------------------------------------------------------
// Utility function that allocates a new instance.
// You can do some initial setup for the importer here if you wish
// like allocating globals etc...
//
MetadataImporterPluginType *AllocMetadataImporterPluginType(CFUUIDRef inFactoryID)
{
MetadataImporterPluginType *theNewInstance;
theNewInstance = (MetadataImporterPluginType *)malloc(sizeof(MetadataImporterPluginType));
memset(theNewInstance,0,sizeof(MetadataImporterPluginType));
/* Point to the function table */
theNewInstance->conduitInterface = &testInterfaceFtbl;
/* Retain and keep an open instance refcount for each factory. */
theNewInstance->factoryID = CFRetain(inFactoryID);
CFPlugInAddInstanceForFactory(inFactoryID);
/* This function returns the IUnknown interface so set the refCount to one. */
theNewInstance->refCount = 1;
return theNewInstance;
}
示例6: CFPlugInAddInstanceForFactory
static CFPlugType *_allocCFPlugType(CFUUIDRef factoryID)
{
// Allocate memory for the new instance.
CFPlugType *newOne = (CFPlugType *)malloc(sizeof(CFPlugType));
// Point to the function table
newOne->_PPROCFPlugFormat = &CFPlugFormat;
// Retain and keep an open instance refcount for each factory.
if (factoryID) {
newOne->_factoryID = (CFUUIDRef)CFRetain(factoryID);
CFPlugInAddInstanceForFactory(factoryID);
}
// This function returns the IUnknown interface so set the refCount to one.
newOne->_refCount = 1;
return newOne;
}
示例7: _sessionInterface
//------------------------------------------------------------------------------
// IOHIDEventSystemStatistics::IOHIDEventSystemStatistics
//------------------------------------------------------------------------------
IOHIDEventSystemStatistics::IOHIDEventSystemStatistics(CFUUIDRef factoryID)
:
_sessionInterface(&sIOHIDEventSystemStatisticsFtbl),
_factoryID( static_cast<CFUUIDRef>( CFRetain(factoryID) ) ),
_refCount(1),
_displayState(1),
_displayToken(0),
_pending_source(0),
_dispatch_queue(0),
_last_motionstat_ts(0),
_logButtonFiltering(false),
_logStrings(NULL),
_logfd(-1),
_asl(NULL)
{
bzero(&_pending_buttons, sizeof(_pending_buttons));
bzero(&_pending_motionstats, sizeof(_pending_motionstats));
CFPlugInAddInstanceForFactory( factoryID );
}
示例8: printf
// Utility function that allocates a new instance.
static MyType *_allocMyType(CFUUIDRef factoryID) {
#if PRINTDEBUG
printf("JAS: _allocMyType\n");
#endif
// Allocate memory for the new instance.
MyType *newOne = (MyType *)malloc( sizeof(MyType) );
// Point to the function table
newOne->_testInterface = &testInterfaceFtbl;
// Retain and keep an open instance refcount
// for each factory.
newOne->_factoryID = (CFUUIDRef)CFRetain( factoryID );
CFPlugInAddInstanceForFactory( factoryID );
// This function returns the IUnknown interface
// so set the refCount to one.
newOne->_refCount = 1;
return newOne;
}
示例9: Alloc
/*****************************************************************************
* Alloc
* -
* Functionas as both +[alloc] and -[init] for the plugin. Add any
* initalization of member variables here.
*****************************************************************************/
static BonjourUserEventsPlugin* Alloc(CFUUIDRef factoryID)
{
BonjourUserEventsPlugin* plugin = malloc(sizeof(BonjourUserEventsPlugin));
plugin->_UserEventAgentInterface = &UserEventAgentInterfaceFtbl;
plugin->_pluginContext = NULL;
if (factoryID)
{
plugin->_factoryID = (CFUUIDRef)CFRetain(factoryID);
CFPlugInAddInstanceForFactory(factoryID);
}
plugin->_refCount = 1;
plugin->_tokenToBrowserMap = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kNetBrowserInfoDictionaryValueCallbacks);
plugin->_browsers = CFDictionaryCreateMutable(NULL, 0, &kNetBrowserInfoDictionaryKeyCallbacks, &kCFTypeDictionaryValueCallBacks);
plugin->_onAddEvents = CFDictionaryCreateMutable(NULL, 0, &kNetBrowserInfoDictionaryKeyCallbacks, &kCFTypeDictionaryValueCallBacks);
plugin->_onRemoveEvents = CFDictionaryCreateMutable(NULL, 0, &kNetBrowserInfoDictionaryKeyCallbacks, &kCFTypeDictionaryValueCallBacks);
return plugin;
}
示例10: AllocSampleCMPluginType
// -----------------------------------------------------------------------------
// AllocSampleCMPluginType
// -----------------------------------------------------------------------------
// Utility function that allocates a new instance.
//
static SampleCMPluginType* AllocSampleCMPluginType(
CFUUIDRef inFactoryID )
{
// Allocate memory for the new instance.
SampleCMPluginType *theNewInstance;
theNewInstance = ( SampleCMPluginType* ) malloc(
sizeof( SampleCMPluginType ) );
// Point to the function table
theNewInstance->cmInterface = &testInterfaceFtbl;
// Retain and keep an open instance refcount<
// for each factory.
theNewInstance->factoryID = CFRetain( inFactoryID );
CFPlugInAddInstanceForFactory( inFactoryID );
// This function returns the IUnknown interface
// so set the refCount to one.
theNewInstance->refCount = 1;
return theNewInstance;
}
示例11: PrintDialogPDEPluginFactory
/* =============================================================================
Name: PrintDialogPDEPluginFactory()
Description:
This is the factory function which should be the only entry point of
this plugin. This factory function creates the "base class" for the system.
The factory functions name (ie "PrintDialogPDEPluginFactory") needs to be
listed in the Info.plist to associate the factory function name
with the factory function UUID. For example, this is how this function
is associated with the UUID in the Info.plist file.
CFPlugInFactories =
{
"DFC01D58-0C4A-11D5-BB77-003065500EB8" = "PrintDialogPDEPluginFactory";
};
Input Parameters:
allocator - the allocator function used by CoreFoundation
reqTypeID - requested instance type.
Output Parameters:
None.
Return Value:
* ========================================================================== */
void* PrintDialogPDEPluginFactory( CFAllocatorRef allocator, CFUUIDRef reqTypeID )
{
CFUUIDRef myInstID;
IUnknownInstance* instance = NULL;
// There is not much we can do with errors - just return NULL.
myInstID = CFUUIDCreateFromString(kCFAllocatorDefault, kAppPrintDialogTypeIDStr);
// If the requested type matches our plugin type (it should!)
// have a plugin instance created which will query us for
// interfaces:
if (myInstID && CFEqual(reqTypeID, myInstID))
{
CFUUIDRef myFactoryID = CFUUIDCreateFromString(kCFAllocatorDefault, kPrintDialogPDEIntfFactoryIDStr);
if(myFactoryID) {
// allocate and clear our instance structure
instance = (IUnknownInstance*) calloc(1, sizeof(IUnknownInstance));
if (instance != NULL)
{
// Assign all members:
instance->vtable = &instance->vtableStorage;
instance->vtableStorage.QueryInterface = IUnknownQueryInterface;
instance->vtableStorage.AddRef = IUnknownAddRef;
instance->vtableStorage.Release = IUnknownRelease;
instance->factoryID = myFactoryID;
instance->refCount = 1;
// Register the newly created instance
CFPlugInAddInstanceForFactory(myFactoryID);
}
}
}
if(myInstID)
CFRelease(myInstID);
return ((void*) instance);
}