PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFRHandler
Internal class to manage an event handler.
#include <SFRHandler.hpp>
class SFRHandler : public SFRTracer;
SFMTYPEDEFCLASS(SFRHandler)

Inheritance diagram

 Inheritance diagram of SFRHandlerClass

Collaboration diagram

 Collaboration diagram of SFRHandlerClass

Description

The SFRHandler class is used internally in SophiaFramework.

Reference

Event Handling

Member

Constructor/Destructor
SFRHandler( Void )
Constructor of the SFRHandler class.
~SFRHandler( Void )
Destructor of the SFRHandler class.
Public Functions
SFCError RegisterHandler( HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref )
Register a handler.
SFCError RegisterHandler( SFCEventEnum type , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref )
Register a handler.
SFCError RegisterHandler( SFCEventEnum type , UInt16 p16 , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref )
Register a handler.
SFCError RegisterHandler( SFCEventEnum type , UInt16 bp16 , UInt16 ep16 , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref )
Register a handler.
SFCError RegisterHandler( SFCEventEnum btype , SFCEventEnum etype , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref )
Register a handler.
SFCError RegisterHandler( SFCEventEnum btype , SFCEventEnum endType , UInt16 p16 , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref )
Register a handler.
SFCError RegisterHandler( SFCEventEnum btype , SFCEventEnum etype , UInt16 bp16 , UInt16 ep16 , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref )
Register a handler.
Void UnregisterHandler( HandlerEnum timing )
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum type , HandlerEnum timing )
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum type , UInt16 p16 , HandlerEnum timing )
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum type , UInt16 bgnP16 , UInt16 endP16 , HandlerEnum timing )
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum bgnType , SFCEventEnum endType , HandlerEnum timing )
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 p16 , HandlerEnum timing )
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 bgnP16 , UInt16 endP16 , HandlerEnum timing )
Unregister the registered handler.
Bool Invoke( SFXEventConstRef event ) (inherits from SFCInvoker)
Send an event.
SFCError RegisterTracer( BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum type , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum type , UInt16 p16 , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum type , UInt16 bgnP16 , UInt16 endP16 , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum bgnType , SFCEventEnum endType , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 p16 , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 bgnP16 , UInt16 endP16 , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
Void UnregisterTracer( Void ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum type ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum type , UInt16 p16 ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum type , UInt16 bgnP16 , UInt16 endP16 ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum bgnType , SFCEventEnum endType ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 p16 ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 bgnP16 , UInt16 endP16 ) (inherits from SFRTracer)
Unregister the tracer.
Protected Functions
HandlerRecConstPtr SearchHandler( SFXEventConstRef event , HandlerEnum timing )
Search for the handler that matches the specified event.
TracerRecConstPtr SearchTracer( SFXEventConstRef event ) (inherits from SFRTracer)
Search for the tracer that matches the specified event.
Types
HandlerEnum
Constant that represents the timing to call the handler.
SFRHandlerSPP
Type of the callback function.
TracerEnum (inherits from SFRTracer)
Constant that represents the trace order.
TracerTraceMPP (inherits from SFRTracer)
Type of the callback function.

SFRHandler::SFRHandler
Constructor of the SFRHandler class.
[ protected ]
SFRHandler(Void);

SFRHandler::~SFRHandler
Destructor of the SFRHandler class.
[ protected, virtual ]
~SFRHandler(Void);

SFRHandler::RegisterHandler
Register a handler.
[ public ]
SFCError RegisterHandler(
    HandlerEnum timing   // timing to be called
    SFRHandlerSPP spp    // function pointer for handler
    VoidPtr ref          // reference value
);
[ public ]
SFCError RegisterHandler(
    SFCEventEnum type    // event type
    HandlerEnum timing   // timing to be called
    SFRHandlerSPP spp    // function pointer for handler
    VoidPtr ref          // reference value
);
[ public ]
SFCError RegisterHandler(
    SFCEventEnum type    // event type
    UInt16 p16           // the first parameter
    HandlerEnum timing   // timing to be called
    SFRHandlerSPP spp    // function pointer for handler
    VoidPtr ref          // reference value
);
[ public ]
SFCError RegisterHandler(
    SFCEventEnum type    // event type
    UInt16 bp16          // beginning number of the first parameter
    UInt16 ep16          // end number of the first parameter
    HandlerEnum timing   // timing to be called
    SFRHandlerSPP spp    // function pointer for handler
    VoidPtr ref          // reference value
);
[ public ]
SFCError RegisterHandler(
    SFCEventEnum btype   // beginning number of the Event type
    SFCEventEnum etype   // end number of the Event type
    HandlerEnum timing   // timing to be called
    SFRHandlerSPP spp    // function pointer for handler
    VoidPtr ref          // reference value
);
[ public ]
SFCError RegisterHandler(
    SFCEventEnum btype     // beginning number of the Event type
    SFCEventEnum endType   // end number of the Event type
    UInt16 p16             // the first parameter
    HandlerEnum timing     // timing to be called
    SFRHandlerSPP spp      // function pointer for handler
    VoidPtr ref            // reference value
);
[ public, virtual ]
SFCError RegisterHandler(
    SFCEventEnum btype   // beginning number of the Event type
    SFCEventEnum etype   // end number of the Event type
    UInt16 bp16          // beginning number of the first parameter
    UInt16 ep16          // end number of the first parameter
    HandlerEnum timing   // timing to be called
    SFRHandlerSPP spp    // function pointer for handler
    VoidPtr ref          // reference value
);

Argument

timing

HANDLER_BEFORE or HANDLER_AFTER can be specified.

Reference information about constant : SFRHandler::HandlerEnum

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed: some error code other than SFERR_NO_ERROR

Reference

SFRHandler::UnregisterHandler


SFRHandler::SearchHandler
Search for the handler that matches the specified event.
[ protected, const ]
HandlerRecConstPtr SearchHandler(
    SFXEventConstRef event   // handler to search
    HandlerEnum timing       // timing to be called
);

SFRHandler::UnregisterHandler
Unregister the registered handler.
[ public ]
Void UnregisterHandler(
    HandlerEnum timing   // timing to be called
);
[ public ]
Void UnregisterHandler(
    SFCEventEnum type    // event type
    HandlerEnum timing   // timing to be called
);
[ public ]
Void UnregisterHandler(
    SFCEventEnum type    // event type
    UInt16 p16           // the first argument
    HandlerEnum timing   // timing to be called
);
[ public ]
Void UnregisterHandler(
    SFCEventEnum type    // event type
    UInt16 bgnP16        // the beginning number of first argument
    UInt16 endP16        // the end number of first argument
    HandlerEnum timing   // timing to be called
);
[ public ]
Void UnregisterHandler(
    SFCEventEnum bgnType   // the beginning number of event type
    SFCEventEnum endType   // the end number of event type
    HandlerEnum timing     // timing to be called
);
[ public ]
Void UnregisterHandler(
    SFCEventEnum bgnType   // the beginning number of event type
    SFCEventEnum endType   // the end number of event type
    UInt16 p16             // the first argument
    HandlerEnum timing     // timing to be called
);
[ public, virtual ]
Void UnregisterHandler(
    SFCEventEnum bgnType   // the beginning number of event type
    SFCEventEnum endType   // the end number of event type
    UInt16 bgnP16          // the beginning number of first argument
    UInt16 endP16          // the end number of first argument
    HandlerEnum timing     // timing to be called
);

Argument

timing

HANDLER_BEFORE or HANDLER_AFTER can be specified.

Detailed information on handler constant : SFRHandler::HandlerEnum

Reference

SFRHandler::RegisterHandler


SFRHandler::HandlerEnum
Constant that represents the timing to call the handler.
enum HandlerEnum{
  HANDLER_BEFORE = 0,  // before notifying child responders
  HANDLER_AFTER        // after notifying child responders
};

Description

HANDLER_BEFORE means to handle an event before notifying it to the child responders. HANDLER_AFTER means to handle an event after notifying it to the child responders.

Reference

SFRHandler::RegisterHandler


SFRHandler::HandlerRec
Structure of handler.
SFMTYPEDEFSTRUCT(HandlerRec)
friend  struct  HandlerRec;
struct HandlerRec {
    SFCEventEnum                btype;
    SFCEventEnum                etype;
    UInt16                      bp16;
    UInt16                      ep16;
    HandlerEnum                 timing;
    SFRHandlerSPP               spp;
    VoidPtr                     reference;
    HandlerRecPtr               next;
};

SFRHandler::SFRHandlerSPP
Type of the callback function.
typedef Bool(* SFRHandler::SFRHandlerSPP)(SFXEventConstRef event, VoidPtr reference)