PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBSingleton
Wrapper Class for the ISingleton interface.
#include <SFBSingleton.h.hpp>
class SFBSingleton : public SFBQuery;
SFMTYPEDEFWRAPPER(SFBSingleton)

Inheritance diagram

 Inheritance diagram of SFBSingletonClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
X X X O

Reference

BREW API ISingleton

Member

Public Functions
SFCError CreateInstance( AEECLSID clsid , SFBBaseSmpPtr result , SingletonCIFunc * pfn , VoidPtr data )
This function wraps the actual CreateInstance (or new function) of a singleton class. If ISingleton has already created the class, it is addref'd and returned, otherwise, pfnCI is called to create the class.
SFCError Refer( AEECLSID clsid , UInt32Ptr refs , SInt32 inc )
このfunctionはスレッド安全で,classごとの refcount 修飾functionです. 指定された Class ID の refcount がゼロになると,SFBSingleton はinstanceのトラッキングを停止します.
SFCError QueryInterface( AEECLSID clsid , VoidHandle handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFCError QueryInterface( AEECLSID clsid , SFBBaseSmpPtr handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFBBaseSmp QueryInterface( AEECLSID clsid ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
Void Self( AEECLSID clsidReq , SFBQuerySmpPtr clone , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SFBQuerySmp Self( AEECLSID clsidReq , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBSingleton::CreateInstance
This function wraps the actual CreateInstance (or new function) of a singleton class. If ISingleton has already created the class, it is addref'd and returned, otherwise, pfnCI is called to create the class.
[ public ]
SFCError CreateInstance(
    AEECLSID clsid          // 32-bit ClassID of the requested interface 
    SFBBaseSmpPtr result    // Pointer to be filled with a reference to the instance 
    SingletonCIFunc * pfn   // where to call to create the instance if not already created 
    VoidPtr data            // Pointer to user data to be passed to pfnCI 
);

Return value

AEE_SUCCESS, class instance found or created other AEEError, on failure, depends on pfnCI

Reference

BREW API ISingleton_CreateInstance


SFBSingleton::Refer
このfunctionはスレッド安全で,classごとの refcount 修飾functionです. 指定された Class ID の refcount がゼロになると,SFBSingleton はinstanceのトラッキングを停止します.
[ public ]
SFCError Refer(
    AEECLSID clsid   // 変更する ref の 32 ビット ClassID.Ref() が 0 を返す場合にトラッキングの停止に使用する
    UInt32Ptr refs   // 一枚札の refcount を指すポインタで, nInc によって調整される
    SInt32 inc       // refs に追加する値."AddRef" には 1 を, "Release" には -1 をそれぞれ使用する
);

Return value

refs の結果値.

Reference

BREW API ISingleton_Ref