Import Geant4 2.0.0 source tree
This commit is contained in:
@@ -5,57 +5,83 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIterminal.hh,v 1.3.4.1.2.2 1999/12/14 07:07:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
// $Id: G4UIterminal.hh,v 1.5 2000/03/26 23:03:48 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UIterminal_h
|
||||
#define G4UIterminal_h 1
|
||||
|
||||
#include "G4VBasicShell.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "g4std/fstream"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VBasicShell.hh"
|
||||
#include "G4VUIshell.hh"
|
||||
|
||||
// class description:
|
||||
//
|
||||
// This class inherits the class G4UIsession.
|
||||
// This is the class to use a character-terminal sesion.
|
||||
// Description:
|
||||
//
|
||||
// This class inherits the class G4UIsession.
|
||||
// This is the class to use a character-terminal sesion.
|
||||
//
|
||||
// Usage:
|
||||
// G4UIsession* terminalSession = new G4UIterminal;
|
||||
// or G4UIsession* terminalSession = new G4UIterminal(new your-shell);
|
||||
//
|
||||
// A character-terminal session "terminalSession" is instantiated.
|
||||
// G4cout stream is redirected by default to the constructed instance.
|
||||
//
|
||||
// terminalSession-> SessionStart(); // "terminalSession" is started.
|
||||
// delete terminalSession; // "terminalSession" is deleted.
|
||||
//
|
||||
//
|
||||
// In default(no arguments are given), csh-like shell is instantiated.
|
||||
// If you want to use another shell (e.g. tcsh-like), you can give
|
||||
// your favorite shell in an argument of the constructor.
|
||||
//
|
||||
// Which shell? / How to define your own shell?
|
||||
// Currently two kinds of shells,
|
||||
// G4UIcsh / G4UItcsh
|
||||
// , are presented.
|
||||
// They inherit the abstract base class, G4VUIshell.
|
||||
// In order to define your own shell,
|
||||
// - Define your own shell class derived from G4VUIshell.
|
||||
// - Implement GetCommandLine() method (pure virtual).
|
||||
// - Add more functionality, if need.
|
||||
//
|
||||
// For more detail, see source codes.
|
||||
//
|
||||
|
||||
class G4UIterminal : public G4VBasicShell
|
||||
{
|
||||
public: // with description
|
||||
G4UIterminal();
|
||||
~G4UIterminal();
|
||||
class G4UIterminal : public G4VBasicShell {
|
||||
private:
|
||||
G4UImanager* UI;
|
||||
// shell
|
||||
G4VUIshell* shell;
|
||||
|
||||
G4UIsession * SessionStart();
|
||||
// A character-terminal session "terminalSession" is instantiated.
|
||||
// G4cout stream is redirected by default to the constructed instance.
|
||||
// Usage: G4UIsession * terminalSession = new G4UIterminal;
|
||||
// "terminalSession" is started.
|
||||
// Usage: terminalSession->SessionStart();
|
||||
// "terminalSession" is deleted.
|
||||
// Usage: delete terminalSession;
|
||||
//
|
||||
void PauseSessionStart(G4String);
|
||||
G4int ReceiveG4cout(G4String coutString);
|
||||
G4int ReceiveG4cerr(G4String cerrString);
|
||||
// These methods are implementation of corresponding virtual methods
|
||||
// of G4UIsession class.
|
||||
private:
|
||||
G4UImanager * UI;
|
||||
G4String promptCharacter;
|
||||
G4bool iExit;
|
||||
G4bool iCont;
|
||||
// program states
|
||||
G4bool iExit;
|
||||
G4bool iCont;
|
||||
|
||||
public:
|
||||
G4UIterminal(G4VUIshell* aShell=0);
|
||||
~G4UIterminal();
|
||||
|
||||
void SetPrompt(const G4String& prompt);
|
||||
|
||||
private:
|
||||
void ExecuteCommand(G4String aCommand);
|
||||
G4String GetCommand();
|
||||
G4bool GetHelpChoice(G4int& aInt);
|
||||
void ExitHelp();
|
||||
|
||||
public:
|
||||
// These methods are implementation of corresponding virtual methods
|
||||
// of G4UIsession class.
|
||||
virtual G4UIsession* SessionStart();
|
||||
virtual void PauseSessionStart(G4String msg);
|
||||
virtual G4int ReceiveG4cout(G4String coutString);
|
||||
virtual G4int ReceiveG4cerr(G4String cerrString);
|
||||
|
||||
private:
|
||||
void ExecuteCommand(G4String);
|
||||
G4String GetCommand();
|
||||
G4bool GetHelpChoice(G4int&);
|
||||
void ExitHelp();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user