00001 #include "EventFilter/Utilities/interface/ServiceWebRegistry.h" 00002 #include "EventFilter/Utilities/interface/ServiceWeb.h" 00003 00004 #include <iostream> 00005 00006 namespace evf{ 00007 ServiceWebRegistry::ServiceWebRegistry(const edm::ParameterSet &ps){ 00008 std::cout << "Service registry constructor at " << std::hex << (unsigned int) this << std::dec << std::endl; 00009 } 00010 00011 00012 00013 std::vector<ServiceWeb*> ServiceWebRegistry::getWebs() 00014 { 00015 std::cout << " service web registry " << std::hex << (unsigned int) this << std::dec 00016 << " has " << clm_.size() << " services registered " << std::endl; 00017 std::vector<ServiceWeb*> retval; 00018 for(idct i = clm_.begin(); i != clm_.end(); i++) 00019 { 00020 std::cout << "service " << (*i).first << " has web " << std::endl; 00021 retval.push_back((*i).second); 00022 } 00023 return retval; 00024 } 00025 00026 00027 void ServiceWebRegistry::invoke(xgi::Input *in, xgi::Output *out, const std::string &name) 00028 { 00029 idct i = clm_.find(name); 00030 if(i != clm_.end()) 00031 { 00032 try{ 00033 (*i).second->defaultWebPage(in,out); 00034 } 00035 catch(...) 00036 { 00037 std::cout << "exception caught when calling serviceweb page for " << name << std::endl; 00038 } 00039 } 00040 } 00041 00042 00043 void ServiceWebRegistry::publish(xdata::InfoSpace *is) 00044 { 00045 idct i = clm_.begin(); 00046 while (i != clm_.end()) 00047 { 00048 (*i).second->publish(is); 00049 i++; 00050 } 00051 00052 } 00053 00054 void ServiceWebRegistry::clear() 00055 { 00056 std::cout << "Service registry clear for " << std::hex << (unsigned int) this << std::dec << std::endl; 00057 clm_.clear(); 00058 } 00059 00060 00061 } //end namespace evf