|
|
|||
File indexing completed on 2026-08-30 08:51:57
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 // 0027 0028 #ifndef G4ATTCHECK_HH 0029 #define G4ATTCHECK_HH 0030 0031 // Class Description: 0032 // 0033 // @class G4AttCheck 0034 // 0035 // @brief Checks G4AttValue's and their corresponding G4AttDef map. 0036 // 0037 // Usage (a): G4AttCheck(values,definitions); 0038 // or (b): G4cout << G4AttCheck(values,definitions) << G4endl; 0039 // 0040 // @author J.Allison 0041 // @author J.Perl 0042 // Class Description - End: 0043 0044 #include "globals.hh" 0045 0046 #include <set> 0047 #include <vector> 0048 #include <map> 0049 #include <iostream> 0050 0051 class G4AttValue; 0052 class G4AttDef; 0053 0054 class G4AttCheck { 0055 0056 public: // With description 0057 0058 G4AttCheck 0059 (const std::vector<G4AttValue>* values, 0060 const std::map<G4String,G4AttDef>* definitions); 0061 0062 ~G4AttCheck() = default; 0063 0064 const std::vector<G4AttValue>* GetAttValues() const { 0065 return fpValues; 0066 } 0067 0068 const std::map<G4String,G4AttDef>* GetAttDefs() const { 0069 return fpDefinitions; 0070 } 0071 0072 G4bool Check(const G4String& leader = "") const; 0073 // Check only. Silent unless error - then G4cerr. Returns error. 0074 // Provide leader, e.g., name of calling function. 0075 0076 G4bool Standard 0077 (std::vector<G4AttValue>* standardValues, 0078 std::map<G4String,G4AttDef>* standardDefinitions) 0079 const; 0080 // Places standard versions in provided containers and returns error. 0081 0082 friend std::ostream& operator<< (std::ostream&, const G4AttCheck&); 0083 0084 private: 0085 0086 void AddValuesAndDefs 0087 (std::vector<G4AttValue>* newValues, 0088 std::map<G4String,G4AttDef>* newDefinitions, 0089 const G4String& oldName, 0090 const G4String& name, 0091 const G4String& value, 0092 const G4String& extra, 0093 const G4String& description = "") const; // Utility function for Standard. 0094 0095 void Init(); // Initialises maps and sets 0096 0097 const std::vector<G4AttValue>* fpValues; 0098 const std::map<G4String,G4AttDef>* fpDefinitions; 0099 0100 static G4ThreadLocal G4bool fFirst; // Flag for initialising the following containers. 0101 static G4ThreadLocal std::set<G4String> *fUnitCategories; // Set of legal unit categories. 0102 static G4ThreadLocal std::map<G4String,G4String> *fStandardUnits; // Standard units. 0103 static G4ThreadLocal std::set<G4String> *fCategories; // Set of legal categories. 0104 static G4ThreadLocal std::set<G4String> *fUnits; // Set of legal units. 0105 static G4ThreadLocal std::set<G4String> *fValueTypes; // Set of legal value types. 0106 }; 0107 0108 #endif //G4ATTCHECK_HH
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|