File indexing completed on 2025-01-18 09:57:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef G4AnalysisManagerState_h
0032 #define G4AnalysisManagerState_h 1
0033
0034 #include "G4AnalysisVerbose.hh"
0035 #include "G4Threading.hh"
0036 #include "globals.hh"
0037
0038 #include <string_view>
0039
0040 class G4AnalysisManagerState
0041 {
0042
0043 friend class G4VAnalysisManager;
0044 friend class G4VAnalysisReader;
0045 friend class G4ParameterManager;
0046
0047 public:
0048 G4AnalysisManagerState(G4String type, G4bool isMaster);
0049
0050 G4AnalysisManagerState() = delete;
0051 G4AnalysisManagerState(const G4AnalysisManagerState&) = delete;
0052 G4AnalysisManagerState& operator=(const G4AnalysisManagerState&) = delete;
0053
0054
0055 void Message([[maybe_unused]] G4int level,
0056 [[maybe_unused]] const G4String& action,
0057 [[maybe_unused]] const G4String& objectType,
0058 [[maybe_unused]] const G4String& objectName = "",
0059 [[maybe_unused]] G4bool success = true) const;
0060 void IncrementCycle();
0061 void ResetCycle();
0062
0063
0064 G4String GetType() const;
0065 G4String GetFileType() const;
0066 G4bool GetIsMaster() const;
0067 G4int GetThreadId() const;
0068 G4bool GetIsActivation() const;
0069 G4int GetVerboseLevel() const;
0070 G4bool IsVerbose(G4int verboseLevel) const;
0071 G4int GetCycle() const;
0072
0073 private:
0074
0075
0076 void SetIsActivation(G4bool isActivation);
0077 void SetVerboseLevel(G4int verboseLevel);
0078
0079
0080 static constexpr std::string_view fkClass { "G4AnalysisManagerState" };
0081
0082
0083 G4String fType;
0084 G4bool fIsMaster;
0085 G4int fThreadId { G4Threading::SEQUENTIAL_ID };
0086 G4bool fIsActivation { false };
0087 G4int fVerboseLevel { 0 };
0088 G4int fCycle { 0 };
0089 G4AnalysisVerbose fVerbose;
0090 };
0091
0092
0093
0094 inline void G4AnalysisManagerState::SetIsActivation(G4bool isActivation)
0095 { fIsActivation = isActivation; }
0096
0097 inline void G4AnalysisManagerState::IncrementCycle()
0098 { ++fCycle; }
0099
0100 inline void G4AnalysisManagerState::ResetCycle()
0101 { fCycle = 0; }
0102
0103 inline G4String G4AnalysisManagerState::GetType() const
0104 { return fType; }
0105
0106 inline G4String G4AnalysisManagerState::GetFileType() const
0107 { return G4StrUtil::to_lower_copy(fType); }
0108
0109 inline G4bool G4AnalysisManagerState::GetIsMaster() const
0110 { return fIsMaster; }
0111
0112 inline G4int G4AnalysisManagerState::GetThreadId() const
0113 { return fThreadId; }
0114
0115 inline G4bool G4AnalysisManagerState::GetIsActivation() const
0116 { return fIsActivation; }
0117
0118 inline G4int G4AnalysisManagerState::GetVerboseLevel() const
0119 { return fVerboseLevel; }
0120
0121 inline G4bool G4AnalysisManagerState::IsVerbose(G4int verboseLevel) const
0122 { return fVerboseLevel == verboseLevel; }
0123
0124 inline G4int G4AnalysisManagerState::GetCycle() const
0125 { return fCycle; }
0126
0127 #endif