summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/RtEC/test_driver/Timer_Event_Handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/examples/RtEC/test_driver/Timer_Event_Handler.cpp')
-rw-r--r--TAO/orbsvcs/examples/RtEC/test_driver/Timer_Event_Handler.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/Timer_Event_Handler.cpp b/TAO/orbsvcs/examples/RtEC/test_driver/Timer_Event_Handler.cpp
new file mode 100644
index 00000000000..861fb06573f
--- /dev/null
+++ b/TAO/orbsvcs/examples/RtEC/test_driver/Timer_Event_Handler.cpp
@@ -0,0 +1,31 @@
+// $Id$
+
+#include "Timer_Event_Handler.h"
+#include "TimeoutConsumer.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+Timer_Event_Handler::Timer_Event_Handler (TimeoutConsumer* cons)
+ : _consumer(cons)
+{
+}
+
+int
+Timer_Event_Handler::handle_timeout (const ACE_Time_Value &tv,
+ const void* arg)
+{
+ ACE_UNUSED_ARG(tv);
+ ACE_UNUSED_ARG(arg);
+
+ RtecEventComm::EventSet event(1);
+ event.length(1);
+
+ event[0].header.type = ACE_ES_EVENT_INTERVAL_TIMEOUT;
+ event[0].header.source = ACE_ES_EVENT_UNDEFINED; //for now, fake the supplier ID
+ event[0].header.ttl = 1;
+
+ //need to create ACE_ENV, since one isn't passed into this function
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->_consumer->push(event ACE_ENV_ARG_PARAMETER);
+
+ return 0;
+}