Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4Verbose.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Geant4 Virtual Monte Carlo package
3// Copyright (C) 2007 - 2014 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
14
15#include "TG4Verbose.h"
16
17// static data members
19const G4String TG4Verbose::fgkDirectoryName = "/mcVerbose/";
20G4ThreadLocal G4int TG4Verbose::fgCounter = 0;
22
23//_____________________________________________________________________________
24TG4Verbose::TG4Verbose(const G4String& cmdName)
25 : fVerboseLevel(fgkDefaultVerboseLevel), fCommand(0)
26{
28
30
31 fCommand = fgMessenger->AddCommand(this, cmdName);
32
33 fgCounter++;
34}
35
36//_____________________________________________________________________________
37TG4Verbose::TG4Verbose(const G4String& cmdName, G4int verboseLevel)
38 : fVerboseLevel(verboseLevel), fCommand(0)
39{
41
43
44 fCommand = fgMessenger->AddCommand(this, cmdName);
45
46 fgCounter++;
47}
48
49//_____________________________________________________________________________
51{
53
54 // G4cout << "TG4Verbose::~TG4Verbose " << fgCounter << " " << this << G4endl;
55
56 fgCounter--;
57
58 if (!fgMessenger) return;
59
61 // fCommand is deleted by fgMessenger
62
63 if (fgCounter == 0) {
64 delete fgMessenger;
65 fgMessenger = 0;
66 }
67}
68
69//
70// private methods
71//
72
73//_____________________________________________________________________________
Definition of the TG4Verbose class.
Messenger class that defines commands for the verbose classes.
G4UIcommand * AddCommand(TG4Verbose *verbose, const G4String &cmdName)
void RemoveCommand(TG4Verbose *verbose, G4UIcommand *command)
TG4VerboseMessenger * CreateMessenger()
G4UIcommand * fCommand
verbose command
Definition TG4Verbose.h:67
TG4Verbose()
Not implemented.
static const G4String fgkDirectoryName
directory name
Definition TG4Verbose.h:61
static const G4int fgkDefaultVerboseLevel
default verbose level
Definition TG4Verbose.h:60
static G4ThreadLocal G4int fgCounter
object counter
Definition TG4Verbose.h:62
static G4ThreadLocal TG4VerboseMessenger * fgMessenger
messenger
Definition TG4Verbose.h:63
virtual ~TG4Verbose()