Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:12

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef FFAOBJECTS_FLAGSAVEV1_H
0004 #define FFAOBJECTS_FLAGSAVEV1_H
0005 
0006 #include "FlagSave.h"
0007 
0008 #include <cstdint>  // for uint64_t
0009 #include <iostream>
0010 #include <map>
0011 #include <string>
0012 
0013 class PHFlag;
0014 class PHObject;
0015 
0016 ///
0017 class FlagSavev1 : public FlagSave
0018 {
0019  public:
0020   /// ctor
0021   FlagSavev1() = default;
0022   /// dtor
0023   ~FlagSavev1() override = default;
0024 
0025   PHObject *CloneMe() const override;
0026 
0027   ///  Clear Event
0028   void Reset() override {}
0029   int isValid() const override;
0030 
0031   /** identify Function from PHObject
0032       @param os Output Stream
0033    */
0034   void identify(std::ostream &out = std::cout) const override;
0035 
0036   int FillFromPHFlag(const PHFlag *flags, const bool clearold) override;
0037   int PutFlagsBack(PHFlag *flags, const bool overwrite) override;
0038 
0039  private:
0040   void ClearAll();
0041   int FillIntFromPHFlag(const PHFlag *flags);
0042   int Filluint64FromPHFlag(const PHFlag *flags);
0043   int FillDoubleFromPHFlag(const PHFlag *flags);
0044   int FillFloatFromPHFlag(const PHFlag *flags);
0045   int FillStringFromPHFlag(const PHFlag *flags);
0046 
0047   int PutIntToPHFlag(PHFlag *flags, const bool overwrite);
0048   int Putuint64ToPHFlag(PHFlag *flags, const bool overwrite);
0049   int PutDoubleToPHFlag(PHFlag *flags, const bool overwrite);
0050   int PutFloatToPHFlag(PHFlag *flags, const bool overwrite);
0051   int PutStringToPHFlag(PHFlag *flags, const bool overwrite);
0052 
0053   void PrintIntFlag(std::ostream &os) const;
0054   void Printuint64Flag(std::ostream &os) const;
0055   void PrintDoubleFlag(std::ostream &os) const;
0056   void PrintFloatFlag(std::ostream &os) const;
0057   void PrintStringFlag(std::ostream &os) const;
0058 
0059   std::map<std::string, int> intflag;
0060   std::map<std::string, double> doubleflag;
0061   std::map<std::string, float> floatflag;
0062   std::map<std::string, std::string> stringflag;
0063   std::map<std::string, uint64_t> m_uint64flag_map;
0064 
0065   ClassDefOverride(FlagSavev1, 2)
0066 };
0067 
0068 #endif