$treeview $search $mathjax $extrastylesheet
artdaq
v3_04_01
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef artdaq_ArtModules_NetMonWrapper_hh 00002 #define artdaq_ArtModules_NetMonWrapper_hh 00003 00004 00005 #include "artdaq/ArtModules/NetMonTransportService.h" 00006 00007 #include "art/Framework/Services/Registry/ServiceHandle.h" 00008 #include "artdaq-core/Utilities/ExceptionHandler.hh" 00009 #include "fhiclcpp/fwd.h" 00010 00011 #include <TBufferFile.h> 00012 00013 #include <string> 00014 #include <memory> 00015 00016 namespace art 00017 { 00027 class NetMonWrapper 00028 { 00029 public: 00030 00035 NetMonWrapper(const fhicl::ParameterSet& pset) 00036 { 00037 ServiceHandle<NetMonTransportService> transport; 00038 transport->listen(); 00039 00040 try { 00041 if (metricMan) 00042 { 00043 metricMan->initialize(pset.get<fhicl::ParameterSet>("metrics", fhicl::ParameterSet()), app_name); 00044 metricMan->do_start(); 00045 } 00046 } 00047 catch (...) 00048 { 00049 artdaq::ExceptionHandler(artdaq::ExceptionHandlerRethrow::no, "Error loading metrics in NetMonWrapper"); 00050 } 00051 } 00052 00056 ~NetMonWrapper() 00057 { 00058 ServiceHandle<NetMonTransportService> transport; 00059 transport->disconnect(); 00060 artdaq::Globals::CleanUpGlobals(); 00061 } 00062 00067 void receiveMessage(std::unique_ptr<TBufferFile>& msg); 00068 00073 void receiveInitMessage(std::unique_ptr<TBufferFile>& msg); 00074 }; 00075 } 00076 00077 #endif /* artdaq_ArtModules_NetMonWrapper_hh */