Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Functions
G4AttDef.hh File Reference
#include "globals.hh"
#include "G4TypeKey.hh"
#include <map>

Go to the source code of this file.

Data Structures

class  G4AttDef
 

Functions

std::ostream & operator<< (std::ostream &os, const std::map< G4String, G4AttDef > *definitions)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const std::map< G4String, G4AttDef > *  definitions 
)

Definition at line 34 of file G4AttDef.cc.

References G4String::first(), G4AttDef::GetCategory(), G4AttDef::GetDesc(), G4AttDef::GetExtra(), G4AttDefStore::GetStoreKey(), and G4AttDef::GetValueType().

35 {
36  using namespace std;
37  if (!definitions) {
38  os << "G4AttCheck: ERROR: zero definitions pointer." << endl;
39  return os;
40  }
41  G4String storeKey;
42  if (G4AttDefStore::GetStoreKey(definitions, storeKey)) {
43  os << storeKey << ":";
44  }
45  std::map<G4String,G4AttDef>::const_iterator i;
46  for (i = definitions->begin(); i != definitions->end(); ++i) {
47  const G4String& name = i->first;
48  const G4AttDef& attDef = i->second;
49  if (attDef.GetCategory() == "Physics") {
50  os << "\n " << attDef.GetDesc()
51  << " (" << name << "): ";
52  if (!attDef.GetExtra().empty()) {
53  if (attDef.GetExtra() != "G4BestUnit") os << "unit: ";
54  os << attDef.GetExtra() << " (";
55  }
56  os << attDef.GetValueType();
57  if (!attDef.GetExtra().empty()) os << ")";
58  }
59  }
60  os << endl;
61  return os;
62 }
G4bool GetStoreKey(const std::map< G4String, G4AttDef > *definitions, G4String &key)
G4int first(char) const
const XML_Char * name
const G4String & GetExtra() const
Definition: G4AttDef.hh:87
const G4String & GetValueType() const
Definition: G4AttDef.hh:88
const G4String & GetDesc() const
Definition: G4AttDef.hh:85
const G4String & GetCategory() const
Definition: G4AttDef.hh:86