1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
3 | <title>G4UIterminal.hh Source File</title> |
---|
4 | <link href="../../doxygen.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="../../tabs.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.5.2 --> |
---|
8 | <div class="tabs"> |
---|
9 | <ul> |
---|
10 | <li><a href="../../index.html"><span>Main Page</span></a></li> |
---|
11 | <li><a href="../../annotated.html"><span>Classes</span></a></li> |
---|
12 | <li class="current"><a href="../../files.html"><span>Files</span></a></li> |
---|
13 | </ul> |
---|
14 | </div> |
---|
15 | <div class="tabs"> |
---|
16 | <ul> |
---|
17 | <li><a href="../../files.html"><span>File List</span></a></li> |
---|
18 | <li><a href="../../globals.html"><span>File Members</span></a></li> |
---|
19 | </ul> |
---|
20 | </div> |
---|
21 | <h1>G4UIterminal.hh</h1><a href="../../d6/dc9/G4UIterminal_8hh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span> |
---|
22 | <a name="l00002"></a>00002 <span class="comment">// ********************************************************************</span> |
---|
23 | <a name="l00003"></a>00003 <span class="comment">// * License and Disclaimer *</span> |
---|
24 | <a name="l00004"></a>00004 <span class="comment">// * *</span> |
---|
25 | <a name="l00005"></a>00005 <span class="comment">// * The Geant4 software is copyright of the Copyright Holders of *</span> |
---|
26 | <a name="l00006"></a>00006 <span class="comment">// * the Geant4 Collaboration. It is provided under the terms and *</span> |
---|
27 | <a name="l00007"></a>00007 <span class="comment">// * conditions of the Geant4 Software License, included in the file *</span> |
---|
28 | <a name="l00008"></a>00008 <span class="comment">// * LICENSE and available at http://cern.ch/geant4/license . These *</span> |
---|
29 | <a name="l00009"></a>00009 <span class="comment">// * include a list of copyright holders. *</span> |
---|
30 | <a name="l00010"></a>00010 <span class="comment">// * *</span> |
---|
31 | <a name="l00011"></a>00011 <span class="comment">// * Neither the authors of this software system, nor their employing *</span> |
---|
32 | <a name="l00012"></a>00012 <span class="comment">// * institutes,nor the agencies providing financial support for this *</span> |
---|
33 | <a name="l00013"></a>00013 <span class="comment">// * work make any representation or warranty, express or implied, *</span> |
---|
34 | <a name="l00014"></a>00014 <span class="comment">// * regarding this software system or assume any liability for its *</span> |
---|
35 | <a name="l00015"></a>00015 <span class="comment">// * use. Please see the license in the file LICENSE and URL above *</span> |
---|
36 | <a name="l00016"></a>00016 <span class="comment">// * for the full disclaimer and the limitation of liability. *</span> |
---|
37 | <a name="l00017"></a>00017 <span class="comment">// * *</span> |
---|
38 | <a name="l00018"></a>00018 <span class="comment">// * This code implementation is the result of the scientific and *</span> |
---|
39 | <a name="l00019"></a>00019 <span class="comment">// * technical work of the GEANT4 collaboration. *</span> |
---|
40 | <a name="l00020"></a>00020 <span class="comment">// * By using, copying, modifying or distributing the software (or *</span> |
---|
41 | <a name="l00021"></a>00021 <span class="comment">// * any work based on the software) you agree to acknowledge its *</span> |
---|
42 | <a name="l00022"></a>00022 <span class="comment">// * use in resulting scientific publications, and indicate your *</span> |
---|
43 | <a name="l00023"></a>00023 <span class="comment">// * acceptance of all terms of the Geant4 Software license. *</span> |
---|
44 | <a name="l00024"></a>00024 <span class="comment">// ********************************************************************</span> |
---|
45 | <a name="l00025"></a>00025 <span class="comment">//</span> |
---|
46 | <a name="l00026"></a>00026 <span class="comment">//</span> |
---|
47 | <a name="l00027"></a>00027 <span class="comment">// $Id: G4UIterminal.hh,v 1.9 2006/06/29 19:09:39 gunter Exp $</span> |
---|
48 | <a name="l00028"></a>00028 <span class="comment">// GEANT4 tag $Name: geant4-08-01-patch-01 $</span> |
---|
49 | <a name="l00029"></a>00029 <span class="comment">//</span> |
---|
50 | <a name="l00030"></a>00030 |
---|
51 | <a name="l00031"></a>00031 <span class="preprocessor">#ifndef G4UIterminal_h</span> |
---|
52 | <a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define G4UIterminal_h 1</span> |
---|
53 | <a name="l00033"></a>00033 <span class="preprocessor"></span> |
---|
54 | <a name="l00034"></a>00034 <span class="preprocessor">#include <fstream></span> |
---|
55 | <a name="l00035"></a>00035 <span class="preprocessor">#include "G4UImanager.hh"</span> |
---|
56 | <a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="../../d5/d17/G4VBasicShell_8hh.html">G4VBasicShell.hh</a>"</span> |
---|
57 | <a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="../../d0/d35/G4VUIshell_8hh.html">G4VUIshell.hh</a>"</span> |
---|
58 | <a name="l00038"></a>00038 |
---|
59 | <a name="l00039"></a>00039 <span class="comment">//</span> |
---|
60 | <a name="l00040"></a>00040 <span class="comment">// Description:</span> |
---|
61 | <a name="l00041"></a>00041 <span class="comment">//</span> |
---|
62 | <a name="l00042"></a>00042 <span class="comment">// This class inherits the class G4UIsession.</span> |
---|
63 | <a name="l00043"></a>00043 <span class="comment">// This is the class to use a character-terminal sesion.</span> |
---|
64 | <a name="l00044"></a>00044 <span class="comment">//</span> |
---|
65 | <a name="l00045"></a>00045 <span class="comment">// Usage: </span> |
---|
66 | <a name="l00046"></a>00046 <span class="comment">// G4UIsession* terminalSession = new G4UIterminal; </span> |
---|
67 | <a name="l00047"></a>00047 <span class="comment">// or G4UIsession* terminalSession = new G4UIterminal(new your-shell); </span> |
---|
68 | <a name="l00048"></a>00048 <span class="comment">//</span> |
---|
69 | <a name="l00049"></a>00049 <span class="comment">// A character-terminal session "terminalSession" is instantiated.</span> |
---|
70 | <a name="l00050"></a>00050 <span class="comment">// G4cout stream is redirected by default to the constructed instance.</span> |
---|
71 | <a name="l00051"></a>00051 <span class="comment">//</span> |
---|
72 | <a name="l00052"></a>00052 <span class="comment">// terminalSession-> SessionStart(); // "terminalSession" is started.</span> |
---|
73 | <a name="l00053"></a>00053 <span class="comment">// delete terminalSession; // "terminalSession" is deleted.</span> |
---|
74 | <a name="l00054"></a>00054 <span class="comment">//</span> |
---|
75 | <a name="l00055"></a>00055 <span class="comment">//</span> |
---|
76 | <a name="l00056"></a>00056 <span class="comment">// In default(no arguments are given), csh-like shell is instantiated.</span> |
---|
77 | <a name="l00057"></a>00057 <span class="comment">// If you want to use another shell (e.g. tcsh-like), you can give</span> |
---|
78 | <a name="l00058"></a>00058 <span class="comment">// your favorite shell in an argument of the constructor.</span> |
---|
79 | <a name="l00059"></a>00059 <span class="comment">//</span> |
---|
80 | <a name="l00060"></a>00060 <span class="comment">// Which shell? / How to define your own shell?</span> |
---|
81 | <a name="l00061"></a>00061 <span class="comment">// Currently two kinds of shells,</span> |
---|
82 | <a name="l00062"></a>00062 <span class="comment">// G4UIcsh / G4UItcsh</span> |
---|
83 | <a name="l00063"></a>00063 <span class="comment">// , are presented. </span> |
---|
84 | <a name="l00064"></a>00064 <span class="comment">// They inherit the abstract base class, G4VUIshell.</span> |
---|
85 | <a name="l00065"></a>00065 <span class="comment">// In order to define your own shell, </span> |
---|
86 | <a name="l00066"></a>00066 <span class="comment">// - Define your own shell class derived from G4VUIshell.</span> |
---|
87 | <a name="l00067"></a>00067 <span class="comment">// - Implement GetCommandLine() method (pure virtual).</span> |
---|
88 | <a name="l00068"></a>00068 <span class="comment">// - Add more functionality, if need.</span> |
---|
89 | <a name="l00069"></a>00069 <span class="comment">//</span> |
---|
90 | <a name="l00070"></a>00070 <span class="comment">// For more detail, see source codes.</span> |
---|
91 | <a name="l00071"></a>00071 <span class="comment">//</span> |
---|
92 | <a name="l00072"></a>00072 |
---|
93 | <a name="l00073"></a><a class="code" href="../../d5/de9/classG4UIterminal.html">00073</a> <span class="keyword">class </span><a class="code" href="../../d5/de9/classG4UIterminal.html">G4UIterminal</a> : <span class="keyword">public</span> <a class="code" href="../../df/dda/classG4VBasicShell.html">G4VBasicShell</a> { |
---|
94 | <a name="l00074"></a>00074 <span class="keyword">private</span>: |
---|
95 | <a name="l00075"></a><a class="code" href="../../d5/de9/classG4UIterminal.html#b5d2b2c6ca65f151a8d602c16423134f">00075</a> G4UImanager* <a class="code" href="../../d5/de9/classG4UIterminal.html#b5d2b2c6ca65f151a8d602c16423134f">UI</a>; |
---|
96 | <a name="l00076"></a>00076 <span class="comment">// shell</span> |
---|
97 | <a name="l00077"></a><a class="code" href="../../d5/de9/classG4UIterminal.html#0db0839b95f753fa8282d98ec03598d0">00077</a> <a class="code" href="../../d8/def/classG4VUIshell.html">G4VUIshell</a>* <a class="code" href="../../d5/de9/classG4UIterminal.html#0db0839b95f753fa8282d98ec03598d0">shell</a>; |
---|
98 | <a name="l00078"></a>00078 |
---|
99 | <a name="l00079"></a>00079 <span class="comment">// program states</span> |
---|
100 | <a name="l00080"></a><a class="code" href="../../d5/de9/classG4UIterminal.html#13c0977d38f7e8fde0be956945297826">00080</a> G4bool <a class="code" href="../../d5/de9/classG4UIterminal.html#13c0977d38f7e8fde0be956945297826">iExit</a>; |
---|
101 | <a name="l00081"></a><a class="code" href="../../d5/de9/classG4UIterminal.html#f577f59dfd11c04d5612a787fb3823f9">00081</a> G4bool <a class="code" href="../../d5/de9/classG4UIterminal.html#f577f59dfd11c04d5612a787fb3823f9">iCont</a>; |
---|
102 | <a name="l00082"></a>00082 |
---|
103 | <a name="l00083"></a>00083 <span class="keyword">public</span>: |
---|
104 | <a name="l00084"></a>00084 <a class="code" href="../../d5/de9/classG4UIterminal.html#f0bb1198e44907a633f98cee27c105b8">G4UIterminal</a>(<a class="code" href="../../d8/def/classG4VUIshell.html">G4VUIshell</a>* aShell=0); |
---|
105 | <a name="l00085"></a>00085 <a class="code" href="../../d5/de9/classG4UIterminal.html#eea79875933b66856cef01244c991b23">~G4UIterminal</a>(); |
---|
106 | <a name="l00086"></a>00086 |
---|
107 | <a name="l00087"></a>00087 <span class="keywordtype">void</span> <a class="code" href="../../d5/de9/classG4UIterminal.html#192fdfb70096193288ffe8fe7c88c03b">SetPrompt</a>(<span class="keyword">const</span> G4String& prompt); |
---|
108 | <a name="l00088"></a>00088 |
---|
109 | <a name="l00089"></a>00089 <span class="keyword">private</span>: |
---|
110 | <a name="l00090"></a>00090 <span class="keywordtype">void</span> <a class="code" href="../../d5/de9/classG4UIterminal.html#b9558ab11c9297e4a6232e269555072a">ExecuteCommand</a>(G4String aCommand); |
---|
111 | <a name="l00091"></a>00091 G4String <a class="code" href="../../d5/de9/classG4UIterminal.html#9ab530970c8dfaaad9bb770c9bd286ed">GetCommand</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* msg=0); |
---|
112 | <a name="l00092"></a>00092 G4bool <a class="code" href="../../d5/de9/classG4UIterminal.html#8619b86dd801f72bafa8aa10278f5cf0">GetHelpChoice</a>(G4int& aInt); |
---|
113 | <a name="l00093"></a>00093 <span class="keywordtype">void</span> <a class="code" href="../../d5/de9/classG4UIterminal.html#90f9b0146688805e0e60fe3816875f2f">ExitHelp</a>(); |
---|
114 | <a name="l00094"></a>00094 |
---|
115 | <a name="l00095"></a>00095 <span class="keyword">public</span>: |
---|
116 | <a name="l00096"></a>00096 <span class="comment">// These methods are implementation of corresponding virtual methods</span> |
---|
117 | <a name="l00097"></a>00097 <span class="comment">// of G4UIsession class.</span> |
---|
118 | <a name="l00098"></a>00098 <span class="keyword">virtual</span> G4UIsession* <a class="code" href="../../d5/de9/classG4UIterminal.html#c3e2a5e4cfd9ad72ac872864bb3f5563">SessionStart</a>(); |
---|
119 | <a name="l00099"></a>00099 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../d5/de9/classG4UIterminal.html#ce3c2b295dc8cf80acc8e83ea43d0645">PauseSessionStart</a>(G4String msg); |
---|
120 | <a name="l00100"></a>00100 <span class="keyword">virtual</span> G4int <a class="code" href="../../d5/de9/classG4UIterminal.html#ceb230fa5de124dcf80534a90de59727">ReceiveG4cout</a>(G4String coutString); |
---|
121 | <a name="l00101"></a>00101 <span class="keyword">virtual</span> G4int <a class="code" href="../../d5/de9/classG4UIterminal.html#dff335fa5d50e294fdd104efd0afa193">ReceiveG4cerr</a>(G4String cerrString); |
---|
122 | <a name="l00102"></a>00102 |
---|
123 | <a name="l00103"></a>00103 }; |
---|
124 | <a name="l00104"></a>00104 |
---|
125 | <a name="l00105"></a>00105 <span class="preprocessor">#endif</span> |
---|
126 | <a name="l00106"></a>00106 <span class="preprocessor"></span> |
---|
127 | </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jun 22 10:26:03 2007 by |
---|
128 | <a href="http://www.doxygen.org/index.html"> |
---|
129 | <img src="../../doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address> |
---|
130 | </body> |
---|
131 | </html> |
---|