ATLAS Offline Software
StoredMaterialManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELINTERFACES_STOREDMATERIALMANAGER_H
6 #define GEOMODELINTERFACES_STOREDMATERIALMANAGER_H
7 
17 #include "AthenaKernel/CLASS_DEF.h"
18 #include <map>
19 #include <string>
20 #include <iostream>
21 
22 #include "GeoModelKernel/GeoIntrusivePtr.h"
23 #include "GeoModelKernel/GeoMaterial.h"
24 #include "GeoModelKernel/GeoElement.h"
25 
26 
28 {
29  public:
30  using MaterialMap = std::map<std::string, GeoIntrusivePtr<GeoMaterial>>;
31  using MaterialMapIterator = MaterialMap::const_iterator;
32 
33  // Constructor:
34  StoredMaterialManager() = default;
35 
36  // Destructor:
37  virtual ~StoredMaterialManager() = default;
38 
39  // Query the material:
40  virtual const GeoMaterial* getMaterial(const std::string& name) = 0;
41 
42  // Query the elements:
43  virtual const GeoElement* getElement(const std::string& name) = 0;
44 
45  // Query the elements (by atomic number):
46  virtual const GeoElement* getElement(unsigned int atomicNumber) = 0;
47 
48  // Add new material
49  virtual void addMaterial(const std::string& space, GeoMaterial* material) = 0;
50 
51  // Return iterators
52  virtual MaterialMapIterator begin() const = 0;
53  virtual MaterialMapIterator end() const = 0;
54 
55  // Number of materials in the manager
56  virtual size_t size() = 0;
57 
58  // Dump the contents
59  virtual std::ostream& printAll(std::ostream & o=std::cout) const = 0;
60 };
61 
63 
64 #endif
StoredMaterialManager::printAll
virtual std::ostream & printAll(std::ostream &o=std::cout) const =0
StoredMaterialManager::MaterialMap
std::map< std::string, GeoIntrusivePtr< GeoMaterial > > MaterialMap
Definition: StoredMaterialManager.h:30
StoredMaterialManager::getElement
virtual const GeoElement * getElement(const std::string &name)=0
StoredMaterialManager::begin
virtual MaterialMapIterator begin() const =0
StoredMaterialManager::size
virtual size_t size()=0
StoredMaterialManager::getElement
virtual const GeoElement * getElement(unsigned int atomicNumber)=0
StoredMaterialManager::addMaterial
virtual void addMaterial(const std::string &space, GeoMaterial *material)=0
StoredMaterialManager::~StoredMaterialManager
virtual ~StoredMaterialManager()=default
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
StoredMaterialManager::StoredMaterialManager
StoredMaterialManager()=default
StoredMaterialManager::MaterialMapIterator
MaterialMap::const_iterator MaterialMapIterator
Definition: StoredMaterialManager.h:31
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
StoredMaterialManager::end
virtual MaterialMapIterator end() const =0
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
CLASS_DEF.h
macros to associate a CLID to a type