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