01: /*
02: * VarTrace.java --
03: *
04: * Interface for creating variable traces.
05: *
06: * Copyright (c) 1997 Sun Microsystems, Inc.
07: *
08: * See the file "license.terms" for information on usage and
09: * redistribution of this file, and for a DISCLAIMER OF ALL
10: * WARRANTIES.
11: *
12: * RCS: @(#) $Id: VarTrace.java,v 1.1.1.1 1998/10/14 21:09:14 cvsadmin Exp $
13: *
14: */
15:
16: package tcl.lang;
17:
18: /*
19: * This interface is used to make variable traces. To make a variable
20: * trace, write a class that implements the VarTrace and call
21: * Interp.traceVar with an instance of that class.
22: *
23: */
24:
25: public interface VarTrace {
26:
27: /*
28: *----------------------------------------------------------------------
29: *
30: * traceProc --
31: *
32: * This function gets called when a variable is accessed.
33: *
34: * Results:
35: * None.
36: *
37: * Side effects:
38: * The traceProc can cause arbitrary side effects. If a
39: * TclException is thrown, error message is stored in the result
40: * of the interpreter.
41: *
42: *----------------------------------------------------------------------
43: */
44:
45: abstract public void traceProc(Interp interp, // Current interpreter.
46: String part1, // First part of the variable name.
47: String part2, // Second part of the var name. May be null.
48: int flags) // TCL.TRACE_READS, TCL.TRACE_WRITES or
49: // TCL.TRACE_UNSETS (exactly one of these
50: // bits will be set.)
51: throws TclException; // The traceProc may throw a TclException
52: // to indicate an error during the trace.
53:
54: } // end VarTrace
|