ATLAS Offline Software
Loading...
Searching...
No Matches
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
16
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:
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
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 MaterialMapIterator end() const =0
virtual ~StoredMaterialManager()=default
MaterialMap::const_iterator MaterialMapIterator
virtual size_t size()=0
virtual std::ostream & printAll(std::ostream &o=std::cout) const =0
virtual void addMaterial(const std::string &space, GeoMaterial *material)=0
virtual const GeoElement * getElement(const std::string &name)=0
std::map< std::string, GeoIntrusivePtr< GeoMaterial > > MaterialMap
virtual const GeoMaterial * getMaterial(const std::string &name)=0