OpenDDS  Snapshot(2023/04/28-20:55)
EventDispatcher.cpp
Go to the documentation of this file.
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 
13 
14 namespace OpenDDS {
15 namespace DCPS {
16 
18 {
19 }
20 
22 {
23 }
24 
26 {
27 }
28 
30 {
31  try {
32  handle_event();
33  } catch (...) {
34  handle_error();
35  }
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  this->_remove_ref();
44 }
45 
47 {
48 }
49 
51 {
52 }
53 
54 } // DCPS
55 } // OpenDDS
56 
virtual void handle_error()
Only called when an exception is caught during handle_event.
virtual void _remove_ref()
Definition: RcObject.h:74
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
virtual void handle_event()=0
Called when the event is dispatched by an EventDispatcher.
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28