user_info.hh

Go to the documentation of this file.
00001 
00014 #ifndef USER_INFO_HH
00015 #define USER_INFO_HH
00016 
00017 #include "data_base.hh"
00018 #include <map>
00019 #include <TString.h>
00020 
00035 class user_info : public data_base {
00036 
00037 public:
00038 
00042   void dump_contents();
00043 
00045   user_info() : data_base() { clear_data(); };
00046 
00048   user_info(const user_info &original);
00049 
00051   inline void store(std::string key, double value)      {_d_map[key]=value;};
00053   inline void store(std::string key, int value)         {_i_map[key]=value;};
00055   inline void store(std::string key, std::string value) {_s_map[key]=value;};
00057   inline void store(std::string key, bool value)        {_b_map[key]=value;};
00058 
00060   void append(std::string key, double value);      
00062   void append(std::string key, int value);   
00064   void append(std::string key, std::string value); 
00066   void append(std::string key, bool value);        
00067 
00069   double      get_double (std::string key) const;  
00071   int         get_int    (std::string key) const;  
00073   std::string get_string (std::string key) const;  
00075   bool        get_bool   (std::string key) const;  
00076 
00078   std::vector<double>*      get_darray (std::string key); 
00080   std::vector<int>*         get_iarray (std::string key); 
00082   std::vector<std::string>* get_sarray (std::string key); 
00084   std::vector<bool>*        get_barray (std::string key); 
00085 
00087   virtual ~user_info(){}; 
00088 
00090   virtual void clear_data();
00091 
00092 protected:
00093 
00094   std::map<std::string,double>       _d_map; 
00095   std::map<std::string,int>          _i_map; 
00096   std::map<std::string,std::string>  _s_map; 
00097   std::map<std::string,bool>         _b_map; 
00098   std::map<std::string,std::vector<double> >      _darray_map; 
00099   std::map<std::string,std::vector<int> >         _iarray_map; 
00100   std::map<std::string,std::vector<std::string> > _sarray_map; 
00101   std::map<std::string,std::vector<bool> >        _barray_map; 
00102 
00104   ClassDef(user_info,1)
00106 
00107 };
00108 
00109 
00110 
00117 class user_collection : public std::vector<user_info>,
00118             public data_base {
00119   
00120 public:
00121 
00123   user_collection() : data_base() {clear_data();};
00124 
00126   user_collection(const user_collection& original)
00127     : std::vector<user_info>(original),
00128       data_base(original)
00129   {};
00130 
00132   virtual void clear_data(){clear();};
00133 
00135   ~user_collection(){};
00136 
00137 
00138 private:
00139 
00141   ClassDef(user_collection,1)
00143 };
00144 
00145 
00146 
00147 #endif
00148  // end of doxygen group 

Generated on Mon Apr 7 15:35:12 2014 for MyProject by  doxygen 1.4.7