PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFYTracer
Class which manages the tracer.
#include <SFYTracer.h.hpp>
class SFYTracer;
SFMTYPEDEFCLASS(SFYTracer)

Collaboration diagram

 Collaboration diagram of SFYTracerClass

Description

This class manages a list of tracers. Some functions of this class are used only in the SFYDistributer class and the SFYResponder class and will not be used directly in the applet development.

Reference

Tracer | Distributer | Responder Tree | Root Responder | SFYResponder::RegisterTracer | SFYResponder::UnregisterTracer | SFYResponder::ClearTracer | SFYApplication::RegisterTracer | SFYApplication::UnregisterTracer | SFYApplication::ClearTracer | SFYDistributer | SFYResponder | SFYApplication | SFZRoot | SFXEvent | SFXEventRange

Member

Types
OrderEnum
Constants that represent the order to distribute an event to child responders.
RuleRec
Structure that represents the tracer rule of a processing order, a distributing condition, and an overloading condition.
StateEnum
Constants that represent the distributing condition to distribute an event to child responders.

SFYTracer::OrderEnum
Constants that represent the order to distribute an event to child responders.
enum OrderEnum {
    ORDER_FORWARD  = 0,    // distribute from foreground to background
    ORDER_BACKWARD         // distribute from background to foreground
};
SFMTYPEDEFTYPE(OrderEnum)

Description

These constants are used when calling the SFYDistributer::RegisterTracer, SFYApplication::RegisterTracer, or SFYResponder::RegisterTracer function.

Example

The code to register more than one rule into the tracer of a responder at a time is as follows:

static SFXEventRange::AtomRecConst range[] = {
    {     SFEVT_APP_START,    SFEVT_APP_START, SFP16_BEGIN, SFP16_END},
    {      SFEVT_APP_STOP,     SFEVT_APP_STOP, SFP16_BEGIN, SFP16_END},
    {    SFEVT_APP_RESUME,   SFEVT_APP_RESUME, SFP16_BEGIN, SFP16_END},
    {   SFEVT_APP_SUSPEND,  SFEVT_APP_SUSPEND, SFP16_BEGIN, SFP16_END}
};
static SFYTracer::RuleRecConst rule[lengthof(range)] = {
    {  SFYTracer::ORDER_BACKWARD,      SFYTracer::STATE_ALL,        true},
    {   SFYTracer::ORDER_FORWARD,      SFYTracer::STATE_ALL,        true},
    {  SFYTracer::ORDER_BACKWARD,      SFYTracer::STATE_ALL,        true},
    {   SFYTracer::ORDER_FORWARD,      SFYTracer::STATE_ALL,        true}
};
SFCError error;

error = RegisterTracer(atomic_cast(range), rule, lengthof(range));

Reference

SFYDistributer::RegisterTracer | SFYResponder::RegisterTracer | SFYApplication::RegisterTracer


SFYTracer::RuleRec
Structure that represents the tracer rule of a processing order, a distributing condition, and an overloading condition.
SFMTYPEDEFSTRUCT(RuleRec)
struct RuleRec {
    OrderEnum    order;       // processing order
    StateEnum    state;       // dispatching condition
    Bool         overload;    // overloading condition
};

Description

This structure is used when calling the SFYDistributer::RegisterTracer, SFYApplication::RegisterTracer, or SFYResponder::RegisterTracer function.

Example

The code to register more than one rule into the tracer of a responder at a time is as follows:

static SFXEventRange::AtomRecConst range[] = {
    {     SFEVT_APP_START,    SFEVT_APP_START, SFP16_BEGIN, SFP16_END},
    {      SFEVT_APP_STOP,     SFEVT_APP_STOP, SFP16_BEGIN, SFP16_END},
    {    SFEVT_APP_RESUME,   SFEVT_APP_RESUME, SFP16_BEGIN, SFP16_END},
    {   SFEVT_APP_SUSPEND,  SFEVT_APP_SUSPEND, SFP16_BEGIN, SFP16_END}
};
static SFYTracer::RuleRecConst rule[lengthof(range)] = {
    {  SFYTracer::ORDER_BACKWARD,      SFYTracer::STATE_ALL,        true},
    {   SFYTracer::ORDER_FORWARD,      SFYTracer::STATE_ALL,        true},
    {  SFYTracer::ORDER_BACKWARD,      SFYTracer::STATE_ALL,        true},
    {   SFYTracer::ORDER_FORWARD,      SFYTracer::STATE_ALL,        true}
};
SFCError error;

error = RegisterTracer(atomic_cast(range), rule, lengthof(range));

Reference

SFYDistributer::RegisterTracer | SFYResponder::RegisterTracer | SFYApplication::RegisterTracer


SFYTracer::StateEnum
Constants that represent the distributing condition to distribute an event to child responders.
enum StateEnum {
    STATE_ALL     = 0,    // distribute event to all valid child responders
    STATE_VISIBLE,        // distribute event to visible child responders
    STATE_ACTIVE,         // distribute event to visible and active child responders
    STATE_ENABLE,         // distribute event to visible, active, and enable child responders 
    STATE_FOCUS,          // distribute event to visible, active, enable, and focus child responders
    STATE_NONE            // distribute event to no child responder
};
SFMTYPEDEFTYPE(StateEnum)

Description

These constants are used when calling the SFYDistributer::RegisterTracer, SFYApplication::RegisterTracer, or SFYResponder::RegisterTracer function.

Example

The code to register more than one rule into the tracer of a responder at a time is as follows:

static SFXEventRange::AtomRecConst range[] = {
    {     SFEVT_APP_START,    SFEVT_APP_START, SFP16_BEGIN, SFP16_END},
    {      SFEVT_APP_STOP,     SFEVT_APP_STOP, SFP16_BEGIN, SFP16_END},
    {    SFEVT_APP_RESUME,   SFEVT_APP_RESUME, SFP16_BEGIN, SFP16_END},
    {   SFEVT_APP_SUSPEND,  SFEVT_APP_SUSPEND, SFP16_BEGIN, SFP16_END}
};
static SFYTracer::RuleRecConst rule[lengthof(range)] = {
    {  SFYTracer::ORDER_BACKWARD,      SFYTracer::STATE_ALL,        true},
    {   SFYTracer::ORDER_FORWARD,      SFYTracer::STATE_ALL,        true},
    {  SFYTracer::ORDER_BACKWARD,      SFYTracer::STATE_ALL,        true},
    {   SFYTracer::ORDER_FORWARD,      SFYTracer::STATE_ALL,        true}
};
SFCError error;

error = RegisterTracer(atomic_cast(range), rule, lengthof(range));

Reference

SFYDistributer::RegisterTracer | SFYResponder::RegisterTracer | SFYApplication::RegisterTracer