CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CondFormats/Common/src/DropBoxMetadata.cc

Go to the documentation of this file.
00001 
00002 /*
00003  *  See header file for a description of this class.
00004  *
00005  *  $Date: 2011/03/02 17:09:28 $
00006  *  $Revision: 1.2 $
00007  *  \author G. Cerminara - CERN
00008  */
00009 
00010 #include "CondFormats/Common/interface/DropBoxMetadata.h"
00011 
00012 using std::string;
00013 using std::map;
00014 
00015 
00016 DropBoxMetadata::DropBoxMetadata(){}
00017 
00018 DropBoxMetadata::~DropBoxMetadata(){}
00019 
00020 
00021 void DropBoxMetadata::Parameters::addParameter(const string& key, const string& value) {
00022   theParameters[key] = value;
00023 }
00024 
00025 string DropBoxMetadata::Parameters::getParameter(const string& key) const {
00026   string ret;
00027   map<string, string>::const_iterator thePair = theParameters.find(key);
00028   if(thePair != theParameters.end()) {
00029     ret = (*thePair).second;
00030   }
00031   return ret;
00032 }
00033 
00034 const map<string, string> & DropBoxMetadata::Parameters::getParameterMap() const {
00035   return theParameters;
00036 }
00037 
00038 
00039 
00040 
00041 void DropBoxMetadata::addRecordParameters(const string& record, const Parameters& params) {
00042   recordSet[record] = params;
00043 }
00044   
00045 const DropBoxMetadata::Parameters& DropBoxMetadata::getRecordParameters(const string& record) const {
00046   return recordSet.find(record)->second;
00047 }
00048 
00049 bool DropBoxMetadata::knowsRecord(const std::string& record) const {
00050   if(recordSet.find(record) != recordSet.end()) return true;
00051 
00052   return false;
00053 }