wasCSharpSQLite – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* |
2 | * WrappedCommand.java |
||
3 | * |
||
4 | * Wrapper for commands located inside a Jacl interp. |
||
5 | * |
||
6 | * Copyright (c) 1999 Mo DeJong. |
||
7 | * |
||
8 | * See the file "license.terms" for information on usage and |
||
9 | * redistribution of this file, and for a DISCLAIMER OF ALL |
||
10 | * WARRANTIES. |
||
11 | * |
||
12 | * Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart |
||
13 | * |
||
14 | * RCS @(#) $Id: WrappedCommand.java,v 1.2 1999/08/05 03:42:05 mo Exp $ |
||
15 | */ |
||
16 | using System.Collections; |
||
17 | using System.Text; |
||
18 | |||
19 | namespace tcl.lang |
||
20 | { |
||
21 | |||
22 | /// <summary> A Wrapped Command is like the Command struct defined in the C version |
||
23 | /// in the file generic/tclInt.h. It is "wrapped" around a TclJava Command |
||
24 | /// interface reference. We need to wrap Command references so that we |
||
25 | /// can keep track of sticky issues like what namespace the command is |
||
26 | /// defined in without requiring that every implementation of a Command |
||
27 | /// interface provide method to do this. This class is only used in |
||
28 | /// the internal implementation of Jacl. |
||
29 | /// </summary> |
||
30 | |||
31 | public class WrappedCommand |
||
32 | { |
||
33 | internal Hashtable table; // Reference to the table that this command is |
||
34 | // defined inside. The hashKey member can be |
||
35 | // used to lookup this CommandWrapper instance |
||
36 | // in the table of CommandWrappers. The table |
||
37 | // member combined with the hashKey member are |
||
38 | // are equivilent to the C version's Command->hPtr. |
||
39 | internal string hashKey; // A string that stores the name of the command. |
||
40 | // This name is NOT fully qualified. |
||
41 | |||
42 | |||
43 | internal NamespaceCmd.Namespace ns; // The namespace where the command is located |
||
44 | |||
45 | internal Command cmd; // The actual Command interface that we are wrapping. |
||
46 | |||
47 | internal bool deleted; // Means that the command is in the process |
||
48 | // of being deleted. Other attempts to |
||
49 | // delete the command should be ignored. |
||
50 | |||
51 | internal ImportRef importRef; // List of each imported Command created in |
||
52 | // another namespace when this command is |
||
53 | // imported. These imported commands |
||
54 | // redirect invocations back to this |
||
55 | // command. The list is used to remove all |
||
56 | // those imported commands when deleting |
||
57 | // this "real" command. |
||
58 | |||
59 | internal Interp.dxObjCmdProc objProc;//cmdPtr->objProc = proc; |
||
60 | public object objClientData;//cmdPtr->objClientData = clientData; |
||
61 | //internal TclInvokeObjectCommand proc; //cmdPtr.proc = TclInvokeObjectCommand; |
||
62 | internal object clientData;//cmdPtr->clientData = (ClientData)cmdPtr; |
||
63 | internal Interp.dxCmdDeleteProc deleteProc;//cmdPtr->deleteProc = deleteProc; |
||
64 | internal object deleteData;//cmdPtr->deleteData = clientData; |
||
65 | internal int flags;//cmdPtr->flags = 0; |
||
66 | |||
67 | public override string ToString() |
||
68 | { |
||
69 | StringBuilder sb = new StringBuilder(); |
||
70 | |||
71 | sb.Append( "Wrapper for " ); |
||
72 | if ( ns != null ) |
||
73 | { |
||
74 | sb.Append( ns.fullName ); |
||
75 | if ( ns.fullName != "::" ) |
||
76 | { |
||
77 | sb.Append( "::" ); |
||
78 | } |
||
79 | } |
||
80 | if ( table != null ) |
||
81 | { |
||
82 | sb.Append( hashKey ); |
||
83 | } |
||
84 | |||
85 | sb.Append( " -> " ); |
||
86 | sb.Append( cmd.GetType().FullName ); |
||
87 | |||
88 | return sb.ToString(); |
||
89 | } |
||
90 | } |
||
91 | } |