CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_3_3/src/FWCore/Services/bin/cmsGetFnConnect.cc File Reference

#include "FWCore/Catalog/interface/SiteLocalConfig.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Services/src/SiteLocalConfigService.h"
#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
#include "FWCore/Utilities/interface/Exception.h"
#include <iostream>
#include <string.h>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 23 of file cmsGetFnConnect.cc.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, edm::ServiceRegistry::createContaining(), alignCSCRings::e, and cms::Exception::explainSelf().

{
    if ((argc != 2) || (strncmp(argv[1], "frontier://", 11) != 0))
    {
        std::cerr << "Usage: cmsGetFnConnect frontier://shortname" << std::endl;
        return 2;
    }

    try {
      std::auto_ptr<edm::SiteLocalConfig> slcptr(new edm::service::SiteLocalConfigService(edm::ParameterSet()));
      boost::shared_ptr<edm::serviceregistry::ServiceWrapper<edm::SiteLocalConfig> > slc(new edm::serviceregistry::ServiceWrapper<edm::SiteLocalConfig>(slcptr));
      edm::ServiceToken slcToken = edm::ServiceRegistry::createContaining(slc);
      edm::ServiceRegistry::Operate operate(slcToken);

      edm::Service<edm::SiteLocalConfig> localconfservice;

      std::cout << localconfservice->lookupCalibConnect(argv[1]) << std::endl;
    } catch(cms::Exception const& e) {
      std::cerr << e.explainSelf() << std::endl;
      return 2;
    }
    return 0;
}