CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes | Friends
evf::FastMonitoringThread Class Reference

#include <FastMonitoringThread.h>

Classes

struct  MonitorData
 

Public Member Functions

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

Private Attributes

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

Friends

class FastMonitoringService
 

Detailed Description

Definition at line 119 of file FastMonitoringThread.h.

Constructor & Destructor Documentation

◆ FastMonitoringThread()

evf::FastMonitoringThread::FastMonitoringThread ( )
inline

Definition at line 228 of file FastMonitoringThread.h.

228 : m_stoprequest(false) {}

◆ ~FastMonitoringThread()

evf::FastMonitoringThread::~FastMonitoringThread ( )
inline

Definition at line 249 of file FastMonitoringThread.h.

249 { stop(); }

References stop().

Member Function Documentation

◆ resetFastMonitor()

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

Definition at line 230 of file FastMonitoringThread.h.

230  {
231  std::string defGroup = "data";
232  jsonMonitor_ = std::make_unique<jsoncollector::FastMonitor>(microStateDefPath, defGroup, false);
233  if (!fastMicroStateDefPath.empty())
234  jsonMonitor_->addFastPathDefinition(fastMicroStateDefPath, defGroup, false);
235  }

References jsonMonitor_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ start()

void evf::FastMonitoringThread::start ( void(FastMonitoringService::*)()  fp,
FastMonitoringService cp 
)
inline

Definition at line 237 of file FastMonitoringThread.h.

237  {
238  assert(!m_thread);
239  m_thread = std::make_shared<std::thread>(fp, cp);
240  }

References cms::cuda::assert(), personalPlayback::fp, and m_thread.

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

◆ stop()

void evf::FastMonitoringThread::stop ( )
inline

Definition at line 241 of file FastMonitoringThread.h.

241  {
242  if (m_thread.get()) {
243  m_stoprequest = true;
244  m_thread->join();
245  m_thread.reset();
246  }
247  }

References m_stoprequest, and m_thread.

Referenced by ~FastMonitoringThread().

Friends And Related Function Documentation

◆ FastMonitoringService

friend class FastMonitoringService
friend

Definition at line 259 of file FastMonitoringThread.h.

Member Data Documentation

◆ jsonMonitor_

std::unique_ptr<jsoncollector::FastMonitor> evf::FastMonitoringThread::jsonMonitor_
private

Definition at line 257 of file FastMonitoringThread.h.

Referenced by resetFastMonitor().

◆ m_data

MonitorData evf::FastMonitoringThread::m_data
private

Definition at line 254 of file FastMonitoringThread.h.

◆ m_stoprequest

std::atomic<bool> evf::FastMonitoringThread::m_stoprequest
private

Definition at line 252 of file FastMonitoringThread.h.

Referenced by stop().

◆ m_thread

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

Definition at line 253 of file FastMonitoringThread.h.

Referenced by start(), and stop().

◆ monlock_

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

Definition at line 255 of file FastMonitoringThread.h.

cms::cuda::assert
assert(be >=bs)
personalPlayback.fp
fp
Definition: personalPlayback.py:523
hgcal_conditions::parameters
Definition: HGCConditions.h:86
evf::FastMonitoringThread::stop
void stop()
Definition: FastMonitoringThread.h:241
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
evf::FastMonitoringThread::m_stoprequest
std::atomic< bool > m_stoprequest
Definition: FastMonitoringThread.h:252
evf::FastMonitoringThread::m_thread
std::shared_ptr< std::thread > m_thread
Definition: FastMonitoringThread.h:253
evf::FastMonitoringThread::jsonMonitor_
std::unique_ptr< jsoncollector::FastMonitor > jsonMonitor_
Definition: FastMonitoringThread.h:257