source: trunk/geant4/interfaces/html/G4UIGainServer_8hh-source.html @ 574

Last change on this file since 574 was 571, checked in by garnier, 17 years ago

r581@mac-90108: laurentgarnier | 2007-08-17 17:30:26 +0200
deplacement de frame

  • Property svn:mime-type set to text/html
File size: 17.5 KB
Line 
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&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;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>
900002 <span class="comment">// ********************************************************************</span>
1000003 <span class="comment">// * License and Disclaimer                                           *</span>
1100004 <span class="comment">// *                                                                  *</span>
1200005 <span class="comment">// * The  Geant4 software  is  copyright of the Copyright Holders  of *</span>
1300006 <span class="comment">// * the Geant4 Collaboration.  It is provided  under  the terms  and *</span>
1400007 <span class="comment">// * conditions of the Geant4 Software License,  included in the file *</span>
1500008 <span class="comment">// * LICENSE and available at  http://cern.ch/geant4/license .  These *</span>
1600009 <span class="comment">// * include a list of copyright holders.                             *</span>
1700010 <span class="comment">// *                                                                  *</span>
1800011 <span class="comment">// * Neither the authors of this software system, nor their employing *</span>
1900012 <span class="comment">// * institutes,nor the agencies providing financial support for this *</span>
2000013 <span class="comment">// * work  make  any representation or  warranty, express or implied, *</span>
2100014 <span class="comment">// * regarding  this  software system or assume any liability for its *</span>
2200015 <span class="comment">// * use.  Please see the license in the file  LICENSE  and URL above *</span>
2300016 <span class="comment">// * for the full disclaimer and the limitation of liability.         *</span>
2400017 <span class="comment">// *                                                                  *</span>
2500018 <span class="comment">// * This  code  implementation is the result of  the  scientific and *</span>
2600019 <span class="comment">// * technical work of the GEANT4 collaboration.                      *</span>
2700020 <span class="comment">// * By using,  copying,  modifying or  distributing the software (or *</span>
2800021 <span class="comment">// * any work based  on the software)  you  agree  to acknowledge its *</span>
2900022 <span class="comment">// * use  in  resulting  scientific  publications,  and indicate your *</span>
3000023 <span class="comment">// * acceptance of all terms of the Geant4 Software license.          *</span>
3100024 <span class="comment">// ********************************************************************</span>
3200025 <span class="comment">//</span>
3300026 <span class="comment">//</span>
3400027 <span class="comment">// $Id: G4UIGainServer.hh,v 1.5 2006/06/29 19:09:21 gunter Exp $</span>
3500028 <span class="comment">// $Name: geant4-08-01-patch-01 $</span>
3600029 <span class="comment">//</span>
3700030
3800031
3900032 <span class="preprocessor">#ifndef G4UIGainServer_h</span>
4000033 <span class="preprocessor"></span><span class="preprocessor">#define G4UIGainServer_h 1</span>
4100034 <span class="preprocessor"></span>
4200035 <span class="preprocessor">#ifndef WIN32</span>
4300036 <span class="preprocessor"></span>
4400037 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
4500038 <span class="preprocessor">#include &lt;sys/types.h&gt;</span>
4600039 <span class="preprocessor">#include &lt;sys/socket.h&gt;</span>
4700040 <span class="comment">//#include &lt;sys/un.h&gt;</span>
4800041 <span class="preprocessor">#include &lt;netinet/in.h&gt;</span>
4900042 <span class="preprocessor">#include &lt;unistd.h&gt;</span>
5000043
5100044 <span class="preprocessor">#include &lt;iostream&gt;</span>
5200045 <span class="preprocessor">#include &lt;fstream&gt;</span>
5300046 <span class="preprocessor">#include "globals.hh"</span>
5400047 <span class="preprocessor">#include "G4UImanager.hh"</span>
5500048 <span class="preprocessor">#include "<a class="code" href="G4VBasicShell_8hh.html">G4VBasicShell.hh</a>"</span>
5600049
5700050 <span class="preprocessor">#define SOCK_NAME "/tmp/socket"</span>
5800051 <span class="preprocessor"></span><span class="preprocessor">#define DEFAULT_PORT 40000; </span>
5900052 <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> };
6200055
6300056 <span class="comment">// class description:</span>
6400057 <span class="comment">//</span>
6500058 <span class="comment">// This class is similar to G4UIGAG.</span>
6600059 <span class="comment">// While G4UIGAG provides direct connection to GAG via pipe,</span>
6700060 <span class="comment">// G4UIGainServer provides socket connection to remote Gain client.</span>
6800061 <span class="comment">// Gain = Geant4 adaptive interface for network</span>
6900062 <span class="comment">// Its usage is same as G4UIGAG, except that Geant4 application waits</span>
7000063 <span class="comment">// a connection from a Gain client.</span>
7100064
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> {
7300066 <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>;
8000073
8100074   <span class="comment">// shell</span>
8200075   <span class="comment">//  G4VUIshell* shell;</span>
8300076
8400077   <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>;
8700080
8800081   <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];
9600089
9700090   <span class="comment">// --- the following are used by Notify*Update() and *Updated()</span>
9800091   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d0">GetNewTreeStructure</a>( G4UIcommandTree*,<span class="keywordtype">int</span> recursiveLevel);
9900092   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d1">GetNewTreeValues</a>( G4UIcommandTree*,<span class="keywordtype">int</span> recursiveLevel);
10000093   
101<a name="l00094"></a><a class="code" href="classG4UIGainServer.html#r15">00094</a>   std::vector&lt;G4String&gt; <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&lt;G4String&gt; <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&lt;G4String&gt; <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&lt;G4String&gt; <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&lt;G4UIcommand*&gt; <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&lt;G4UIcommand*&gt; <a class="code" href="classG4UIGainServer.html#r20">newTreePCP</a>;
10700100
10800101 <span class="keyword">public</span>:
10900102   <span class="comment">// These methods are implementation of corresponding virtual methods</span>
11000103   <span class="comment">// of G4UIsession class.</span>
11100104
11200105   <span class="comment">// A GainServer session  "gainSession" is instantiated.</span>
11300106   <span class="comment">// G4cout stream is redirected by default to the constructed instance.</span>
11400107   <span class="comment">// Usage:  G4UIsession * gainSession = new G4UIGainServer();</span>
11500108   <span class="comment">// "gainSession" is started.</span>
11600109   <span class="comment">// Usage: gainSession-&gt;SessionStart();</span>
11700110   <span class="comment">// "gainSession"  is deleted.</span>
11800111   <span class="comment">// Usage: delete gainSession;</span>
11900112   <span class="comment">//</span>
12000113
12100114
12200115    G4UIsession* <a class="code" href="classG4UIGainServer.html#a0">SessionStart</a>(); 
12300116    <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#a1">PauseSessionStart</a>(G4String msg);
12400117    G4int <a class="code" href="classG4UIGainServer.html#a2">ReceiveG4cout</a>(G4String coutString);
12500118    G4int <a class="code" href="classG4UIGainServer.html#a3">ReceiveG4cerr</a>(G4String cerrString);
12600119
12700120
12800121
12900122 <span class="keyword">public</span>:
13000123   <span class="comment">//  G4UIGainServer(G4VUIshell* aShell=0);</span>
13100124    <a class="code" href="classG4UIGainServer.html#a4">G4UIGainServer</a>();
13200125   <span class="comment">//G4UIGainServer(void){}</span>
13300126     <a class="code" href="classG4UIGainServer.html#a5">~G4UIGainServer</a>();
13400127   <span class="comment">//~G4UIGainServer(void){}</span>
13500128
13600129   <span class="comment">//  void SetPrompt(const G4String&amp; prompt);</span>
13700130   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#a6">SessionTerminate</a>();
13800131   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#a7">Prompt</a>(G4String);
13900132   G4String <a class="code" href="classG4UIGainServer.html#a8">GetCommand</a>();
14000133
14100134 <span class="keyword">private</span>:
14200135   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d2">ExecuteCommand</a>(G4String aCommand);
14300136   G4bool <a class="code" href="classG4UIGainServer.html#d3">GetHelpChoice</a>(G4int&amp; aInt);
14400137   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d4">ExitHelp</a>();
14500138   <span class="keywordtype">bool</span> <a class="code" href="classG4UIGainServer.html#d5">SetUPServer</a>();
14600139   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d6">WaitingConnection</a>();
14700140   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d7">CloseConnection</a>();
14800141
14900142   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d8">ChangeDirectory</a>(G4String);
15000143   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d9">ListDirectory</a>(G4String);
15100144   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d10">TerminalHelp</a>(G4String);
15200145   G4String <a class="code" href="classG4UIGainServer.html#d11">ModifyPrefix</a>(G4String);
15300146   G4UIcommandTree * <a class="code" href="classG4UIGainServer.html#d12">FindDirPath</a>(G4String);
15400147   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d13">ShowCurrent</a>(G4String);
15500148   G4String <a class="code" href="classG4UIGainServer.html#d14">GetFullPath</a>(G4String);
15600149
15700150   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d15">SendCommandProperties</a>(G4UIcommandTree *);
15800151   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d16">SendParameterProperties</a>(G4UIcommandTree *);
15900152   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d17">SendAParamProperty</a>(G4UIcommand *);
16000153   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d18">SendATclParamProperty</a>(G4UIcommand *);
16100154   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d19">CodeGenJavaTree</a>(G4UIcommandTree *,<span class="keywordtype">int</span> recursiveLevel);
16200155   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d20">CodeGenJavaParams</a>(G4UIcommandTree *,<span class="keywordtype">int</span> recursiveLevel);
16300156   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d21">CodeGenTclTree</a>(G4UIcommandTree *, <span class="keywordtype">int</span> recursiveLevel);
16400157   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d22">CodeGenTclParams</a>(G4UIcommandTree *, <span class="keywordtype">int</span> recursiveLevel);
16500158   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d23">SendDisableList</a>(G4UIcommandTree *, <span class="keywordtype">int</span> recursiveLevel);
16600159
16700160   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d24">NotifyStateChange</a>(<span class="keywordtype">void</span>);
16800161   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d25">NotifyCommandUpdate</a>(<span class="keywordtype">void</span>);
16900162   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d26">NotifyParameterUpdate</a>(G4UIcommand *);
17000163
17100164   <span class="keywordtype">int</span> <a class="code" href="classG4UIGainServer.html#d27">CommandUpdated</a>(<span class="keywordtype">void</span>);
17200165   <span class="keywordtype">void</span> <a class="code" href="classG4UIGainServer.html#d28">UpdateState</a>(<span class="keywordtype">void</span>);
17300166   <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>
17400167                              <span class="comment">// call NotifyParameterUpdate()</span>
17500168
17600169   
17700170 };
17800171
17900172 <span class="preprocessor">#endif</span>
18000173 <span class="preprocessor"></span>
18100174 <span class="preprocessor">#endif</span>
18200175 <span class="preprocessor"></span>
18300176
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>
Note: See TracBrowser for help on using the repository browser.