CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
edm::rootfix::LockService Class Reference

#include <LockService.h>

Public Member Functions

boost::mutexgetLock ()
 
 LockService (const edm::ParameterSet &, edm::ActivityRegistry &)
 
void postBeginJob ()
 
void postEndJob ()
 
void postEventProcessing (const edm::Event &, const edm::EventSetup &)
 
void postModule (const edm::ModuleDescription &)
 
void postSource ()
 
void postSourceConstruction (const edm::ModuleDescription &)
 
void preEventProcessing (const edm::EventID &, const edm::Timestamp &)
 
void preModule (const edm::ModuleDescription &)
 
void preSource ()
 
void preSourceConstruction (const edm::ModuleDescription &)
 
 ~LockService ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::vector< std::string > Labels
 

Private Attributes

Labels labels_
 
boost::mutexlock_
 
boost::shared_ptr
< boost::mutex::scoped_lock > 
locker_
 
bool lockSources_
 

Detailed Description

Definition at line 31 of file LockService.h.

Member Typedef Documentation

typedef std::vector<std::string> edm::rootfix::LockService::Labels
private

Definition at line 60 of file LockService.h.

Constructor & Destructor Documentation

LockService::LockService ( const edm::ParameterSet iPS,
edm::ActivityRegistry reg 
)

Definition at line 13 of file LockService.cc.

References FDEBUG, postModule(), postSource(), postSourceConstruction(), preModule(), preSource(), preSourceConstruction(), edm::ActivityRegistry::watchPostModule(), edm::ActivityRegistry::watchPostSource(), edm::ActivityRegistry::watchPostSourceConstruction(), edm::ActivityRegistry::watchPreModule(), edm::ActivityRegistry::watchPreSource(), and edm::ActivityRegistry::watchPreSourceConstruction().

14  :
16  locker_(),
17  labels_(iPS.getUntrackedParameter<Labels>("labels")),
18  lockSources_(iPS.getUntrackedParameter<bool>("lockSources")) {
21 
22  // reg.watchPostBeginJob(this,&LockService::postBeginJob);
23  // reg.watchPostEndJob(this,&LockService::postEndJob);
24 
25  // reg.watchPreProcessEvent(this,&LockService::preEventProcessing);
26  // reg.watchPostProcessEvent(this,&LockService::postEventProcessing);
29 
32 
33  FDEBUG(4) << "In LockServices" << std::endl;
34 }
T getUntrackedParameter(std::string const &, T const &) const
void preModule(const edm::ModuleDescription &)
Definition: LockService.cc:85
void preSourceConstruction(const edm::ModuleDescription &)
Definition: LockService.cc:47
boost::mutex * getGlobalMutex()
Definition: GlobalMutex.cc:3
std::vector< std::string > Labels
Definition: LockService.h:60
void watchPostModule(PostModule::slot_type const &iSlot)
void watchPreSourceConstruction(PreSourceConstruction::slot_type const &iSlot)
void watchPostSourceConstruction(PostSourceConstruction::slot_type const &iSlot)
#define FDEBUG(lev)
Definition: DebugMacros.h:18
void watchPreModule(PreModule::slot_type const &iSlot)
void postSourceConstruction(const edm::ModuleDescription &)
Definition: LockService.cc:56
void watchPreSource(PreSource::slot_type const &iSlot)
boost::shared_ptr< boost::mutex::scoped_lock > locker_
Definition: LockService.h:59
boost::mutex & lock_
Definition: LockService.h:58
void watchPostSource(PostSource::slot_type const &iSlot)
void postModule(const edm::ModuleDescription &)
Definition: LockService.cc:93
LockService::~LockService ( )

Definition at line 36 of file LockService.cc.

36  {
37 }

Member Function Documentation

void LockService::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 39 of file LockService.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::addUntracked().

39  {
41  std::vector<std::string> defaultVector;
42  desc.addUntracked<std::vector<std::string> >("labels",defaultVector);
43  desc.addUntracked<bool>("lockSources",true);
44  descriptions.add("LockService", desc);
45 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
boost::mutex& edm::rootfix::LockService::getLock ( )
inline

Definition at line 39 of file LockService.h.

References lock_.

39 { return lock_; }
boost::mutex & lock_
Definition: LockService.h:58
void LockService::postBeginJob ( )

Definition at line 61 of file LockService.cc.

61  {
62 }
void LockService::postEndJob ( )

Definition at line 64 of file LockService.cc.

64  {
65 }
void LockService::postEventProcessing ( const edm::Event ,
const edm::EventSetup  
)

Definition at line 70 of file LockService.cc.

70  {
71 }
void LockService::postModule ( const edm::ModuleDescription )

Definition at line 93 of file LockService.cc.

References FDEBUG, and locker_.

Referenced by LockService().

93  {
94  FDEBUG(4) << "destroyed a locked in LockService" << std::endl;
95  locker_.reset();
96 }
#define FDEBUG(lev)
Definition: DebugMacros.h:18
boost::shared_ptr< boost::mutex::scoped_lock > locker_
Definition: LockService.h:59
void LockService::postSource ( )

Definition at line 80 of file LockService.cc.

References FDEBUG, and locker_.

Referenced by LockService().

80  {
81  FDEBUG(4) << "destroyed a locked in LockService" << std::endl;
82  locker_.reset();
83 }
#define FDEBUG(lev)
Definition: DebugMacros.h:18
boost::shared_ptr< boost::mutex::scoped_lock > locker_
Definition: LockService.h:59
void LockService::postSourceConstruction ( const edm::ModuleDescription )

Definition at line 56 of file LockService.cc.

References FDEBUG, and locker_.

Referenced by LockService().

56  {
57  FDEBUG(4) << "destroyed a locked in LockService" << std::endl;
58  locker_.reset();
59 }
#define FDEBUG(lev)
Definition: DebugMacros.h:18
boost::shared_ptr< boost::mutex::scoped_lock > locker_
Definition: LockService.h:59
void LockService::preEventProcessing ( const edm::EventID ,
const edm::Timestamp  
)

Definition at line 67 of file LockService.cc.

67  {
68 }
void LockService::preModule ( const edm::ModuleDescription desc)

Definition at line 85 of file LockService.cc.

References FDEBUG, spr::find(), labels_, lock_, locker_, and edm::ModuleDescription::moduleLabel().

Referenced by LockService().

85  {
86  if(!labels_.empty() && find(labels_.begin(), labels_.end(), desc.moduleLabel()) != labels_.end()) {
87  //search_all(labels_, desc.moduleLabel()))
88  FDEBUG(4) << "made a new locked in LockService" << std::endl;
89  locker_.reset(new boost::mutex::scoped_lock(lock_));
90  }
91 }
#define FDEBUG(lev)
Definition: DebugMacros.h:18
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::string const & moduleLabel() const
boost::shared_ptr< boost::mutex::scoped_lock > locker_
Definition: LockService.h:59
boost::mutex & lock_
Definition: LockService.h:58
void LockService::preSource ( )

Definition at line 73 of file LockService.cc.

References FDEBUG, lock_, locker_, and lockSources_.

Referenced by LockService().

73  {
74  if(lockSources_) {
75  FDEBUG(4) << "made a new locked in LockService" << std::endl;
76  locker_.reset(new boost::mutex::scoped_lock(lock_));
77  }
78 }
#define FDEBUG(lev)
Definition: DebugMacros.h:18
boost::shared_ptr< boost::mutex::scoped_lock > locker_
Definition: LockService.h:59
boost::mutex & lock_
Definition: LockService.h:58
void LockService::preSourceConstruction ( const edm::ModuleDescription desc)

Definition at line 47 of file LockService.cc.

References FDEBUG, spr::find(), labels_, lock_, locker_, and edm::ModuleDescription::moduleLabel().

Referenced by LockService().

47  {
48  if(!labels_.empty() &&
49  find(labels_.begin(), labels_.end(), desc.moduleLabel()) != labels_.end()) {
50  //search_all(labels_, desc.moduleLabel()))
51  FDEBUG(4) << "made a new locked in LockService" << std::endl;
52  locker_.reset(new boost::mutex::scoped_lock(lock_));
53  }
54 }
#define FDEBUG(lev)
Definition: DebugMacros.h:18
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::string const & moduleLabel() const
boost::shared_ptr< boost::mutex::scoped_lock > locker_
Definition: LockService.h:59
boost::mutex & lock_
Definition: LockService.h:58

Member Data Documentation

Labels edm::rootfix::LockService::labels_
private

Definition at line 61 of file LockService.h.

Referenced by preModule(), and preSourceConstruction().

boost::mutex& edm::rootfix::LockService::lock_
private

Definition at line 58 of file LockService.h.

Referenced by getLock(), preModule(), preSource(), and preSourceConstruction().

boost::shared_ptr<boost::mutex::scoped_lock> edm::rootfix::LockService::locker_
private
bool edm::rootfix::LockService::lockSources_
private

Definition at line 62 of file LockService.h.

Referenced by preSource().