Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G3MatTable Class Reference

#include <G3MatTable.hh>

Public Member Functions

 G3MatTable ()
 
virtual ~G3MatTable ()
 
G4Materialget (G4int id) const
 
void put (G4int id, G4Material *material)
 
void Clear ()
 

Detailed Description

Definition at line 53 of file G3MatTable.hh.

Constructor & Destructor Documentation

G3MatTable::G3MatTable ( )

Definition at line 33 of file G3MatTable.cc.

34 {
35  fMatVector = new G3MaterialVector();
36 }
std::vector< G3MatTableEntry * > G3MaterialVector
Definition: G3MatTable.hh:49
G3MatTable::~G3MatTable ( )
virtual

Definition at line 38 of file G3MatTable.cc.

39 {
40  Clear();
41  delete fMatVector;
42 }
void Clear()
Definition: G3MatTable.cc:59

Here is the call graph for this function:

Member Function Documentation

void G3MatTable::Clear ( )

Definition at line 59 of file G3MatTable.cc.

60 {
61  G3MatTableEntry* a;
62  while (fMatVector->size()>0) {
63  a = fMatVector->back();
64  fMatVector->pop_back();
65  for (G3MaterialVector::iterator i=fMatVector->begin();
66  i!=fMatVector->end();){
67  if (*i==a) {
68  i = fMatVector->erase(i);
69  }
70  else {
71  ++i;
72  }
73  }
74  if ( a ) delete a;
75  }
76 }

Here is the caller graph for this function:

G4Material * G3MatTable::get ( G4int  id) const

Definition at line 44 of file G3MatTable.cc.

45 {
46  for (size_t i=0; i< fMatVector->size(); i++) {
47  G3MatTableEntry* mte = (*fMatVector)[i];
48  if (id == mte->GetID()) return mte->GetMaterial();
49  }
50  return 0;
51 }
G4int GetID() const
G4Material * GetMaterial() const

Here is the call graph for this function:

Here is the caller graph for this function:

void G3MatTable::put ( G4int  id,
G4Material material 
)

Definition at line 53 of file G3MatTable.cc.

54 {
55  G3MatTableEntry* mte = new G3MatTableEntry(id, material);
56  fMatVector->push_back(mte);
57 }

Here is the caller graph for this function:


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