Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UIcommandTree Class Reference

#include <G4UIcommandTree.hh>

Public Member Functions

 G4UIcommandTree ()
 
 G4UIcommandTree (const char *thePathName)
 
 ~G4UIcommandTree ()
 
G4bool operator== (const G4UIcommandTree &right) const
 
G4bool operator!= (const G4UIcommandTree &right) const
 
void AddNewCommand (G4UIcommand *newCommand, G4bool workerThreadOnly=false)
 
void RemoveCommand (G4UIcommand *aCommand, G4bool workerThreadOnly=false)
 
G4UIcommandFindPath (const char *commandPath) const
 
G4UIcommandTreeFindCommandTree (const char *commandPath)
 
G4String GetFirstMatchedString (const G4String &, const G4String &) const
 
G4String CompleteCommandPath (const G4String &commandPath)
 
void List () const
 
void ListCurrent () const
 
void ListCurrentWithNum () const
 
void CreateHTML ()
 
const G4UIcommandGetGuidance () const
 
const G4StringGetPathName () const
 
G4int GetTreeEntry () const
 
G4int GetCommandEntry () const
 
G4UIcommandTreeGetTree (G4int i)
 
G4UIcommandTreeGetTree (const char *comNameC)
 
G4UIcommandGetCommand (G4int i)
 
const G4String GetTitle () const
 

Detailed Description

Definition at line 44 of file G4UIcommandTree.hh.

Constructor & Destructor Documentation

◆ G4UIcommandTree() [1/2]

G4UIcommandTree::G4UIcommandTree ( )

Definition at line 37 of file G4UIcommandTree.cc.

38{
39}

Referenced by AddNewCommand().

◆ G4UIcommandTree() [2/2]

G4UIcommandTree::G4UIcommandTree ( const char *  thePathName)

Definition at line 42 of file G4UIcommandTree.cc.

43{
44 pathName = thePathName;
45}

◆ ~G4UIcommandTree()

G4UIcommandTree::~G4UIcommandTree ( )

Definition at line 48 of file G4UIcommandTree.cc.

49{
50 G4int i;
51 G4int n_treeEntry = tree.size();
52 for(i = 0; i < n_treeEntry; ++i)
53 {
54 delete tree[i];
55 }
56}
int G4int
Definition: G4Types.hh:85

Member Function Documentation

◆ AddNewCommand()

void G4UIcommandTree::AddNewCommand ( G4UIcommand newCommand,
G4bool  workerThreadOnly = false 
)

Definition at line 71 of file G4UIcommandTree.cc.

73{
74 G4String commandPath = newCommand->GetCommandPath();
75 G4String remainingPath = commandPath;
76 remainingPath.remove(0, pathName.length());
77 if(remainingPath.isNull())
78 {
79 if(!guidance)
80 {
81 guidance = newCommand;
82 if(!(newCommand->ToBeBroadcasted()))
83 broadcastCommands = false;
84 if(workerThreadOnly)
85 newCommand->SetWorkerThreadOnly();
86 }
87 return;
88 }
89 G4int i = remainingPath.first('/');
90 if(i == G4int(std::string::npos))
91 {
92 // Find command
93 G4int n_commandEntry = command.size();
94 for(G4int i_thCommand = 0; i_thCommand < n_commandEntry; ++i_thCommand)
95 {
96 if(remainingPath == command[i_thCommand]->GetCommandName())
97 {
98 return;
99 }
100 }
101 if(!broadcastCommands)
102 newCommand->SetToBeBroadcasted(false);
103 if(workerThreadOnly)
104 newCommand->SetWorkerThreadOnly();
105 command.push_back(newCommand);
106 return;
107 }
108 else
109 {
110 // Find path
111 G4String nextPath = pathName;
112 nextPath.append(remainingPath(0, i + 1));
113 G4int n_treeEntry = tree.size();
114 for(G4int i_thTree = 0; i_thTree < n_treeEntry; ++i_thTree)
115 {
116 if(nextPath == tree[i_thTree]->GetPathName())
117 {
118 if(!broadcastCommands)
119 newCommand->SetToBeBroadcasted(false);
120 tree[i_thTree]->AddNewCommand(newCommand, workerThreadOnly);
121 return;
122 }
123 }
124 G4UIcommandTree* newTree = new G4UIcommandTree(nextPath);
125 tree.push_back(newTree);
126 if(!broadcastCommands)
127 newCommand->SetToBeBroadcasted(false);
128 newTree->AddNewCommand(newCommand, workerThreadOnly);
129 return;
130 }
131}
G4String & remove(str_size)
G4String & append(const G4String &)
G4bool isNull() const
std::size_t first(char) const
const G4String & GetPathName() const
void AddNewCommand(G4UIcommand *newCommand, G4bool workerThreadOnly=false)
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:172
G4bool ToBeBroadcasted() const
Definition: G4UIcommand.hh:173
const G4String & GetCommandPath() const
Definition: G4UIcommand.hh:136
void SetWorkerThreadOnly(G4bool val=true)
Definition: G4UIcommand.hh:176

Referenced by G4UImanager::AddNewCommand(), and AddNewCommand().

◆ CompleteCommandPath()

G4String G4UIcommandTree::CompleteCommandPath ( const G4String commandPath)

Definition at line 269 of file G4UIcommandTree.cc.

270{
271 G4String pName = aCommandPath;
272 G4String remainingPath = aCommandPath;
273 G4String empty = "";
274 G4String matchingPath = empty;
275
276 // find the tree
277 G4int jpre = pName.last('/');
278 if(jpre != G4int(G4String::npos))
279 pName.remove(jpre + 1);
280 G4UIcommandTree* aTree = FindCommandTree(pName);
281
282 if(!aTree)
283 {
284 return empty;
285 }
286
287 if(pName.index(pName) == std::string::npos)
288 return empty;
289
290 std::vector<G4String> paths;
291
292 // list matched directories/commands
293 G4String strtmp;
294 G4int nMatch = 0;
295
296 G4int Ndir = aTree->GetTreeEntry();
297 G4int Ncmd = aTree->GetCommandEntry();
298
299 // directory ...
300 for(G4int idir = 1; idir <= Ndir; ++idir)
301 {
302 G4String fpdir = aTree->GetTree(idir)->GetPathName();
303 // matching test
304 if(fpdir.index(remainingPath, 0) == 0)
305 {
306 if(nMatch == 0)
307 {
308 matchingPath = fpdir;
309 }
310 else
311 {
312 matchingPath = GetFirstMatchedString(fpdir, matchingPath);
313 }
314 ++nMatch;
315 paths.push_back(fpdir);
316 }
317 }
318
319 if(paths.size() >= 2)
320 {
321 G4cout << "Matching directories :" << G4endl;
322 for(unsigned int i_thCommand = 0; i_thCommand < paths.size(); ++i_thCommand)
323 {
324 G4cout << paths[i_thCommand] << G4endl;
325 }
326 }
327
328 // command ...
329 std::vector<G4String> commands;
330
331 for(G4int icmd = 1; icmd <= Ncmd; ++icmd)
332 {
333 G4String fpcmd =
334 aTree->GetPathName() + aTree->GetCommand(icmd)->GetCommandName();
335 // matching test
336 if(fpcmd.index(remainingPath, 0) == 0)
337 {
338 if(nMatch == 0)
339 {
340 matchingPath = fpcmd + " ";
341 }
342 else
343 {
344 strtmp = fpcmd + " ";
345 matchingPath = GetFirstMatchedString(matchingPath, strtmp);
346 }
347 nMatch++;
348 commands.push_back(fpcmd + " ");
349 }
350 }
351
352 if(commands.size() >= 2)
353 {
354 G4cout << "Matching commands :" << G4endl;
355 for(unsigned int i_thCommand = 0; i_thCommand < commands.size();
356 ++i_thCommand)
357 {
358 G4cout << commands[i_thCommand] << G4endl;
359 }
360 }
361
362 return matchingPath;
363}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
str_size index(const char *, G4int pos=0) const
std::size_t last(char) const
G4int GetCommandEntry() const
G4UIcommand * GetCommand(G4int i)
G4int GetTreeEntry() const
G4UIcommandTree * GetTree(G4int i)
G4UIcommandTree * FindCommandTree(const char *commandPath)
G4String GetFirstMatchedString(const G4String &, const G4String &) const
const G4String & GetCommandName() const
Definition: G4UIcommand.hh:137

◆ CreateHTML()

void G4UIcommandTree::CreateHTML ( )

Definition at line 510 of file G4UIcommandTree.cc.

511{
512 G4String ofileName = CreateFileName(pathName);
513 std::ofstream oF(ofileName, std::ios::out);
514
515 oF << "<html><head><title>Commands in " << ModStr(pathName)
516 << "</title></head>" << G4endl;
517 oF << "<body bgcolor=\"#ffffff\"><h2>" << ModStr(pathName) << "</h2><p>"
518 << G4endl;
519
520 if(guidance != nullptr)
521 {
522 for(std::size_t i = 0; i < guidance->GetGuidanceEntries(); ++i)
523 {
524 oF << ModStr(guidance->GetGuidanceLine(i)) << "<br>" << G4endl;
525 }
526 }
527
528 oF << "<p><hr><p>" << G4endl;
529
530 oF << "<h2>Sub-directories : </h2><dl>" << G4endl;
531 for(std::size_t i_thTree = 0; i_thTree < tree.size(); ++i_thTree)
532 {
533 oF << "<p><br><p><dt><a href=\""
534 << CreateFileName(tree[i_thTree]->GetPathName()) << "\">"
535 << ModStr(tree[i_thTree]->GetPathName()) << "</a>" << G4endl;
536 oF << "<p><dd>" << ModStr(tree[i_thTree]->GetTitle()) << G4endl;
537 tree[i_thTree]->CreateHTML();
538 }
539
540 oF << "</dl><p><hr><p>" << G4endl;
541
542 oF << "<h2>Commands : </h2><dl>" << G4endl;
543 for(std::size_t i_thCommand = 0; i_thCommand < command.size(); ++i_thCommand)
544 {
545 G4UIcommand* cmd = command[i_thCommand];
546 oF << "<p><br><p><dt><b>" << ModStr(cmd->GetCommandName());
547 if(cmd->GetParameterEntries() > 0)
548 {
549 for(std::size_t i_thParam = 0; i_thParam < cmd->GetParameterEntries();
550 ++i_thParam)
551 {
552 oF << " [<i>"
553 << ModStr(cmd->GetParameter(i_thParam)->GetParameterName())
554 << "</i>]";
555 }
556 }
557 oF << "</b>" << G4endl;
558 oF << "<p><dd>" << G4endl;
559 for(std::size_t i = 0; i < cmd->GetGuidanceEntries(); ++i)
560 {
561 oF << ModStr(cmd->GetGuidanceLine(i)) << "<br>" << G4endl;
562 }
563 if(!(cmd->GetRange()).isNull())
564 {
565 oF << "<p><dd>Range : " << ModStr(cmd->GetRange()) << G4endl;
566 }
567 std::vector<G4ApplicationState>* availabelStateList = cmd->GetStateList();
568 if(availabelStateList->size() == 6)
569 {
570 oF << "<p><dd>Available at all Geant4 states." << G4endl;
571 }
572 else
573 {
574 oF << "<p><dd>Available Geant4 state(s) : ";
575 for(std::size_t ias = 0; ias < availabelStateList->size(); ++ias)
576 {
578 (*availabelStateList)[ias])
579 << " " << G4endl;
580 }
581 }
582 if(cmd->GetParameterEntries() > 0)
583 {
584 oF << "<p><dd>Parameters<table border=1>" << G4endl;
585 for(std::size_t i_thParam = 0; i_thParam < cmd->GetParameterEntries();
586 ++i_thParam)
587 {
588 G4UIparameter* prm = cmd->GetParameter(i_thParam);
589 oF << "<tr><td>" << ModStr(prm->GetParameterName()) << G4endl;
590 oF << "<td>type " << prm->GetParameterType() << G4endl;
591 oF << "<td>";
592 if(prm->IsOmittable())
593 {
594 oF << "Omittable : ";
595 if(prm->GetCurrentAsDefault())
596 {
597 oF << "current value is used as the default value." << G4endl;
598 }
599 else
600 {
601 oF << "default value = " << prm->GetDefaultValue() << G4endl;
602 }
603 }
604 oF << "<td>";
605 if(!(prm->GetParameterRange()).isNull())
606 {
607 oF << "Parameter range : " << ModStr(prm->GetParameterRange())
608 << G4endl;
609 }
610 else if(!(prm->GetParameterCandidates()).isNull())
611 {
612 oF << "Parameter candidates : "
613 << ModStr(prm->GetParameterCandidates()) << G4endl;
614 }
615 }
616 oF << "</table>" << G4endl;
617 }
618 }
619
620 oF << "</dl></body></html>" << G4endl;
621 oF.close();
622}
G4String GetStateString(const G4ApplicationState &aState) const
static G4StateManager * GetStateManager()
const G4String GetTitle() const
std::size_t GetParameterEntries() const
Definition: G4UIcommand.hh:138
const G4String & GetGuidanceLine(G4int i) const
Definition: G4UIcommand.hh:132
G4UIparameter * GetParameter(G4int i) const
Definition: G4UIcommand.hh:139
std::size_t GetGuidanceEntries() const
Definition: G4UIcommand.hh:128
std::vector< G4ApplicationState > * GetStateList()
Definition: G4UIcommand.hh:140
const G4String & GetRange() const
Definition: G4UIcommand.hh:127
const G4String & GetParameterCandidates() const
G4bool IsOmittable() const
const G4String & GetParameterRange() const
G4bool GetCurrentAsDefault() const
char GetParameterType() const
const G4String & GetParameterName() const
const G4String & GetDefaultValue() const

Referenced by G4UImanager::CreateHTML().

◆ FindCommandTree()

G4UIcommandTree * G4UIcommandTree::FindCommandTree ( const char *  commandPath)

Definition at line 230 of file G4UIcommandTree.cc.

231{
232 // Try to match a command or a path with the one given.
233 // @commandPath : command or path to match
234 // @return the commandTree found or nullptr if not
235
236 G4String remainingPath = commandPath;
237 if(remainingPath.index(pathName) == std::string::npos)
238 {
239 return nullptr;
240 }
241 remainingPath.remove(0, pathName.length());
242 G4int i = remainingPath.first('/');
243 if(i != G4int(std::string::npos))
244 {
245 // Find path
246 G4String nextPath = pathName;
247 nextPath.append(remainingPath(0, i + 1));
248 G4int n_treeEntry = tree.size();
249 for(G4int i_thTree = 0; i_thTree < n_treeEntry; ++i_thTree)
250 {
251 if(tree[i_thTree]->GetPathName() == commandPath)
252 {
253 return tree[i_thTree];
254 }
255 else if(nextPath == tree[i_thTree]->GetPathName())
256 {
257 return tree[i_thTree]->FindCommandTree(commandPath);
258 }
259 }
260 }
261 else
262 {
263 return this;
264 }
265 return nullptr;
266}

Referenced by CompleteCommandPath(), and G4UImessenger::CreateDirectory().

◆ FindPath()

G4UIcommand * G4UIcommandTree::FindPath ( const char *  commandPath) const

Definition at line 189 of file G4UIcommandTree.cc.

190{
191 // This function tries to match a command name
192
193 G4String remainingPath = commandPath;
194 if(remainingPath.index(pathName) == std::string::npos)
195 {
196 return nullptr;
197 }
198 remainingPath.remove(0, pathName.length());
199 G4int i = remainingPath.first('/');
200 if(i == G4int(std::string::npos))
201 {
202 // Find command
203 G4int n_commandEntry = command.size();
204 for(G4int i_thCommand = 0; i_thCommand < n_commandEntry; ++i_thCommand)
205 {
206 if(remainingPath == command[i_thCommand]->GetCommandName())
207 {
208 return command[i_thCommand];
209 }
210 }
211 }
212 else
213 {
214 // Find path
215 G4String nextPath = pathName;
216 nextPath.append(remainingPath(0, i + 1));
217 G4int n_treeEntry = tree.size();
218 for(G4int i_thTree = 0; i_thTree < n_treeEntry; ++i_thTree)
219 {
220 if(nextPath == tree[i_thTree]->GetPathName())
221 {
222 return tree[i_thTree]->FindPath(commandPath);
223 }
224 }
225 }
226 return nullptr;
227}

Referenced by G4UImanager::ApplyCommand(), G4CascadeParamMessenger::CreateDirectory(), G4VBasicShell::FindCommand(), G4VisCommandDrawLogicalVolume::G4VisCommandDrawLogicalVolume(), G4VisCommandDrawVolume::G4VisCommandDrawVolume(), G4VisCommandSceneAddMagneticField::G4VisCommandSceneAddMagneticField(), G4UImanager::GetCurrentValues(), and G4VBasicShell::TerminalHelp().

◆ GetCommand()

G4UIcommand * G4UIcommandTree::GetCommand ( G4int  i)
inline

Definition at line 77 of file G4UIcommandTree.hh.

77{ return command[i - 1]; }

Referenced by CompleteCommandPath(), and G4VBasicShell::TerminalHelp().

◆ GetCommandEntry()

G4int G4UIcommandTree::GetCommandEntry ( ) const
inline

Definition at line 74 of file G4UIcommandTree.hh.

74{ return G4int(command.size()); }

Referenced by CompleteCommandPath().

◆ GetFirstMatchedString()

G4String G4UIcommandTree::GetFirstMatchedString ( const G4String str1,
const G4String str2 
) const

Definition at line 366 of file G4UIcommandTree.cc.

368{
369 G4int nlen1 = str1.length();
370 G4int nlen2 = str2.length();
371
372 G4int nmin = nlen1 < nlen2 ? nlen1 : nlen2;
373
374 G4String strMatched;
375 for(size_t i = 0; G4int(i) < nmin; ++i)
376 {
377 if(str1[i] == str2[i])
378 {
379 strMatched += str1[i];
380 }
381 else
382 {
383 break;
384 }
385 }
386
387 return strMatched;
388}

Referenced by CompleteCommandPath().

◆ GetGuidance()

const G4UIcommand * G4UIcommandTree::GetGuidance ( ) const
inline

Definition at line 71 of file G4UIcommandTree.hh.

71{ return guidance; }

Referenced by ListCurrent().

◆ GetPathName()

const G4String & G4UIcommandTree::GetPathName ( ) const
inline

◆ GetTitle()

const G4String G4UIcommandTree::GetTitle ( ) const
inline

Definition at line 78 of file G4UIcommandTree.hh.

79 {
80 return (guidance == nullptr) ? G4String("...Title not available...")
81 : guidance->GetTitle();
82 }

Referenced by CreateHTML().

◆ GetTree() [1/2]

G4UIcommandTree * G4UIcommandTree::GetTree ( const char *  comNameC)

Definition at line 625 of file G4UIcommandTree.cc.

626{
627 G4String comName = comNameC;
628 for(std::size_t i = 0; i < tree.size(); ++i)
629 {
630 if(comName == tree[i]->GetPathName())
631 {
632 return tree[i];
633 }
634 }
635 return nullptr;
636}

◆ GetTree() [2/2]

G4UIcommandTree * G4UIcommandTree::GetTree ( G4int  i)
inline

Definition at line 75 of file G4UIcommandTree.hh.

75{ return tree[i - 1]; }

Referenced by CompleteCommandPath(), G4VBasicShell::FindDirectory(), and G4VBasicShell::TerminalHelp().

◆ GetTreeEntry()

G4int G4UIcommandTree::GetTreeEntry ( ) const
inline

Definition at line 73 of file G4UIcommandTree.hh.

73{ return G4int(tree.size()); }

Referenced by CompleteCommandPath(), and G4VBasicShell::TerminalHelp().

◆ List()

void G4UIcommandTree::List ( ) const

Definition at line 455 of file G4UIcommandTree.cc.

456{
457 ListCurrent();
458 G4int n_commandEntry = command.size();
459 for(G4int i_thCommand = 0; i_thCommand < n_commandEntry; ++i_thCommand)
460 {
461 command[i_thCommand]->List();
462 }
463 G4int n_treeEntry = tree.size();
464 for(G4int i_thTree = 0; i_thTree < n_treeEntry; ++i_thTree)
465 {
466 tree[i_thTree]->List();
467 }
468}
void ListCurrent() const

Referenced by G4UImanager::ListCommands().

◆ ListCurrent()

void G4UIcommandTree::ListCurrent ( ) const

Definition at line 391 of file G4UIcommandTree.cc.

392{
393 G4cout << "Command directory path : " << pathName << G4endl;
394 if(guidance != nullptr)
395 guidance->List();
396 G4cout << " Sub-directories : " << G4endl;
397 G4int n_treeEntry = tree.size();
398 for(G4int i_thTree = 0; i_thTree < n_treeEntry; ++i_thTree)
399 {
400 G4cout << " " << tree[i_thTree]->GetPathName();
401 if(tree[i_thTree]->GetGuidance() &&
402 tree[i_thTree]->GetGuidance()->IsWorkerThreadOnly())
403 {
404 G4cout << " @ ";
405 }
406 else
407 {
408 G4cout << " ";
409 }
410 G4cout << tree[i_thTree]->GetTitle() << G4endl;
411 }
412 G4cout << " Commands : " << G4endl;
413 G4int n_commandEntry = command.size();
414 for(G4int i_thCommand = 0; i_thCommand < n_commandEntry; ++i_thCommand)
415 {
416 G4cout << " " << command[i_thCommand]->GetCommandName();
417 if(command[i_thCommand]->IsWorkerThreadOnly())
418 {
419 G4cout << " @ ";
420 }
421 else
422 {
423 G4cout << " * ";
424 }
425 G4cout << command[i_thCommand]->GetTitle() << G4endl;
426 }
427}
const G4UIcommand * GetGuidance() const
virtual void List()
Definition: G4UIcommand.cc:395

Referenced by List(), and G4VBasicShell::ListDirectory().

◆ ListCurrentWithNum()

void G4UIcommandTree::ListCurrentWithNum ( ) const

Definition at line 430 of file G4UIcommandTree.cc.

431{
432 G4cout << "Command directory path : " << pathName << G4endl;
433 if(guidance != nullptr)
434 guidance->List();
435 G4int i = 0;
436 G4cout << " Sub-directories : " << G4endl;
437 G4int n_treeEntry = tree.size();
438 for(G4int i_thTree = 0; i_thTree < n_treeEntry; ++i_thTree)
439 {
440 ++i;
441 G4cout << " " << i << ") " << tree[i_thTree]->GetPathName() << " "
442 << tree[i_thTree]->GetTitle() << G4endl;
443 }
444 G4cout << " Commands : " << G4endl;
445 G4int n_commandEntry = command.size();
446 for(G4int i_thCommand = 0; i_thCommand < n_commandEntry; ++i_thCommand)
447 {
448 ++i;
449 G4cout << " " << i << ") " << command[i_thCommand]->GetCommandName()
450 << " * " << command[i_thCommand]->GetTitle() << G4endl;
451 }
452}

Referenced by G4VBasicShell::TerminalHelp().

◆ operator!=()

G4bool G4UIcommandTree::operator!= ( const G4UIcommandTree right) const

Definition at line 65 of file G4UIcommandTree.cc.

66{
67 return (pathName != right.GetPathName());
68}

◆ operator==()

G4bool G4UIcommandTree::operator== ( const G4UIcommandTree right) const

Definition at line 59 of file G4UIcommandTree.cc.

60{
61 return (pathName == right.GetPathName());
62}

◆ RemoveCommand()

void G4UIcommandTree::RemoveCommand ( G4UIcommand aCommand,
G4bool  workerThreadOnly = false 
)

Definition at line 134 of file G4UIcommandTree.cc.

136{
137 if(workerThreadOnly && !(aCommand->IsWorkerThreadOnly()))
138 return;
139 G4String commandPath = aCommand->GetCommandPath();
140 G4String remainingPath = commandPath;
141 remainingPath.remove(0, pathName.length());
142 if(remainingPath.isNull())
143 {
144 guidance = nullptr;
145 }
146 else
147 {
148 G4int i = remainingPath.first('/');
149 if(i == G4int(std::string::npos))
150 {
151 // Find command
152 G4int n_commandEntry = command.size();
153 for(G4int i_thCommand = 0; i_thCommand < n_commandEntry; ++i_thCommand)
154 {
155 if(remainingPath == command[i_thCommand]->GetCommandName())
156 {
157 command.erase(command.begin() + i_thCommand);
158 break;
159 }
160 }
161 }
162 else
163 {
164 // Find path
165 G4String nextPath = pathName;
166 nextPath.append(remainingPath(0, i + 1));
167 G4int n_treeEntry = tree.size();
168 for(G4int i_thTree = 0; i_thTree < n_treeEntry; ++i_thTree)
169 {
170 if(nextPath == tree[i_thTree]->GetPathName())
171 {
172 tree[i_thTree]->RemoveCommand(aCommand);
173 G4int n_commandRemain = tree[i_thTree]->GetCommandEntry();
174 G4int n_treeRemain = tree[i_thTree]->GetTreeEntry();
175 if(n_commandRemain == 0 && n_treeRemain == 0)
176 {
177 G4UIcommandTree* emptyTree = tree[i_thTree];
178 tree.erase(tree.begin() + i_thTree);
179 delete emptyTree;
180 }
181 break;
182 }
183 }
184 }
185 }
186}
G4bool IsWorkerThreadOnly() const
Definition: G4UIcommand.hh:177

Referenced by G4UImanager::RemoveCommand().


The documentation for this class was generated from the following files: