LCOV - code coverage report
Current view: top level - DCPS - EventDispatcher.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 15 17 88.2 %
Date: 2023-04-30 01:32:43 Functions: 5 11 45.5 %

          Line data    Source code
       1             : /*
       2             :  *
       3             :  *
       4             :  * Distributed under the OpenDDS License.
       5             :  * See: http://www.opendds.org/license.html
       6             :  */
       7             : 
       8             : #include "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/
       9             : 
      10             : #include "EventDispatcher.h"
      11             : 
      12             : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
      13             : 
      14             : namespace OpenDDS {
      15             : namespace DCPS {
      16             : 
      17          34 : EventBase::~EventBase()
      18             : {
      19          34 : }
      20             : 
      21           0 : void EventBase::handle_error()
      22             : {
      23           0 : }
      24             : 
      25          16 : void EventBase::handle_cancel()
      26             : {
      27          16 : }
      28             : 
      29        2120 : void EventBase::operator()()
      30             : {
      31             :   try {
      32        2120 :     handle_event();
      33           1 :   } catch (...) {
      34           1 :     handle_error();
      35           1 :   }
      36             :   // In order to avoid extra allocations for containers of RcHandle<EventBase>
      37             :   // implementations of EventDispatcher will increase the reference count of
      38             :   // all queued EventBase objects, and decrement them when they are dispatched
      39             :   // or canceled.
      40             :   // Since the EventDispatcher does not directly hold copies of the events,
      41             :   // decrementing the reference count after a normal dispatch currently needs
      42             :   // to happen here in the call to EventBase::operator()() after handle_event.
      43        2120 :   this->_remove_ref();
      44        2120 : }
      45             : 
      46          29 : EventDispatcher::EventDispatcher()
      47             : {
      48          29 : }
      49             : 
      50          29 : EventDispatcher::~EventDispatcher()
      51             : {
      52          29 : }
      53             : 
      54             : } // DCPS
      55             : } // OpenDDS
      56             : 
      57             : OPENDDS_END_VERSIONED_NAMESPACE_DECL

Generated by: LCOV version 1.16