tcl.lang
Class ExecutionTrace

java.lang.Object
  extended by tcl.lang.ExecutionTrace

public class ExecutionTrace
extends Object

This class is used to trace command execution


Field Summary
protected  boolean deleted
          set to true if deleted, to prevent execution
static int ENTER
          Indicates an ExecutionTrace that will execute on a command entry
static int ENTERSTEP
          Indicates a ExecutionTrace that will execute on before each command in a command
static int LEAVE
          Indicates a ExecutionTrace that will execute on a command exit
static int LEAVESTEP
          Indicates a ExecutionTrace that will execute after each command in a command
protected  int type
          The type of trace, either ENTER, LEAVE, ENTERSTEP, or LEAVESTEP
 
Constructor Summary
ExecutionTrace(Interp interp, int type, TclObject callbackCmd)
          Create a new ExecutionTrace
 
Method Summary
 String getCallbackCmd()
           
 int getType()
           
 void setDeleted(boolean deleted)
           
 void trace(Interp interp, int type, String commandString, int resultCode, TclObject result)
          Call the callback function for this ExecutionTrace if it matches type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTER

public static final int ENTER
Indicates an ExecutionTrace that will execute on a command entry

See Also:
Constant Field Values

LEAVE

public static final int LEAVE
Indicates a ExecutionTrace that will execute on a command exit

See Also:
Constant Field Values

ENTERSTEP

public static final int ENTERSTEP
Indicates a ExecutionTrace that will execute on before each command in a command

See Also:
Constant Field Values

LEAVESTEP

public static final int LEAVESTEP
Indicates a ExecutionTrace that will execute after each command in a command

See Also:
Constant Field Values

type

protected int type
The type of trace, either ENTER, LEAVE, ENTERSTEP, or LEAVESTEP


deleted

protected boolean deleted
set to true if deleted, to prevent execution

Constructor Detail

ExecutionTrace

public ExecutionTrace(Interp interp,
                      int type,
                      TclObject callbackCmd)
               throws TclException
Create a new ExecutionTrace

Parameters:
type - either ENTER, LEAVE, ENTERSTEP, or LEAVESTEP
callbackCmd - command to execute when fired
Throws:
TclException
Method Detail

getType

public int getType()
Returns:
the type of this trace, either ENTER, LEAVE, ENTERSTEP, or LEAVESTEP

getCallbackCmd

public String getCallbackCmd()
Returns:
the callback command for this trace

setDeleted

public void setDeleted(boolean deleted)
Parameters:
deleted - if true, this trace will no longer be executed

trace

public void trace(Interp interp,
                  int type,
                  String commandString,
                  int resultCode,
                  TclObject result)
           throws TclException
Call the callback function for this ExecutionTrace if it matches type.

Parameters:
interp -
type - type of trace being executedeither ENTER, LEAVE, ENTERSTEP, or LEAVESTEP
commandString -
resultCode -
result -
Throws:
TclException


Copyright © 2015. All rights reserved.