當前位置: 首頁>>代碼示例>>C++>>正文


C++ CFPlugInAddInstanceForFactory函數代碼示例

本文整理匯總了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);
}
開發者ID:abscura,項目名稱:audiounitjs,代碼行數:9,代碼來源:HP_HardwarePlugIn.cpp

示例2: CFRetain

void IOHIDIUnknown::factoryAddRef()
{
    if (0 == factoryRefCount++) {
        CFUUIDRef factoryId = kIOHIDDeviceFactoryID;

        CFRetain(factoryId);
        CFPlugInAddInstanceForFactory(factoryId);
    }
}
開發者ID:MomandDad,項目名稱:netbook-installer,代碼行數:9,代碼來源:IOHIDIUnknown.cpp

示例3: CFRetain

void
SATSMARTClient::sFactoryAddRef ( void )
{

    if ( sFactoryRefCount++ == 0 )
    {

        CFUUIDRef factoryID = kIOATASMARTLibFactoryID;

        CFRetain ( factoryID );
        CFPlugInAddInstanceForFactory ( factoryID );

    }

}
開發者ID:eitschpi,項目名稱:OS-X-SAT-SMART-Driver,代碼行數:15,代碼來源:SATSMARTClient.cpp

示例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;
}
開發者ID:stesla,項目名稱:koan,代碼行數:16,代碼來源:Main.c

示例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;
}
開發者ID:JackieXie168,項目名稱:xar,代碼行數:25,代碼來源:main.c

示例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;
}
開發者ID:iSound,項目名稱:PlayerPRO,代碼行數:19,代碼來源:CFPlugin-DigitalBridge.c

示例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 );
}
開發者ID:wzw19890321,項目名稱:IOHIDFamily,代碼行數:22,代碼來源:IOHIDEventSystemStatistics.cpp

示例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;
    }
開發者ID:briancline,項目名稱:jackosx,代碼行數:22,代碼來源:JackRouter.cpp

示例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;
}
開發者ID:thenewwazoo,項目名稱:Community-mdnsResponder,代碼行數:27,代碼來源:BonjourEvents.c

示例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;
}
開發者ID:arnelh,項目名稱:Examples,代碼行數:27,代碼來源:SampleCMPlugin.c

示例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);
}
開發者ID:fruitsamples,項目名稱:App,代碼行數:66,代碼來源:PrintDialogPDE.c


注:本文中的CFPlugInAddInstanceForFactory函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。