| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

ParamList.h

Go to the documentation of this file.
00001 // $Id: ParamList.h,v 1.5 2006/10/25 13:45:01 marcocle Exp $
00002 #ifndef DETDESC_PARAMLIST_H 
00003 #define DETDESC_PARAMLIST_H 1
00004 
00005 // Include files
00006 
00007 #include <DetDesc/Param.h>
00008 
00009 #include "GaudiKernel/Map.h"
00010 
00019 class ParamList: public GaudiUtils::Map<std::string,BasicParam *> {
00020 private:
00021   typedef GaudiUtils::Map<std::string,BasicParam *> base_type;
00022 
00023 public: 
00025   ParamList();
00026 
00028   ParamList(const ParamList &pl);
00029 
00031   virtual ~ParamList();
00032 
00034   template <class T>
00035   inline void add(const std::string &key, const T &val) {
00036     iterator i = find(key);
00037     if ( i != end() ) { // key already used
00038       i->second->set(val);
00039     } else {
00040       //(*this)[key] = new Param<T>(val);
00041       insert(std::pair<std::string,Param<T>*>(key,new Param<T>(val)));
00042     }
00043   }
00044 
00045   inline void addBasicParam(const std::string &key, const BasicParam* &p) {
00046     iterator i = find(key);
00047     if ( i != end() ) { // key already used
00048     // replace with new one
00049       delete i->second;
00050       i->second = p->new_copy();
00051     } else {
00052       //(*this)[key] = p->new_copy();
00053       insert(std::pair<std::string,BasicParam*>(key,p->new_copy()));
00054     }
00055   }
00056 
00058   virtual std::vector<std::string> getKeys() const;
00059 
00061   ParamList& operator= (const ParamList &pl);
00062   
00064   ParamList& operator+= (const ParamList &pl);
00065   
00067   void clear();
00068 
00069 protected:
00070 
00071 private:
00072   void deleteItems();
00073 
00074 };
00075 #endif // DETDESC_PARAMLIST_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:00:13 2011 for DetDesc by doxygen 1.4.7