Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Attributes | List of all members
evdb::ServiceTable Class Reference

Collection of Services used in the event display. More...

#include <ServiceTable.h>

Public Member Functions

void RegisterService (fhicl::ParameterSet const &ps, cet::exempt_ptr< Reconfigurable > s)
 
void Edit (unsigned int i)
 
void ApplyEdits ()
 
fhicl::ParameterSet const & GetParameterSet (unsigned int i) const
 

Static Public Member Functions

static ServiceTableInstance ()
 
static bool IsDrawingService (std::string const &s)
 
static void OverrideCategory (std::string const &s, int cat)
 

Public Attributes

std::vector< ServiceTableEntryfServices
 

Private Member Functions

 ServiceTable ()
 

Static Private Attributes

static std::map< std::string, int > fgCategoryOverrides
 

Detailed Description

Collection of Services used in the event display.

Definition at line 36 of file ServiceTable.h.

Constructor & Destructor Documentation

ServiceTable::ServiceTable ( )
private

Definition at line 111 of file ServiceTable.cxx.

111 {}

Member Function Documentation

void ServiceTable::ApplyEdits ( )

Definition at line 64 of file ServiceTable.cxx.

65 {
66  // Look to see if we have any new service configurations to apply
67  for (auto& s : fServices) {
68  if (s.fParamSet.empty()) continue;
69 
70  MF_LOG_DEBUG("ServiceTable") << "Applying edits for "
71  << s.fName
72  << "\n"
73  << s.fParamSet;
74 
75  try {
77  //
78  // Each of the next 2 lines may throw on error: should check.
79  //
80  fhicl::make_ParameterSet(s.fParamSet, pset);
81  s.fParamSet.clear();
82  s.fService->do_reconfigure(pset);
83  s.fCurrentParamSet = pset;
84  }
85  catch (fhicl::exception const& e) {
86  MF_LOG_ERROR("ServiceTable") << "Error parsing the new configuration:\n"
87  << e
88  << "\nRe-configuration has been ignored for service: "
89  << s.fName;
90  }
91  }
92 }
#define MF_LOG_ERROR(category)
void make_ParameterSet(intermediate_table const &tbl, ParameterSet &ps)
const double e
std::vector< ServiceTableEntry > fServices
Definition: ServiceTable.h:50
#define MF_LOG_DEBUG(id)
static QCString * s
Definition: config.cpp:1042
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void ServiceTable::Edit ( unsigned int  i)

Definition at line 56 of file ServiceTable.cxx.

57 {
58  assert(i < fServices.size());
60 }
Top-level interface to all parameter sets.
std::vector< ServiceTableEntry > fServices
Definition: ServiceTable.h:50
fhicl::ParameterSet const & ServiceTable::GetParameterSet ( unsigned int  i) const

Definition at line 103 of file ServiceTable.cxx.

104 {
105  assert(id < fServices.size());
106  return fServices[id].fCurrentParamSet;
107 }
std::vector< ServiceTableEntry > fServices
Definition: ServiceTable.h:50
ServiceTable & ServiceTable::Instance ( void  )
static

Definition at line 48 of file ServiceTable.cxx.

49 {
50  static ServiceTable s;
51  return s;
52 }
Collection of Services used in the event display.
Definition: ServiceTable.h:36
static QCString * s
Definition: config.cpp:1042
bool ServiceTable::IsDrawingService ( std::string const &  s)
static

Definition at line 23 of file ServiceTable.cxx.

24 {
25  if(fgCategoryOverrides.count(s))
27 
28  return (s.find("DrawingOptions")!=std::string::npos);
29 }
static constexpr int kDRAWING_SERVICE
Definition: ServiceTable.h:19
static std::map< std::string, int > fgCategoryOverrides
Definition: ServiceTable.h:53
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
static QCString * s
Definition: config.cpp:1042
void ServiceTable::OverrideCategory ( std::string const &  s,
int  cat 
)
static

Definition at line 96 of file ServiceTable.cxx.

97 {
98  fgCategoryOverrides[s] = cat;
99 }
static std::map< std::string, int > fgCategoryOverrides
Definition: ServiceTable.h:53
static QCString * s
Definition: config.cpp:1042
void ServiceTable::RegisterService ( fhicl::ParameterSet const &  ps,
cet::exempt_ptr< Reconfigurable s 
)

Definition at line 33 of file ServiceTable.cxx.

35 {
37  entry.fName = ps.get<std::string>("service_type");
38  entry.fCurrentParamSet = ps;
39  entry.fParamSet = "";
41  entry.fService = s;
42 
43  fServices.emplace_back(std::move(entry));
44 }
static constexpr int kDRAWING_SERVICE
Definition: ServiceTable.h:19
QList< Entry > entry
static const double ps
Definition: Units.h:103
std::string string
Definition: nybbler.cc:12
cet::exempt_ptr< Reconfigurable > fService
Definition: ServiceTable.h:30
static constexpr int kEXPERIMENT_SERVICE
Definition: ServiceTable.h:20
static bool IsDrawingService(std::string const &s)
def move(depos, offset)
Definition: depos.py:107
std::vector< ServiceTableEntry > fServices
Definition: ServiceTable.h:50
fhicl::ParameterSet fCurrentParamSet
Definition: ServiceTable.h:27
Information about a service required by the event display.
Definition: ServiceTable.h:25
static QCString * s
Definition: config.cpp:1042

Member Data Documentation

std::map< std::string, int > ServiceTable::fgCategoryOverrides
staticprivate

Definition at line 53 of file ServiceTable.h.

std::vector<ServiceTableEntry> evdb::ServiceTable::fServices

Definition at line 50 of file ServiceTable.h.


The documentation for this class was generated from the following files: