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 102 of file FastMonitoringThread.h.

102  : m_stoprequest(false) {
103  }
std::atomic< bool > m_stoprequest

Member Function Documentation

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

Definition at line 105 of file FastMonitoringThread.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

105  {
106  std::string defGroup = "data";
107  jsonMonitor_.reset(new FastMonitor(microStateDefPath,defGroup,false));
108  if (fastMicroStateDefPath.size())
109  jsonMonitor_->addFastPathDefinition(fastMicroStateDefPath,defGroup,false);
110  }
std::unique_ptr< FastMonitor > jsonMonitor_
void evf::FastMonitoringThread::start ( void(FastMonitoringService::*)()  fp,
FastMonitoringService cp 
)
inline

Definition at line 112 of file FastMonitoringThread.h.

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

112  {
113  assert(!m_thread);
114  m_thread = boost::shared_ptr<std::thread>(new std::thread(fp,cp));
115  }
boost::shared_ptr< std::thread > m_thread
void evf::FastMonitoringThread::stop ( )
inline

Definition at line 116 of file FastMonitoringThread.h.

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

116  {
117  assert(m_thread);
118  m_stoprequest=true;
119  m_thread->join();
120  }
boost::shared_ptr< std::thread > m_thread
std::atomic< bool > m_stoprequest

Friends And Related Function Documentation

friend class FastMonitoringService
friend

Definition at line 131 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 124 of file FastMonitoringThread.h.

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

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

Definition at line 125 of file FastMonitoringThread.h.

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