diff options
author | john_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-19 22:14:54 +0000 |
---|---|---|
committer | john_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-19 22:14:54 +0000 |
commit | adaaf3a4108d172f5fe517da3836e5625f819759 (patch) | |
tree | eede6298a1baa4cbfe0b8d96d1c3e5efa0b767e3 /TAO/orbsvcs/orbsvcs/Notify/Event.cpp | |
parent | ff8a8def6d0c5e3fae7b3512bb7e80ab82697783 (diff) | |
download | ATCD-adaaf3a4108d172f5fe517da3836e5625f819759.tar.gz |
Thu Nov 18 12:39:59 2004 Ciju John <john_c@ociweb.com>
Fri Oct 29 10:53:56 2004 Dale Wilson <wilson_d@ociweb.com>
Wed Oct 27 11:59:01 2004 Dale Wilson <wilson_d@ociweb.com>
Mon Oct 25 20:41:00 2004 Dale Wilson <wilson_d@ociweb.com>
Mon Oct 25 14:51:09 2004 Dale Wilson <wilson_d@ociweb.com>
Wed Oct 20 11:38:11 2004 Dale Wilson <wilson_d@ociweb.com>
Tue Oct 19 10:43:28 2004 Dale Wilson <wilson_d@ociweb.com>
Mon Oct 18 15:21:49 2004 Dale Wilson <wilson_d@ociweb.com>
Mon Oct 18 10:29:48 2004 Dale Wilson <wilson_d@ociweb.com>
Mon Oct 18 10:11:47 2004 Dale Wilson <wilson_d@ociweb.com>
Tue Oct 12 14:10:43 2004 Dale Wilson <wilson_d@ociweb.com>
Mon Oct 11 14:39:15 2004 Dale Wilson <wilson_d@ociweb.com>
Thu Oct 7 09:40:51 2004 Dale Wilson <wilson_d@ociweb.com>
Mon Oct 18 13:02:11 2004 Dale Wilson <wilson_d@ociweb.com>
ed Oct 13 15:44:58 2004 Dale Wilson <wilson_d@ociweb.com>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/Event.cpp')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/Event.cpp | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event.cpp index b731ccf5f4d..b9c21374693 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Event.cpp @@ -6,16 +6,22 @@ #include "Event.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID (Notify, - TAO_Notify_Event, +ACE_RCSID (Notify, + TAO_Notify_Event, "$Id$") #include "tao/debug.h" +#include "tao/CDR.h" #include "orbsvcs/CosNotificationC.h" +// NOTE: unfortunately we must know about derived types to implement unmarshal +#include "Any/AnyEvent.h" +#include "Structured/StructuredEvent.h" TAO_Notify_Event::TAO_Notify_Event (void) :priority_ (CosNotification::Priority, CosNotification::DefaultPriority), - timeout_ (CosNotification::Timeout) + timeout_ (CosNotification::Timeout), + reliable_ (false), + event_on_heap_ (0) { // if (TAO_debug_level > 0) // ACE_DEBUG ((LM_DEBUG,"event:%x created\n", this )); @@ -26,6 +32,11 @@ TAO_Notify_Event::~TAO_Notify_Event () // if (TAO_debug_level > 1) // ACE_DEBUG ((LM_DEBUG,"event:%x destroyed\n", this )); } +void +TAO_Notify_Event::release (void) +{ + delete this; +} void TAO_Notify_Event::translate (const CORBA::Any& any, CosNotification::StructuredEvent& notification) @@ -40,11 +51,37 @@ TAO_Notify_Event::translate (const CosNotification::StructuredEvent& notificatio { any <<= notification; // is the typecode set by this operation or do we need to set it explicity. } +/// Unmarshal an event from a CDR. (for persistence) +//static +TAO_Notify_Event * +TAO_Notify_Event::unmarshal (TAO_InputCDR & cdr) +{ + TAO_Notify_Event * result = 0; + ACE_CDR::Octet code = 0; + if (cdr.read_octet (code)) + { + switch (code) + { + case MARSHAL_ANY: + result = TAO_Notify_AnyEvent::unmarshal (cdr); + break; + case MARSHAL_STRUCTURED: + result = TAO_Notify_StructuredEvent::unmarshal (cdr); + break; + default: + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) TAO_Notify_Event::unmarshal: unknown event code %d\n"), + code)); + break; + } + } + return result; +} #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Auto_Basic_Ptr<TAO_Notify_Event>; -template class ACE_Refcounted_Auto_Ptr<const TAO_Notify_Event, TAO_SYNCH_MUTEX>; +template class TAO_Notify_Refcountable_Guard_T<TAO_Notify_Event>; template class ACE_Unbounded_Queue<TAO_Notify_Event_var>; template class ACE_Node<TAO_Notify_Event_var>; template class ACE_Unbounded_Queue_Iterator<TAO_Notify_Event_var>; @@ -52,7 +89,7 @@ template class ACE_Unbounded_Queue_Iterator<TAO_Notify_Event_var>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_Auto_Basic_Ptr<TAO_Notify_Event> -#pragma instantiate ACE_Refcounted_Auto_Ptr<const TAO_Notify_Event, TAO_SYNCH_MUTEX> +#pragma instantiate TAO_Notify_Refcountable_Guard_T<TAO_Notify_Event>; #pragma instantiate ACE_Unbounded_Queue<TAO_Notify_Event_var> #pragma instantiate ACE_Node<TAO_Notify_Event_var> #pragma instantiate ACE_Unbounded_Queue_Iterator<TAO_Notify_Event_var> |