LCOV - code coverage report
Current view: top level - /opt/artdaq/srcs/artdaq-mfextensions/ErrorHandler/MessageAnalyzer - ma_timing_event.h (source / functions) Coverage Total Hit
Test: artdaq.info.cleaned Lines: 0.0 % 11 0
Test Date: 2025-09-04 00:45:34 Functions: 0.0 % 8 0

            Line data    Source code
       1              : #ifndef ERROR_HANDLER_MA_TIMING_EVENT_H
       2              : #define ERROR_HANDLER_MA_TIMING_EVENT_H
       3              : 
       4              : #include <boost/thread/mutex.hpp>
       5              : #include <queue>
       6              : #include "ErrorHandler/MessageAnalyzer/ma_types.h"
       7              : 
       8              : namespace novadaq {
       9              : namespace errorhandler {
      10              : 
      11              : class ma_condition;
      12              : 
      13              : class ma_timing_event
      14              : {
      15              : public:
      16            0 :         ma_timing_event(time_t t, ma_condition& c, size_t src, size_t tgt)
      17            0 :             : ts(t), cond(&c), s_idx(src), t_idx(tgt) {}
      18              : 
      19            0 :         time_t timestamp() const { return ts; }
      20            0 :         ma_condition& condition() const { return *cond; }
      21            0 :         size_t source_idx() const { return s_idx; }
      22            0 :         size_t target_idx() const { return t_idx; }
      23              : 
      24              : private:
      25              :         time_t ts;
      26              :         ma_condition* cond;
      27              :         size_t s_idx;
      28              :         size_t t_idx;
      29              : };
      30              : 
      31              : struct ma_timing_event_order
      32              : {
      33            0 :         bool operator()(ma_timing_event const& e1, ma_timing_event const& e2) const
      34              :         {
      35            0 :                 return e1.timestamp() > e2.timestamp();
      36              :         }
      37              : };
      38              : 
      39              : typedef std::priority_queue<ma_timing_event, std::vector<ma_timing_event>, ma_timing_event_order> event_queue_t;
      40              : 
      41              : class ma_timing_events
      42              : {
      43              : public:
      44            0 :         ma_timing_events()
      45            0 :             : queue(), lock() {}
      46              : 
      47              :         event_queue_t const& event_queue() const { return queue; }
      48            0 :         event_queue_t& event_queue() { return queue; }
      49              : 
      50              : private:
      51              :         event_queue_t queue;
      52              : 
      53              : public:
      54              :         boost::mutex lock;
      55              : };
      56              : 
      57              : }  // namespace errorhandler
      58              : }  // namespace novadaq
      59              : 
      60              : #endif
        

Generated by: LCOV version 2.0-1