Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:16:04

0001 #ifndef PDBCAL_BASE_PDBPARAMETERMAP_H
0002 #define PDBCAL_BASE_PDBPARAMETERMAP_H
0003 
0004 #include "PdbCalChan.h"
0005 
0006 #include <cstddef>
0007 #include <map>
0008 #include <string>
0009 #include <utility>
0010 
0011 class PHObject;
0012 
0013 class PdbParameterMap : public PdbCalChan
0014 {
0015  public:
0016   typedef std::map<const std::string, double> dMap;
0017   typedef std::map<const std::string, int> iMap;
0018   typedef std::map<const std::string, std::string> strMap;
0019   typedef dMap::const_iterator dIter;
0020   typedef iMap::const_iterator iIter;
0021   typedef strMap::const_iterator strIter;
0022   typedef std::pair<dIter, dIter> dConstRange;
0023   typedef std::pair<iIter, iIter> iConstRange;
0024   typedef std::pair<strIter, strIter> strConstRange;
0025 
0026   PdbParameterMap() = default;
0027   ~PdbParameterMap() override = default;
0028 
0029   PHObject *CloneMe() const override { return new PdbParameterMap(*this); }
0030 
0031   void print() const override;
0032   void Reset() override;  // from PHObject - clear content
0033 
0034   //! hash of binary information for checking purpose
0035   size_t get_hash() const;
0036 
0037   dConstRange get_dparam_iters() const
0038   {
0039     return std::make_pair(dparams.begin(), dparams.end());
0040   }
0041 
0042   iConstRange get_iparam_iters() const
0043   {
0044     return std::make_pair(iparams.begin(), iparams.end());
0045   }
0046 
0047   strConstRange get_cparam_iters() const
0048   {
0049     return std::make_pair(cparams.begin(), cparams.end());
0050   }
0051 
0052   void set_int_param(const std::string &name, const int ival);
0053   void set_double_param(const std::string &name, const double dval);
0054   void set_string_param(const std::string &name, const std::string &str);
0055 
0056  protected:
0057   dMap dparams;
0058   iMap iparams;
0059   strMap cparams;
0060 
0061   ClassDefOverride(PdbParameterMap, 1)
0062 };
0063 
0064 #endif