CMS 3D CMS Logo

cmsGetFnConnect.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Utilities
4 // Class : cmsGetFnConnect
5 //
6 // Implementation:
7 // Looks up a frontier connect string
8 //
9 // Original Author: Dave Dykstra
10 // Created: Tue Feb 22 16:54:06 CST 2011
11 //
12 
19 #include <iostream>
20 #include <string.h>
21 
22 int
23 main(int argc, char* argv[])
24 {
25  if ((argc != 2) || (strncmp(argv[1], "frontier://", 11) != 0))
26  {
27  std::cerr << "Usage: cmsGetFnConnect frontier://shortname" << std::endl;
28  return 2;
29  }
30 
31  try {
32  std::unique_ptr<edm::SiteLocalConfig> slcptr = std::make_unique<edm::service::SiteLocalConfigService>(edm::ParameterSet());
33  auto slc = std::make_shared<edm::serviceregistry::ServiceWrapper<edm::SiteLocalConfig> >(std::move(slcptr));
36 
37  edm::Service<edm::SiteLocalConfig> localconfservice;
38 
39  std::cout << localconfservice->lookupCalibConnect(argv[1]) << std::endl;
40  } catch(cms::Exception const& e) {
41  std::cerr << e.explainSelf() << std::endl;
42  return 2;
43  }
44  return 0;
45 }
virtual std::string const lookupCalibConnect(std::string const &input) const =0
virtual std::string explainSelf() const
Definition: Exception.cc:146
int main(int argc, char *argv[])
static ServiceToken createContaining(std::unique_ptr< T > iService)
create a service token that holds the service defined by iService
def move(src, dest)
Definition: eostools.py:510
def operate(timelog, memlog, json_f, num)