Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4coutFormatters Namespace Reference

Namespaces

namespace  ID
 

Typedefs

using SetupStyle_f = std::function<G4int(G4coutDestination*)>
 
using String_V = std::vector<G4String>
 

Functions

String_V Names ()
 
G4int HandleStyle (G4coutDestination *dest, const G4String &style)
 
void SetMasterStyle (const G4String &)
 
G4String GetMasterStyle ()
 
void SetupStyleGlobally (const G4String &news)
 
void RegisterNewStyle (const G4String &name, SetupStyle_f &formatter)
 

Typedef Documentation

◆ SetupStyle_f

Definition at line 60 of file G4coutFormatters.hh.

◆ String_V

using G4coutFormatters::String_V = std::vector<G4String>

Definition at line 72 of file G4coutFormatters.hh.

Function Documentation

◆ GetMasterStyle()

G4String G4coutFormatters::GetMasterStyle ( )

Definition at line 120 of file G4coutFormatters.cc.

120{ return masterStyle; }

◆ HandleStyle()

G4int G4coutFormatters::HandleStyle ( G4coutDestination * dest,
const G4String & style )

Definition at line 140 of file G4coutFormatters.cc.

141 {
142 const auto& handler = transformers.find(style);
143 return (handler != transformers.cend()) ? (handler->second)(dest) : -1;
144 }

Referenced by SetupStyleGlobally().

◆ Names()

String_V G4coutFormatters::Names ( )

Definition at line 130 of file G4coutFormatters.cc.

131 {
132 String_V result;
133 for(const auto& el : transformers)
134 {
135 result.push_back(el.first);
136 }
137 return result;
138 }
std::vector< G4String > String_V

◆ RegisterNewStyle()

void G4coutFormatters::RegisterNewStyle ( const G4String & name,
SetupStyle_f & formatter )

Definition at line 146 of file G4coutFormatters.cc.

147 {
148 if(transformers.find(name) != transformers.cend())
149 {
151 msg << "Format Style with name " << name
152 << " already exists. Replacing existing.";
153 G4Exception("G4coutFormatters::RegisterNewStyle()", "FORMATTER001",
154 JustWarning, msg);
155 }
156 // transformers.insert(std::make_pair(name,fmt));
157 transformers[name] = fmt;
158 }
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription

◆ SetMasterStyle()

void G4coutFormatters::SetMasterStyle ( const G4String & news)

Definition at line 118 of file G4coutFormatters.cc.

118{ masterStyle = news; }

Referenced by SetupStyleGlobally().

◆ SetupStyleGlobally()

void G4coutFormatters::SetupStyleGlobally ( const G4String & news)

Definition at line 122 of file G4coutFormatters.cc.

123 {
124 static G4coutDestination ss;
128 }
void G4iosSetDestination(G4coutDestination *sink)
Definition G4ios.cc:270
void SetMasterStyle(const G4String &)
G4int HandleStyle(G4coutDestination *dest, const G4String &style)