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

Inheritance diagram

 Inheritance diagram of SFBModClass

Version

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

Reference

BREW API IMod

Member

Public Functions
SFCError CreateInstance( AEECLSID id , SFBPrivSetSmpConstRef privSet , SFBBaseSmpPtr result )
Instantiates the specified class.
Void Exit( Void )
Undo up SFBMod initialization.
SFCError Init( Void )
Initialize an instance of SFBMod (a component) for use.
SFCError New( SFBEnvSmpConstRef env , AEECLSID id , SFBBaseSmpPtr pOut )
Creates a new IMod, which will satisfy creation requests for classes in the exporting module.
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.

SFBMod::CreateInstance
Instantiates the specified class.
[ public ]
SFCError CreateInstance(
    AEECLSID id                     // the AEECLSID of the class to instantiate 
    SFBPrivSetSmpConstRef privSet   // privilege level of the call, supplied in case the class being instantiated requires a privilege check or needs to 
    SFBBaseSmpPtr result            // pointer to be filled with new instance of the class requested 
);

Return value

AEE_SUCCESS if instance of class created, otherwise a failure-specific error value from AEEError.h

Reference

BREW API IMod_CreateInstance


SFBMod::Exit
Undo up SFBMod initialization.
[ public ]
Void Exit(Void);

Description

This function should be the exact opposite of SFBMod_Init(). It is the last call into a component that will be made before unloading the component's code image.

Reference

BREW API IMod_Exit | SFBMod::Init


SFBMod::Init
Initialize an instance of SFBMod (a component) for use.
[ public ]
SFCError Init(Void);

Return value

AEE_SUCCESS if the SFBMod is initialized, AEEError otherwise (which will be returned to the caller of IEnv_CreateInstance().

Description

This function is separated out from SFBMod_New() so that infrastructure can first have a reference to this IMod during IMod_Init(), so that requests for instances of classes in this component may succeed, even *during* the call to IMod_Init().

Reference

BREW API IMod_Init | SFBMod::Exit | SFBMod::New


SFBMod::New
Creates a new IMod, which will satisfy creation requests for classes in the exporting module.
[ public ]
SFCError New(
    SFBEnvSmpConstRef env   // pointer to the SFBEnv for the module
    AEECLSID id             // the AEEIID of the desired interface for the new SFBMod object (initially always AEEIID_IMod
    SFBBaseSmpPtr pOut      // pointer to be filled with new instance of the SFBMod 
);

Return value

AEE_SUCCESS if instance of class created, otherwise a failure-specific error value from AEEError.h

Description

The implementation of this function should be absolutely minimal, i.e., only allocate memory for the IMod instance, save the Env (not AddRef) and return.

More involved initialization of the IMod should be done in IMod_Init() to maximize the likelihood of successful initialization.

Reference

BREW API IMod_New | SFBMod::Exit | SFBMod::Init