00001 #ifndef LOCATIONDEF_H 00002 #define LOCATIONDEF_H 00003 00004 #include <string> 00005 #include <stdexcept> 00006 00007 #include "OnlineDB/EcalCondDB/interface/IDef.h" 00008 00012 class LocationDef : public IDef { 00013 public: 00014 friend class EcalCondDBInterface; 00015 00016 LocationDef(); 00017 virtual ~LocationDef(); 00018 00019 // Methods for user data 00020 std::string getLocation() const; 00021 void setLocation(std::string loc); 00022 00023 // Methods from IUniqueDBObject 00024 int fetchID() throw(std::runtime_error); 00025 void setByID(int id) throw(std::runtime_error); 00026 00027 inline bool operator==(const LocationDef& l) const { return m_loc == l.m_loc; } 00028 inline bool operator!=(const LocationDef& l) const { return m_loc != l.m_loc; } 00029 00030 protected: 00031 // User data for this def 00032 std::string m_loc; 00033 00034 void fetchAllDefs( std::vector<LocationDef>* fillVec) throw(std::runtime_error); 00035 }; 00036 00037 #endif