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 <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 <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

July 16, 2005

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

Definition at line 32 of file GHepVirtualListFolder.h.

Constructor & Destructor Documentation

GHepVirtualListFolder::GHepVirtualListFolder ( )
private

Definition at line 20 of file GHepVirtualListFolder.cxx.

21 {
22  fInstance = 0;
23 }
static GHepVirtualListFolder * fInstance
genie::GHepVirtualListFolder::GHepVirtualListFolder ( const GHepVirtualListFolder config_pool)
private
GHepVirtualListFolder::~GHepVirtualListFolder ( )
privatevirtual

Definition at line 25 of file GHepVirtualListFolder.cxx.

26 {
27  this->Clear();
28  fInstance = 0;
29 }
static GHepVirtualListFolder * fInstance

Member Function Documentation

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

Definition at line 43 of file GHepVirtualListFolder.cxx.

44 {
45 // Adds a particle to the named virtual list - if the list does not exists it
46 // creates it first.
47 // The virtual list has no ownership of its
48  bool exists = this->VirtualListExists(listname);
49 
50  if(!exists) this->AddVirtualList(listname);
51 
52  int n = fVirtualListMap[listname]->GetEntries();
53  GHepVirtualList * vl = fVirtualListMap[listname];
54  (*vl)[n] = (TObject*)p;
55 }
bool VirtualListExists(string listname)
bool exists(std::string path)
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 104 of file GHepVirtualListFolder.cxx.

105 {
106  GHepVirtualList * vl = new GHepVirtualList;
107  fVirtualListMap.insert(
108  map<string, GHepVirtualList *>::value_type(listname,vl) );
109 }
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 82 of file GHepVirtualListFolder.cxx.

83 {
84 // removes all virtual lists
85 
87  for (vlmiter = fVirtualListMap.begin();
88  vlmiter != fVirtualListMap.end(); ++vlmiter) {
89  GHepVirtualList * vlist = vlmiter->second;
90  if(vlist) delete vlist;
91  vlist = 0;
92  }
93  fVirtualListMap.clear();
94 }
intermediate_table::iterator iterator
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

Definition at line 31 of file GHepVirtualListFolder.cxx.

void GHepVirtualListFolder::RemoveList ( string  listname)

Definition at line 65 of file GHepVirtualListFolder.cxx.

66 {
67 // removes the input virtual list (if it exists)
68 
69  bool exists = (fVirtualListMap.count(listname) == 1);
70  if(!exists) return;
71 
73  vlmiter = fVirtualListMap.find(listname);
74 
75  GHepVirtualList * vlist = vlmiter->second;
76  if(vlist) delete vlist;
77  vlist = 0;
78 
79  fVirtualListMap.erase(listname);
80 }
intermediate_table::iterator iterator
bool exists(std::string path)
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 96 of file GHepVirtualListFolder.cxx.

97 {
98  bool exists = this->VirtualListExists(listname);
99 
100  if(!exists) return 0;
101  else return fVirtualListMap[listname];
102 }
bool VirtualListExists(string listname)
bool exists(std::string path)
map< string, GHepVirtualList * > fVirtualListMap
bool GHepVirtualListFolder::VirtualListExists ( string  listname)

Definition at line 57 of file GHepVirtualListFolder.cxx.

58 {
59 // checks whether a virtual list exists
60 
61  bool exists = (fVirtualListMap.count(listname) == 1);
62  return exists;
63 }
bool exists(std::string path)
map< string, GHepVirtualList * > fVirtualListMap

Friends And Related Function Documentation

friend struct Cleaner
friend

Definition at line 65 of file GHepVirtualListFolder.h.

Member Data Documentation

GHepVirtualListFolder * GHepVirtualListFolder::fInstance = 0
staticprivate

Definition at line 50 of file GHepVirtualListFolder.h.

map<string, GHepVirtualList *> genie::GHepVirtualListFolder::fVirtualListMap
private

Definition at line 52 of file GHepVirtualListFolder.h.


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