Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AttDef.cc File Reference
#include "G4AttDef.hh"
#include "G4AttDefStore.hh"

Go to the source code of this file.

Functions

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

Function Documentation

◆ operator<<() [1/2]

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

Definition at line 47 of file G4AttDef.cc.

49{
50 G4String storeKey;
51 if (G4AttDefStore::GetStoreKey(&definitions, storeKey)) {
52 os << storeKey << ":";
53 }
54 std::map<G4String,G4AttDef>::const_iterator i;
55 for (i = definitions.begin(); i != definitions.end(); ++i) {
56 const G4String& name = i->first;
57 const G4AttDef& attDef = i->second;
58 if (attDef.GetCategory() == "Physics") {
59 os << "\n " << attDef.GetDesc()
60 << " (" << name << "): ";
61 if (!attDef.GetExtra().empty()) {
62 if (attDef.GetExtra() != "G4BestUnit") os << "unit: ";
63 os << attDef.GetExtra() << " (";
64 }
65 os << attDef.GetValueType();
66 if (!attDef.GetExtra().empty()) os << ")";
67 }
68 }
69 os << endl;
70 return os;
71}
const G4String & GetCategory() const
Definition: G4AttDef.hh:85
const G4String & GetExtra() const
Definition: G4AttDef.hh:86
const G4String & GetDesc() const
Definition: G4AttDef.hh:84
const G4String & GetValueType() const
Definition: G4AttDef.hh:87
G4bool GetStoreKey(const std::map< G4String, G4AttDef > *definitions, G4String &key)
const char * name(G4int ptype)

◆ operator<<() [2/2]

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

Definition at line 35 of file G4AttDef.cc.

37{
38 os << "G4AttDef: Deprecated output function. Use const reference instead." << endl;
39 if (definitions) {
40 os << *definitions;
41 } else {
42 os << "G4AttCheck: ERROR: zero definitions pointer." << endl;
43 }
44 return os;
45}