GENIEGenerator
Loading...
Searching...
No Matches
genie::GEVGPool Class Reference

A pool of GEVGDriver objects with an initial state key. More...

#include <GEVGPool.h>

Inheritance diagram for genie::GEVGPool:
[legend]
Collaboration diagram for genie::GEVGPool:
[legend]

Public Member Functions

 GEVGPool ()
 ~GEVGPool ()
GEVGDriverFindDriver (const InitialState &init) const
GEVGDriverFindDriver (string init) const
void Print (ostream &stream) const

Friends

ostream & operator<< (ostream &stream, const GEVGPool &pool)

Detailed Description

A pool of GEVGDriver objects with an initial state key.

Author
Costas Andreopoulos <c.andreopoulos \at cern.ch> University of Liverpool
Created:\n May 24, 2005
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 37 of file GEVGPool.h.

Constructor & Destructor Documentation

◆ GEVGPool()

GEVGPool::GEVGPool ( )

Definition at line 28 of file GEVGPool.cxx.

28 :
29map<string, GEVGDriver *>()
30{
31
32}

Referenced by operator<<.

◆ ~GEVGPool()

GEVGPool::~GEVGPool ( )

Definition at line 34 of file GEVGPool.cxx.

35{
36 GEVGPool::const_iterator giter;
37 for(giter = this->begin(); giter != this->end(); ++giter) {
38 GEVGDriver * driver = giter->second;
39 delete driver;
40 driver = 0;
41 }
42}

Member Function Documentation

◆ FindDriver() [1/2]

GEVGDriver * GEVGPool::FindDriver ( const InitialState & init) const

Definition at line 44 of file GEVGPool.cxx.

45{
46 string str_init = init.AsString();
47
48 return this->FindDriver(str_init);
49}
GEVGDriver * FindDriver(const InitialState &init) const
Definition GEVGPool.cxx:44
string AsString(void) const

References genie::InitialState::AsString(), and FindDriver().

Referenced by FindDriver().

◆ FindDriver() [2/2]

GEVGDriver * GEVGPool::FindDriver ( string init) const

Definition at line 51 of file GEVGPool.cxx.

52{
53 GEVGDriver * driver = 0;
54
55 if ( this->count(init) == 1 ) {
56 GEVGPool::const_iterator giter = this->find(init);
57 driver = giter->second;
58 } else {
59 LOG("GEVGPool", pWARN)
60 << "No GEVGDriver object for init-state: " << init << " in pool";
61 }
62 return driver;
63}
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
#define pWARN
Definition Messenger.h:60

References LOG, and pWARN.

◆ Print()

void GEVGPool::Print ( ostream & stream) const

Definition at line 65 of file GEVGPool.cxx.

66{
67 stream << "\n GEVGDriver List:" << endl;
68
69 GEVGPool::const_iterator giter;
70
71 for(giter = this->begin(); giter != this->end(); ++giter) {
72
73 string init_state = giter->first;
74 GEVGDriver * driver = giter->second;
75
76 stream << "\n[" << init_state << "]";
77 stream << *driver;
78 }
79}

Referenced by operator<<.

◆ operator<<

ostream & operator<< ( ostream & stream,
const GEVGPool & pool )
friend

Definition at line 21 of file GEVGPool.cxx.

22 {
23 pool.Print(stream);
24 return stream;
25 }
void Print(ostream &stream) const
Definition GEVGPool.cxx:65

References GEVGPool(), and Print().


The documentation for this class was generated from the following files: