Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
genie::GHepVirtualListFolder Class Reference

A singleton class to manage all named GHepVirtualLists. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01a/Linux64bit+3.10-2.17-e19-debug/GENIE-Generator/src/Framework/GHEP/GHepVirtualListFolder.h"

Classes

struct  Cleaner
 

Public Member Functions

void AddToVirtualList (string listname, GHepParticle *p)
 
bool VirtualListExists (string listname)
 
void RemoveList (string listname)
 
void Clear (void)
 
GHepVirtualListVirtualList (string listname)
 

Static Public Member Functions

static GHepVirtualListFolderInstance (void)
 

Private Member Functions

 GHepVirtualListFolder ()
 
 GHepVirtualListFolder (const GHepVirtualListFolder &config_pool)
 
virtual ~GHepVirtualListFolder ()
 
void AddVirtualList (string listname)
 

Private Attributes

map< string, GHepVirtualList * > fVirtualListMap
 

Static Private Attributes

static GHepVirtualListFolderfInstance = 0
 

Friends

struct Cleaner
 

Detailed Description

A singleton class to manage all named GHepVirtualLists.

Author
Costas Andreopoulos <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

July 16, 2005

Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 33 of file GHepVirtualListFolder.h.

Constructor & Destructor Documentation

GHepVirtualListFolder::GHepVirtualListFolder ( )
private

Definition at line 26 of file GHepVirtualListFolder.cxx.

References fInstance.

Referenced by Instance().

27 {
28  fInstance = 0;
29 }
static GHepVirtualListFolder * fInstance
genie::GHepVirtualListFolder::GHepVirtualListFolder ( const GHepVirtualListFolder config_pool)
private
GHepVirtualListFolder::~GHepVirtualListFolder ( )
privatevirtual

Definition at line 31 of file GHepVirtualListFolder.cxx.

References Clear(), and fInstance.

32 {
33  this->Clear();
34  fInstance = 0;
35 }
static GHepVirtualListFolder * fInstance

Member Function Documentation

void GHepVirtualListFolder::AddToVirtualList ( string  listname,
GHepParticle p 
)

Definition at line 49 of file GHepVirtualListFolder.cxx.

References AddVirtualList(), fVirtualListMap, and VirtualListExists().

50 {
51 // Adds a particle to the named virtual list - if the list does not exists it
52 // creates it first.
53 // The virtual list has no ownership of its
54  bool exists = this->VirtualListExists(listname);
55 
56  if(!exists) this->AddVirtualList(listname);
57 
58  int n = fVirtualListMap[listname]->GetEntries();
59  GHepVirtualList * vl = fVirtualListMap[listname];
60  (*vl)[n] = (TObject*)p;
61 }
bool VirtualListExists(string listname)
A GHepVirtualList is a &#39;virtual&#39; collection of GHepParticles. Is virtual because it does not own but ...
std::void_t< T > n
map< string, GHepVirtualList * > fVirtualListMap
void GHepVirtualListFolder::AddVirtualList ( string  listname)
private

Definition at line 110 of file GHepVirtualListFolder.cxx.

References fVirtualListMap.

Referenced by AddToVirtualList().

111 {
112  GHepVirtualList * vl = new GHepVirtualList;
113  fVirtualListMap.insert(
114  map<string, GHepVirtualList *>::value_type(listname,vl) );
115 }
A GHepVirtualList is a &#39;virtual&#39; collection of GHepParticles. Is virtual because it does not own but ...
map< string, GHepVirtualList * > fVirtualListMap
void GHepVirtualListFolder::Clear ( void  )

Definition at line 88 of file GHepVirtualListFolder.cxx.

References fVirtualListMap.

Referenced by genie::EventGenerator::ProcessEventRecord(), and ~GHepVirtualListFolder().

89 {
90 // removes all virtual lists
91 
92  map<string, GHepVirtualList *>::iterator vlmiter;
93  for (vlmiter = fVirtualListMap.begin();
94  vlmiter != fVirtualListMap.end(); ++vlmiter) {
95  GHepVirtualList * vlist = vlmiter->second;
96  if(vlist) delete vlist;
97  vlist = 0;
98  }
99  fVirtualListMap.clear();
100 }
A GHepVirtualList is a &#39;virtual&#39; collection of GHepParticles. Is virtual because it does not own but ...
map< string, GHepVirtualList * > fVirtualListMap
GHepVirtualListFolder * GHepVirtualListFolder::Instance ( void  )
static
void GHepVirtualListFolder::RemoveList ( string  listname)

Definition at line 71 of file GHepVirtualListFolder.cxx.

References fVirtualListMap.

72 {
73 // removes the input virtual list (if it exists)
74 
75  bool exists = (fVirtualListMap.count(listname) == 1);
76  if(!exists) return;
77 
78  map<string, GHepVirtualList *>::iterator
79  vlmiter = fVirtualListMap.find(listname);
80 
81  GHepVirtualList * vlist = vlmiter->second;
82  if(vlist) delete vlist;
83  vlist = 0;
84 
85  fVirtualListMap.erase(listname);
86 }
A GHepVirtualList is a &#39;virtual&#39; collection of GHepParticles. Is virtual because it does not own but ...
map< string, GHepVirtualList * > fVirtualListMap
GHepVirtualList * GHepVirtualListFolder::VirtualList ( string  listname)

Definition at line 102 of file GHepVirtualListFolder.cxx.

References fVirtualListMap, and VirtualListExists().

103 {
104  bool exists = this->VirtualListExists(listname);
105 
106  if(!exists) return 0;
107  else return fVirtualListMap[listname];
108 }
bool VirtualListExists(string listname)
map< string, GHepVirtualList * > fVirtualListMap
bool GHepVirtualListFolder::VirtualListExists ( string  listname)

Definition at line 63 of file GHepVirtualListFolder.cxx.

References fVirtualListMap.

Referenced by AddToVirtualList(), and VirtualList().

64 {
65 // checks whether a virtual list exists
66 
67  bool exists = (fVirtualListMap.count(listname) == 1);
68  return exists;
69 }
map< string, GHepVirtualList * > fVirtualListMap

Friends And Related Function Documentation

friend struct Cleaner
friend

Definition at line 66 of file GHepVirtualListFolder.h.

Member Data Documentation

GHepVirtualListFolder * GHepVirtualListFolder::fInstance = 0
staticprivate
map<string, GHepVirtualList *> genie::GHepVirtualListFolder::fVirtualListMap
private

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