00001 #include "IdGenerator.h" 00002 #include <iostream> 00003 00004 #include "debug_tools.h" 00005 00006 ClassImp(IDs::generator); 00007 00008 std::string IDs::generator::str()const{ 00009 return fType+IDs::field_separator+fConfig; 00010 } 00011 00012 ostream& operator<< (ostream& os ,const IDs::generator& id) { 00013 os<<id.str(); 00014 return os; 00015 } 00016 00017 IDs::generator& IDs::generator::operator=(const std::string& rhs){ 00018 // Find the first delimiter 00019 size_t delim=rhs.find(IDs::field_separator.c_str()); 00020 if(delim==std::string::npos){ 00021 std::cout<<"Warning: Strange looking string given to IDs::source: "<<rhs<<std::endl; 00022 Type(rhs); 00023 } else{ 00024 Type(rhs.substr(0,delim)); 00025 Config(rhs.substr(delim+1)); 00026 } 00027 return *this; 00028 } 00029 00030 void IDs::generator::Debug()const{ 00031 std::cout<<"Generator: "<<Type()<<std::endl; 00032 std::cout<<"Config: "<<Config()<<std::endl; 00033 }