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

Inheritance diagram

 Inheritance diagram of SFBModelClass

Version

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

Reference

BREW API IModel

Member

Public Functions
SFCError AddListener( ModelListener* listener )
Allow objects such as widgets and UI controls to attach a listener to the given model.
SFCError AddListenerEx( ModelListener* listener , PFNLISTENER notify , VoidPtr data )
Initialize the fields of a ModelListener, and register the listener with the model.
static
SFBModelSmp
NewInstance( SFBQuerySmpConstRef query , SFCErrorPtr exception = null )
Create a new SFBModel instance.
static
SFBModelSmp
NewInstance( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBModel instance.
SFCError Notify( ModelListener* listener )
send a notify event to all listeners that are currently installed on the model. The notification will be sent to the function specified by the pfnListener member of the ModelListener data structure passed to SFBModel:AddListener().
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.

SFBModel::AddListener
Allow objects such as widgets and UI controls to attach a listener to the given model.
[ public ]
SFCError AddListener(
    ModelListener* listener   // pointer to the ModelListener that will be attched to the object
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • Invalid argument: SFERR_INVALID_PARAM

Reference

BREW API IMODEL_AddListener


SFBModel::AddListenerEx
Initialize the fields of a ModelListener, and register the listener with the model.
[ public ]
SFCError AddListenerEx(
    ModelListener* listener   // pointer to the ModelListener that will be attched to the object
    PFNLISTENER notify        // pointer to the callback function that BREW will call to notify the listening object of events involving the model
    VoidPtr data              // pointer to the private data defined by the object that will be returned to the object in the listener callback function
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • Invalid argument: SFERR_INVALID_PARAM

Reference

BREW API IMODEL_AddListenerEx | SFBModel::AddListener


SFBModel::NewInstance
Create a new SFBModel instance.
[ public, static ]
SFBModelSmp NewInstance(
    SFBQuerySmpConstRef query      // SFBQuery instance
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBModelSmp NewInstance(
    SFBQuerySmpConstRef query      // SFBQuery instance
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBModel::Notify
send a notify event to all listeners that are currently installed on the model. The notification will be sent to the function specified by the pfnListener member of the ModelListener data structure passed to SFBModel:AddListener().
[ public ]
SFCError Notify(
    ModelListener* listener   // pointer to a ModelEvent structure containing the event code and event-specific data.
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • Invalid argument: SFERR_INVALID_PARAM

Reference

BREW API IMODEL_Notify