1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
---|
3 | <title>G4UIGainServer.hh Source File</title> |
---|
4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
5 | </head><body> |
---|
6 | <!-- Generated by Doxygen 1.3.4 --> |
---|
7 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div> |
---|
8 | <h1>G4UIGainServer.hh</h1><a href="G4UIGainServer_8hh.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">//</span> |
---|
9 | 00002 <span class="comment">// ********************************************************************</span> |
---|
10 | 00003 <span class="comment">// * License and Disclaimer *</span> |
---|
11 | 00004 <span class="comment">// * *</span> |
---|
12 | 00005 <span class="comment">// * The Geant4 software is copyright of the Copyright Holders of *</span> |
---|
13 | 00006 <span class="comment">// * the Geant4 Collaboration. It is provided under the terms and *</span> |
---|
14 | 00007 <span class="comment">// * conditions of the Geant4 Software License, included in the file *</span> |
---|
15 | 00008 <span class="comment">// * LICENSE and available at http://cern.ch/geant4/license . These *</span> |
---|
16 | 00009 <span class="comment">// * include a list of copyright holders. *</span> |
---|
17 | 00010 <span class="comment">// * *</span> |
---|
18 | 00011 <span class="comment">// * Neither the authors of this software system, nor their employing *</span> |
---|
19 | 00012 <span class="comment">// * institutes,nor the agencies providing financial support for this *</span> |
---|
20 | 00013 <span class="comment">// * work make any representation or warranty, express or implied, *</span> |
---|
21 | 00014 <span class="comment">// * regarding this software system or assume any liability for its *</span> |
---|
22 | 00015 <span class="comment">// * use. Please see the license in the file LICENSE and URL above *</span> |
---|
23 | 00016 <span class="comment">// * for the full disclaimer and the limitation of liability. *</span> |
---|
24 | 00017 <span class="comment">// * *</span> |
---|
25 | 00018 <span class="comment">// * This code implementation is the result of the scientific and *</span> |
---|
26 | 00019 <span class="comment">// * technical work of the GEANT4 collaboration. *</span> |
---|
27 | 00020 <span class="comment">// * By using, copying, modifying or distributing the software (or *</span> |
---|
28 | 00021 <span class="comment">// * any work based on the software) you agree to acknowledge its *</span> |
---|
29 | 00022 <span class="comment">// * use in resulting scientific publications, and indicate your *</span> |
---|
30 | 00023 <span class="comment">// * acceptance of all terms of the Geant4 Software license. *</span> |
---|
31 | 00024 <span class="comment">// ********************************************************************</span> |
---|
32 | 00025 <span class="comment">//</span> |
---|
33 | 00026 <span class="comment">//</span> |
---|
34 | 00027 <span class="comment">// $Id: G4UIGainServer.hh,v 1.5 2006/06/29 19:09:21 gunter Exp $</span> |
---|
35 | 00028 <span class="comment">// $Name: geant4-08-01-patch-01 $</span> |
---|
36 | 00029 <span class="comment">//</span> |
---|
37 | 00030 |
---|
38 | 00031 |
---|
39 | 00032 <span class="preprocessor">#ifndef G4UIGainServer_h</span> |
---|
40 | 00033 <span class="preprocessor"></span><span class="preprocessor">#define G4UIGainServer_h 1</span> |
---|
41 | 00034 <span class="preprocessor"></span> |
---|
42 | 00035 <span class="preprocessor">#ifndef WIN32</span> |
---|
43 | 00036 <span class="preprocessor"></span> |
---|
44 | 00037 <span class="preprocessor">#include <stdio.h></span> |
---|
45 | 00038 <span class="preprocessor">#include <sys/types.h></span> |
---|
46 | 00039 <span class="preprocessor">#include <sys/socket.h></span> |
---|
47 | 00040 <span class="comment">//#include <sys/un.h></span> |
---|
48 | 00041 <span class="preprocessor">#include <netinet/in.h></span> |
---|
49 | 00042 <span class="preprocessor">#include <unistd.h></span> |
---|
50 | 00043 |
---|
51 | 00044 <span class="preprocessor">#include <iostream></span> |
---|
52 | 00045 <span class="preprocessor">#include <fstream></span> |
---|
53 | 00046 <span class="preprocessor">#include "globals.hh"</span> |
---|
54 | 00047 <span class="preprocessor">#include "G4UImanager.hh"</span> |
---|
55 | 00048 <span class="preprocessor">#include "<a class="code" href="G4VBasicShell_8hh.html">G4VBasicShell.hh</a>"</span> |
---|
56 | 00049 |
---|
57 | 00050 <span class="preprocessor">#define SOCK_NAME "/tmp/socket"</span> |
---|
58 | 00051 <span class="preprocessor"></span><span class="preprocessor">#define DEFAULT_PORT 40000; </span> |
---|
59 | 00052 <span class="preprocessor"></span> |
---|
60 | <a name="l00053"></a><a class="code" href="G4UIGainServer_8hh.html#a7">00053</a> <span class="keyword">enum</span> <a class="code" href="G4UIGAG_8hh.html#a7">UImode</a> { <a class="code" href="G4UIGAG_8hh.html#a7a0">terminal_mode</a> , <a class="code" href="G4UIGAG_8hh.html#a7a1">java_mode</a>, <a class="code" href="G4UIGAG_8hh.html#a7a2">tcl_mode</a> }; |
---|
61 | <a name="l00054"></a><a class="code" href="G4UIGainServer_8hh.html#a8">00054</a> <span class="keyword">enum</span> <a class="code" href="G4UIGAG_8hh.html#a8">ChangeOfTree</a> { <a class="code" href="G4UIGAG_8hh.html#a8a3">notChanged</a>=0, <a class="code" href="G4UIGAG_8hh.html#a8a4">added</a>, <a class="code" href="G4UIGAG_8hh.html#a8a5">deleted</a>, <a class="code" href="G4UIGAG_8hh.html#a8a6">addedAndDeleted</a> }; |
---|
62 | 00055 |
---|
63 | 00056 <span class="comment">// class description:</span> |
---|
64 | 00057 <span class="comment">//</span> |
---|
65 | 00058 <span class="comment">// This class is similar to G4UIGAG.</span> |
---|
66 | 00059 <span class="comment">// While G4UIGAG provides direct connection to GAG via pipe,</span> |
---|
67 | 00060 <span class="comment">// G4UIGainServer provides socket connection to remote Gain client.</span> |
---|
68 | 00061 <span class="comment">// Gain = Geant4 adaptive interface for network</span> |
---|
69 | 00062 <span class="comment">// Its usage is same as G4UIGAG, except that Geant4 application waits</span> |
---|
70 | 00063 <span class="comment">// a connection from a Gain client.</span> |
---|
71 | 00064 |
---|
72 | <a name="l00065"></a><a class="code" href="classG4UIGainServer.html">00065</a> <span class="keyword">class </span><a class="code" href="classG4UIGainServer.html">G4UIGainServer</a> : <span class="keyword">public</span> <a class="code" href="classG4VBasicShell.html">G4VBasicShell</a> { |
---|
73 | 00066 <span class="keyword">private</span>: |
---|
74 | <a name="l00067"></a><a class="code" href="classG4UIGainServer.html#r0">00067</a> G4String <a class="code" href="classG4UIGainServer.html#r0">prefix</a>; |
---|
75 | <a name="l00068"></a><a class="code" href="classG4UIGainServer.html#r1">00068</a> G4String <a class="code" href="classG4UIGainServer.html#r1">promptCharacter</a>; |
---|
76 | <a name="l00069"></a><a class="code" href="classG4UIGainServer.html#r2">00069</a> G4UImanager* <a class="code" href="classG4UIGainServer.html#r2">UI</a>; |
---|
77 | <a name="l00070"></a><a class="code" href="classG4UIGainServer.html#r3">00070</a> <a class="code" href="G4UIGAG_8hh.html#a7">UImode</a> <a class="code" href="classG4UIGainServer.html#r3">uiMode</a>; |
---|
78 | <a name="l00071"></a><a class="code" href="classG4UIGainServer.html#r4">00071</a> G4String <a class="code" href="classG4UIGainServer.html#r4">JVersion</a>; |
---|
79 | <a name="l00072"></a><a class="code" href="classG4UIGainServer.html#r5">00072</a> G4String <a class="code" href="classG4UIGainServer.html#r5">TVersion</a>; |
---|
80 | 00073 |
---|
81 | 00074 <span class="comment">// shell</span> |
---|
82 | 00075 <span class="comment">// G4VUIshell* shell;</span> |
---|
83 | 00076 |
---|
84 | 00077 <span class="comment">// program states</span> |
---|
85 | <a name="l00078"></a><a class="code" href="classG4UIGainServer.html#r6">00078</a> G4bool <a class="code" href="classG4UIGainServer.html#r6">iExit</a>; |
---|
86 | <a name="l00079"></a><a class="code" href="classG4UIGainServer.html#r7">00079</a> G4bool <a class="code" href="classG4UIGainServer.html#r7">iCont</a>; |
---|
87 | 00080 |
---|
88 | 00081 <span class="comment">// need for socket</span> |
---|
89 | <a name="l00082"></a><a class="code" href="classG4UIGainServer.html#r8">00082</a> <span class="keywordtype">int</span> <a class="code" href="classG4UIGainServer.html#r8">socketD</a>[3]; |
---|
90 | <a name="l00083"></a><a class="code" href="classG4UIGainServer.html#r9">00083</a> <span class="keywordtype">int</span> <a class="code" href="classG4UIGainServer.html#r9">port</a>; |
---|
91 | <a name="l00084"></a><a class="code" href="classG4UIGainServer.html#r10">00084</a> <span class="keyword">struct </span>sockaddr_in saddr; |
---|
92 | <a name="l00085"></a><a class="code" href="classG4UIGainServer.html#r11">00085</a> <span class="keyword">struct </span>sockaddr_in caddr; |
---|
93 | <a name="l00086"></a><a class="code" href="classG4UIGainServer.html#r12">00086</a> <span class="keywordtype">int</span> <a class="code" href="classG4UIGainServer.html#r12">len</a>; |
---|
94 | <a name="l00087"></a><a class="code" href="classG4UIGainServer.html#r13">00087</a> <span class="keywordtype">int</span> <a class="code" href="classG4UIGainServer.html#r13">ret</a>; |
---|
95 | <a name="l00088"></a><a class="code" href="classG4UIGainServer.html#r14">00088</a> <span class="keywordtype">char</span> <a class="code" href="classG4UIGainServer.html#r14">buf</a>[1024]; |
---|
96 | 00089 |
---|
97 | 00090 <span class="comment">// --- the following are used by Notify*Update() and *Updated()</span> |
---|
98 | 00091 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d0">GetNewTreeStructure</a>( G4UIcommandTree*,<span class="keywordtype">int</span> recursiveLevel); |
---|
99 | 00092 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d1">GetNewTreeValues</a>( G4UIcommandTree*,<span class="keywordtype">int</span> recursiveLevel); |
---|
100 | 00093 |
---|
101 | <a name="l00094"></a><a class="code" href="classG4UIGainServer.html#r15">00094</a> std::vector<G4String> <a class="code" href="classG4UIGainServer.html#r15">previousTreeCommands</a>; |
---|
102 | <a name="l00095"></a><a class="code" href="classG4UIGainServer.html#r16">00095</a> std::vector<G4String> <a class="code" href="classG4UIGainServer.html#r16">newTreeCommands</a>; |
---|
103 | <a name="l00096"></a><a class="code" href="classG4UIGainServer.html#r17">00096</a> std::vector<G4String> <a class="code" href="classG4UIGainServer.html#r17">previousTreeParams</a>; |
---|
104 | <a name="l00097"></a><a class="code" href="classG4UIGainServer.html#r18">00097</a> std::vector<G4String> <a class="code" href="classG4UIGainServer.html#r18">newTreeParams</a>; |
---|
105 | <a name="l00098"></a><a class="code" href="classG4UIGainServer.html#r19">00098</a> std::vector<G4UIcommand*> <a class="code" href="classG4UIGainServer.html#r19">previousTreePCP</a>; |
---|
106 | <a name="l00099"></a><a class="code" href="classG4UIGainServer.html#r20">00099</a> std::vector<G4UIcommand*> <a class="code" href="classG4UIGainServer.html#r20">newTreePCP</a>; |
---|
107 | 00100 |
---|
108 | 00101 <span class="keyword">public</span>: |
---|
109 | 00102 <span class="comment">// These methods are implementation of corresponding virtual methods</span> |
---|
110 | 00103 <span class="comment">// of G4UIsession class.</span> |
---|
111 | 00104 |
---|
112 | 00105 <span class="comment">// A GainServer session "gainSession" is instantiated.</span> |
---|
113 | 00106 <span class="comment">// G4cout stream is redirected by default to the constructed instance.</span> |
---|
114 | 00107 <span class="comment">// Usage: G4UIsession * gainSession = new G4UIGainServer();</span> |
---|
115 | 00108 <span class="comment">// "gainSession" is started.</span> |
---|
116 | 00109 <span class="comment">// Usage: gainSession->SessionStart();</span> |
---|
117 | 00110 <span class="comment">// "gainSession" is deleted.</span> |
---|
118 | 00111 <span class="comment">// Usage: delete gainSession;</span> |
---|
119 | 00112 <span class="comment">//</span> |
---|
120 | 00113 |
---|
121 | 00114 |
---|
122 | 00115 G4UIsession* <a class="code" href="classG4UIGainServer.html#a0">SessionStart</a>(); |
---|
123 | 00116 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#a1">PauseSessionStart</a>(G4String msg); |
---|
124 | 00117 G4int <a class="code" href="classG4UIGainServer.html#a2">ReceiveG4cout</a>(G4String coutString); |
---|
125 | 00118 G4int <a class="code" href="classG4UIGainServer.html#a3">ReceiveG4cerr</a>(G4String cerrString); |
---|
126 | 00119 |
---|
127 | 00120 |
---|
128 | 00121 |
---|
129 | 00122 <span class="keyword">public</span>: |
---|
130 | 00123 <span class="comment">// G4UIGainServer(G4VUIshell* aShell=0);</span> |
---|
131 | 00124 <a class="code" href="classG4UIGainServer.html#a4">G4UIGainServer</a>(); |
---|
132 | 00125 <span class="comment">//G4UIGainServer(void){}</span> |
---|
133 | 00126 <a class="code" href="classG4UIGainServer.html#a5">~G4UIGainServer</a>(); |
---|
134 | 00127 <span class="comment">//~G4UIGainServer(void){}</span> |
---|
135 | 00128 |
---|
136 | 00129 <span class="comment">// void SetPrompt(const G4String& prompt);</span> |
---|
137 | 00130 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#a6">SessionTerminate</a>(); |
---|
138 | 00131 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#a7">Prompt</a>(G4String); |
---|
139 | 00132 G4String <a class="code" href="classG4UIGainServer.html#a8">GetCommand</a>(); |
---|
140 | 00133 |
---|
141 | 00134 <span class="keyword">private</span>: |
---|
142 | 00135 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d2">ExecuteCommand</a>(G4String aCommand); |
---|
143 | 00136 G4bool <a class="code" href="classG4UIGainServer.html#d3">GetHelpChoice</a>(G4int& aInt); |
---|
144 | 00137 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d4">ExitHelp</a>(); |
---|
145 | 00138 <span class="keywordtype">bool</span> <a class="code" href="classG4UIGainServer.html#d5">SetUPServer</a>(); |
---|
146 | 00139 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d6">WaitingConnection</a>(); |
---|
147 | 00140 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d7">CloseConnection</a>(); |
---|
148 | 00141 |
---|
149 | 00142 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d8">ChangeDirectory</a>(G4String); |
---|
150 | 00143 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d9">ListDirectory</a>(G4String); |
---|
151 | 00144 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d10">TerminalHelp</a>(G4String); |
---|
152 | 00145 G4String <a class="code" href="classG4UIGainServer.html#d11">ModifyPrefix</a>(G4String); |
---|
153 | 00146 G4UIcommandTree * <a class="code" href="classG4UIGainServer.html#d12">FindDirPath</a>(G4String); |
---|
154 | 00147 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d13">ShowCurrent</a>(G4String); |
---|
155 | 00148 G4String <a class="code" href="classG4UIGainServer.html#d14">GetFullPath</a>(G4String); |
---|
156 | 00149 |
---|
157 | 00150 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d15">SendCommandProperties</a>(G4UIcommandTree *); |
---|
158 | 00151 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d16">SendParameterProperties</a>(G4UIcommandTree *); |
---|
159 | 00152 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d17">SendAParamProperty</a>(G4UIcommand *); |
---|
160 | 00153 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d18">SendATclParamProperty</a>(G4UIcommand *); |
---|
161 | 00154 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d19">CodeGenJavaTree</a>(G4UIcommandTree *,<span class="keywordtype">int</span> recursiveLevel); |
---|
162 | 00155 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d20">CodeGenJavaParams</a>(G4UIcommandTree *,<span class="keywordtype">int</span> recursiveLevel); |
---|
163 | 00156 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d21">CodeGenTclTree</a>(G4UIcommandTree *, <span class="keywordtype">int</span> recursiveLevel); |
---|
164 | 00157 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d22">CodeGenTclParams</a>(G4UIcommandTree *, <span class="keywordtype">int</span> recursiveLevel); |
---|
165 | 00158 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d23">SendDisableList</a>(G4UIcommandTree *, <span class="keywordtype">int</span> recursiveLevel); |
---|
166 | 00159 |
---|
167 | 00160 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d24">NotifyStateChange</a>(<span class="keywordtype">void</span>); |
---|
168 | 00161 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d25">NotifyCommandUpdate</a>(<span class="keywordtype">void</span>); |
---|
169 | 00162 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d26">NotifyParameterUpdate</a>(G4UIcommand *); |
---|
170 | 00163 |
---|
171 | 00164 <span class="keywordtype">int</span> <a class="code" href="classG4UIGainServer.html#d27">CommandUpdated</a>(<span class="keywordtype">void</span>); |
---|
172 | 00165 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d28">UpdateState</a>(<span class="keywordtype">void</span>); |
---|
173 | 00166 <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d29">UpdateParamVal</a>(<span class="keywordtype">void</span>); <span class="comment">// if param is updated,</span> |
---|
174 | 00167 <span class="comment">// call NotifyParameterUpdate()</span> |
---|
175 | 00168 |
---|
176 | 00169 |
---|
177 | 00170 }; |
---|
178 | 00171 |
---|
179 | 00172 <span class="preprocessor">#endif</span> |
---|
180 | 00173 <span class="preprocessor"></span> |
---|
181 | 00174 <span class="preprocessor">#endif</span> |
---|
182 | 00175 <span class="preprocessor"></span> |
---|
183 | 00176 |
---|
184 | </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Jun 22 11:07:02 2007 by |
---|
185 | <a href="http://www.doxygen.org/index.html"> |
---|
186 | <img src="doxygen.png" alt="doxygen" align="middle" border=0 > |
---|
187 | </a>1.3.4 </small></address> |
---|
188 | </body> |
---|
189 | </html> |
---|