Geant4-11
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)
 
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)

References G4AttDef::GetCategory(), G4AttDef::GetDesc(), G4AttDef::GetExtra(), G4AttDefStore::GetStoreKey(), G4AttDef::GetValueType(), and G4InuclParticleNames::name().

◆ 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}