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 14 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().

15  :
17  locker_(),
18  labels_(iPS.getUntrackedParameter<Labels>("labels")),
19  lockSources_(iPS.getUntrackedParameter<bool>("lockSources"))
20 {
23 
24  // reg.watchPostBeginJob(this,&LockService::postBeginJob);
25  // reg.watchPostEndJob(this,&LockService::postEndJob);
26 
27  // reg.watchPreProcessEvent(this,&LockService::preEventProcessing);
28  // reg.watchPostProcessEvent(this,&LockService::postEventProcessing);
31 
34 
35  FDEBUG(4) << "In LockServices" << std::endl;
36 }
T getUntrackedParameter(std::string const &, T const &) const
void preModule(const edm::ModuleDescription &)
Definition: LockService.cc:101
void preSourceConstruction(const edm::ModuleDescription &)
Definition: LockService.cc:53
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:64
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:112
LockService::~LockService ( )

Definition at line 39 of file LockService.cc.

40 {
41 }

Member Function Documentation

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

Definition at line 43 of file LockService.cc.

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

44 {
46  std::vector<std::string> defaultVector;
47  desc.addUntracked<std::vector<std::string> >("labels",defaultVector);
48  desc.addUntracked<bool>("lockSources",true);
49  descriptions.add("LockService", desc);
50 }
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 70 of file LockService.cc.

71 {
72 }
void LockService::postEndJob ( )

Definition at line 74 of file LockService.cc.

75 {
76 }
void LockService::postEventProcessing ( const edm::Event e,
const edm::EventSetup  
)

Definition at line 83 of file LockService.cc.

84 {
85 }
void LockService::postModule ( const edm::ModuleDescription desc)

Definition at line 112 of file LockService.cc.

References FDEBUG, and locker_.

Referenced by LockService().

113 {
114  FDEBUG(4) << "destroyed a locked in LockService" << std::endl;
115  locker_.reset();
116 }
#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 95 of file LockService.cc.

References FDEBUG, and locker_.

Referenced by LockService().

96 {
97  FDEBUG(4) << "destroyed a locked in LockService" << std::endl;
98  locker_.reset();
99 }
#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 desc)

Definition at line 64 of file LockService.cc.

References FDEBUG, and locker_.

Referenced by LockService().

65 {
66  FDEBUG(4) << "destroyed a locked in LockService" << std::endl;
67  locker_.reset();
68 }
#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 iID,
const edm::Timestamp iTime 
)

Definition at line 78 of file LockService.cc.

80 {
81 }
void LockService::preModule ( const edm::ModuleDescription desc)

Definition at line 101 of file LockService.cc.

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

Referenced by LockService().

102 {
103  if(!labels_.empty() &&
104  find(labels_.begin(), labels_.end(), desc.moduleLabel()) != labels_.end())
105  //search_all(labels_, desc.moduleLabel()))
106  {
107  FDEBUG(4) << "made a new locked in LockService" << std::endl;
108  locker_.reset(new boost::mutex::scoped_lock(lock_));
109  }
110 }
#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 86 of file LockService.cc.

References FDEBUG, lock_, locker_, and lockSources_.

Referenced by LockService().

87 {
88  if(lockSources_)
89  {
90  FDEBUG(4) << "made a new locked in LockService" << std::endl;
91  locker_.reset(new boost::mutex::scoped_lock(lock_));
92  }
93 }
#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 53 of file LockService.cc.

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

Referenced by LockService().

54 {
55  if(!labels_.empty() &&
56  find(labels_.begin(), labels_.end(), desc.moduleLabel()) != labels_.end())
57  //search_all(labels_, desc.moduleLabel()))
58  {
59  FDEBUG(4) << "made a new locked in LockService" << std::endl;
60  locker_.reset(new boost::mutex::scoped_lock(lock_));
61  }
62 }
#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().