BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MaterialKeyHandler.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Core/Export/MaterialKeyHandler.h
6 //! @brief Defines class MaterialKeyHandler.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_CORE_EXPORT_MATERIALKEYHANDLER_H
21 #define BORNAGAIN_CORE_EXPORT_MATERIALKEYHANDLER_H
22 
23 #include <map>
24 #include <string>
25 #include <vector>
26 
27 class Material;
28 
29 //! Stores Material instances, associates them with given tag, and provides unique keys.
30 //! @ingroup tools_internal
31 
33 public:
34  void insertMaterial(const Material* sample);
35 
36  const std::map<const std::string, const Material*>& materialMap() const;
37  const std::string& mat2key(const Material* sample) const;
38 
39 private:
40  std::map<const Material*, const Material*> m_Mat2Unique;
41  std::map<const std::string, const Material*> m_Key2Mat;
42 };
43 
44 #endif // BORNAGAIN_CORE_EXPORT_MATERIALKEYHANDLER_H
45 #endif // USER_API
Stores Material instances, associates them with given tag, and provides unique keys.
const std::map< const std::string, const Material * > & materialMap() const
void insertMaterial(const Material *sample)
const std::string & mat2key(const Material *sample) const
std::map< const Material *, const Material * > m_Mat2Unique
std::map< const std::string, const Material * > m_Key2Mat
A wrapper for underlying material implementation.
Definition: Material.h:29