/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/cmd/include/RAT/ProcBlockManager.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/cmd/include/RAT/ProcBlockManager.hh Source File
Ratpac-two
ProcBlockManager.hh
1 #ifndef __RAT_ProcBlockManager__
2 #define __RAT_ProcBlockManager__
3 
4 #include <G4String.hh>
5 #include <G4UImessenger.hh>
6 #include <RAT/ProcAllocator.hh>
7 #include <map>
8 #include <stack>
9 #include <string>
10 
11 namespace RAT {
12 
13 class ProcBlock;
14 class UserProcManager;
15 
16 class ProcBlockManager : public G4UImessenger {
17  public:
18  ProcBlockManager(ProcBlock *theMainBlock);
19  virtual ~ProcBlockManager();
20 
21  // override G4UImessenger methods to parse commands
22  virtual G4String GetCurrentValue(G4UIcommand *command);
23  virtual void SetNewValue(G4UIcommand *command, G4String newValue);
24 
25  // Methods implementing the commands
26  virtual bool DoProcCmd(std::string procname, bool last = false);
27  virtual void DoProcSetCmd(std::string cmdstring);
28 
29  // Processor Table
30  // template <class T> void AppendProcessor();
31  static std::map<std::string, ProcAllocator *> procAllocators;
32 
33  template <class T>
34  static void AppendProcessor() {
36  procAllocators[pa->operator()()->GetName()] = pa;
37  }
38 
39  protected:
40  ProcBlock *mainBlock; // Convenience, non-NULL when we are at the main
41  // block in analysis construction
42  std::stack<ProcBlock *> blocks;
43 
44  Processor *lastProc;
45 
46  // interface commands
47  G4UIcommand *procCmd;
48  G4UIcommand *procLastCmd;
49  G4UIcommand *setCmd;
50 };
51 
52 } // namespace RAT
53 
54 #endif
Definition: ProcAllocator.hh:58
Definition: ProcAllocator.hh:16
Definition: ProcBlockManager.hh:16
Definition: ProcBlock.hh:33
Definition: Processor.hh:36
Definition: CCCrossSecMessenger.hh:29