CMS 3D CMS Logo

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

#include <FastMonitoringThread.h>

Classes

struct  MonitorData
 

Public Types

enum  Macrostate {
  sInit = 0, sJobReady, sRunGiven, sRunning,
  sStopping, sShuttingDown, sDone, sJobEnded,
  sError, sErrorEnded, sEnd, sInvalid,
  MCOUNT
}
 

Public Member Functions

 FastMonitoringThread ()
 
void resetFastMonitor (std::string const &microStateDefPath, std::string const &fastMicroStateDefPath)
 
void start (void(FastMonitoringService::*fp)(), FastMonitoringService *cp)
 
void stop ()
 

Private Attributes

std::unique_ptr< FastMonitorjsonMonitor_
 
MonitorData m_data
 
std::atomic< bool > m_stoprequest
 
boost::shared_ptr< std::thread > m_thread
 
std::mutex monlock_
 

Friends

class FastMonitoringService
 

Detailed Description

Definition at line 17 of file FastMonitoringThread.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

evf::FastMonitoringThread::FastMonitoringThread ( )
inline

Definition at line 110 of file FastMonitoringThread.h.

110  : m_stoprequest(false) {
111  }
std::atomic< bool > m_stoprequest

Member Function Documentation

void evf::FastMonitoringThread::resetFastMonitor ( std::string const &  microStateDefPath,
std::string const &  fastMicroStateDefPath 
)
inline

Definition at line 113 of file FastMonitoringThread.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by evf::FastMonitoringService::preallocate().

113  {
114  std::string defGroup = "data";
115  jsonMonitor_.reset(new FastMonitor(microStateDefPath,defGroup,false));
116  if (fastMicroStateDefPath.size())
117  jsonMonitor_->addFastPathDefinition(fastMicroStateDefPath,defGroup,false);
118  }
std::unique_ptr< FastMonitor > jsonMonitor_
void evf::FastMonitoringThread::start ( void(FastMonitoringService::*)()  fp,
FastMonitoringService cp 
)
inline

Definition at line 120 of file FastMonitoringThread.h.

References assert().

Referenced by progressbar.ProgressBar::__next__(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), and evf::FastMonitoringService::preallocate().

120  {
121  assert(!m_thread);
122  m_thread = boost::shared_ptr<std::thread>(new std::thread(fp,cp));
123  }
assert(m_qm.get())
boost::shared_ptr< std::thread > m_thread
void evf::FastMonitoringThread::stop ( )
inline

Definition at line 124 of file FastMonitoringThread.h.

References assert().

Referenced by evf::FastMonitoringService::postEndJob().

124  {
125  assert(m_thread);
126  m_stoprequest=true;
127  m_thread->join();
128  }
assert(m_qm.get())
boost::shared_ptr< std::thread > m_thread
std::atomic< bool > m_stoprequest

Friends And Related Function Documentation

friend class FastMonitoringService
friend

Definition at line 139 of file FastMonitoringThread.h.

Member Data Documentation

std::unique_ptr<FastMonitor> evf::FastMonitoringThread::jsonMonitor_
private
MonitorData evf::FastMonitoringThread::m_data
private
std::atomic<bool> evf::FastMonitoringThread::m_stoprequest
private

Definition at line 132 of file FastMonitoringThread.h.

Referenced by evf::FastMonitoringService::dowork().

boost::shared_ptr<std::thread> evf::FastMonitoringThread::m_thread
private

Definition at line 133 of file FastMonitoringThread.h.

std::mutex evf::FastMonitoringThread::monlock_
private