Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4UIcommandTree.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4UIcommandTree
0027 //
0028 // Class description:
0029 //
0030 // This class is exclusively used by G4UImanager for handling the
0031 // tree structure of the commands. The user MUST NOT construct/use
0032 // this class object
0033 
0034 // Author: Makoto Asai (SLAC), 1998
0035 // --------------------------------------------------------------------
0036 #ifndef G4UIcommandTree_hh
0037 #define G4UIcommandTree_hh 1
0038 
0039 #include "G4UIcommand.hh"
0040 #include "globals.hh"
0041 
0042 #include <vector>
0043 
0044 class G4UIcommandTree
0045 {
0046   public:
0047     G4UIcommandTree() = default;
0048     G4UIcommandTree(const char* thePathName);
0049 
0050     ~G4UIcommandTree();
0051 
0052     G4bool operator==(const G4UIcommandTree& right) const;
0053     G4bool operator!=(const G4UIcommandTree& right) const;
0054 
0055     void AddNewCommand(G4UIcommand* newCommand, G4bool workerThreadOnly = false);
0056     void RemoveCommand(G4UIcommand* aCommand, G4bool workerThreadOnly = false);
0057     G4UIcommand* FindPath(const char* commandPath) const;
0058     G4UIcommandTree* FindCommandTree(const char* commandPath);
0059     G4String GetFirstMatchedString(const G4String&, const G4String&) const;
0060 
0061     // Complete most available characters in common into command path in the
0062     // command line given
0063     G4String CompleteCommandPath(const G4String& commandPath);
0064 
0065     void List() const;
0066     void ListCurrent() const;
0067     void ListCurrentWithNum() const;
0068     void CreateHTML(const G4String& = "");
0069 
0070     inline const G4UIcommand* GetGuidance() const { return guidance; }
0071     inline const G4String& GetPathName() const { return pathName; }
0072     inline G4int GetTreeEntry() const { return G4int(tree.size()); }
0073     inline G4int GetCommandEntry() const { return G4int(command.size()); }
0074     inline G4UIcommandTree* GetTree(G4int i) { return tree[i - 1]; }
0075     G4UIcommandTree* GetTree(const char* comNameC);
0076     inline G4UIcommand* GetCommand(G4int i) { return command[i - 1]; }
0077     inline const G4String GetTitle() const
0078     {
0079       return (guidance == nullptr) ? G4String("...Title not available...") : guidance->GetTitle();
0080     }
0081 
0082   private:
0083     G4String CreateFileName(const char* pName);
0084     G4String ModStr(const char* strS);
0085 
0086   private:
0087     std::vector<G4UIcommand*> command;
0088     std::vector<G4UIcommandTree*> tree;
0089     G4UIcommand* guidance = nullptr;
0090     G4String pathName;
0091     G4bool broadcastCommands = true;
0092     G4bool ifSort = false;
0093     G4int createHTMLTreeLevel = 0;
0094 };
0095 
0096 #endif