/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

PerJobInfo.cc
Go to the documentation of this file.
00001 #include "PerJobInfo/PerJobInfo.h"
00002 
00003 #include <sstream>
00004 
00005 PerJobInfo::PerJobInfo()
00006   :  jobId(),
00007      parameters()
00008 {
00009 }
00010 
00011 PerJobInfo::PerJobInfo(const DayaBay::JobId& jobId,
00012                        const std::map<std::string, std::string>& parameters)
00013   : jobId(jobId),
00014     parameters(parameters)
00015 {
00016 }
00017 
00018 PerJobInfo::~PerJobInfo()
00019 {
00020 }
00021 
00022 unsigned int PerJobInfo::size(){ 
00023   return parameters.size();
00024 }
00025 
00026 std::string PerJobInfo::name(unsigned int index){ 
00027   // Return the parameter name
00028   if(index>=parameters.size()) return "";
00029   std::map<std::string,std::string>::const_iterator pIter = parameters.begin();
00030   for(unsigned int i=0; i<index; i++) pIter++;
00031   return pIter->first;
00032 }
00033 
00034 std::string PerJobInfo::value(unsigned int index){
00035   // Return the parameter index
00036   if(index>=parameters.size()) return "";
00037   std::map<std::string,std::string>::const_iterator pIter = parameters.begin();
00038   for(unsigned int i=0; i<index; i++) pIter++;
00039   return pIter->second;
00040 }
00041 
00042 std::string PerJobInfo::infoString(){
00043   // Dump the parameters to a single string
00044   std::ostringstream params;
00045   params << "'jobId':'" << jobId.uuid() << "'\n";
00046   std::map<std::string,std::string>::const_iterator pIter, 
00047     pDone = parameters.end();
00048   for(pIter=parameters.begin(); pIter!=pDone; pIter++){
00049     params << "'" << pIter->first << "':'" << pIter->second << "'\n";
00050   }
00051   return params.str();
00052 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:59:17 for PerJobInfo by doxygen 1.7.4