From 3be9a18e65c1881adcbc6117a694105192ba69f8 Mon Sep 17 00:00:00 2001 From: wilson_d Date: Tue, 19 Oct 2004 16:01:33 +0000 Subject: ChangeLogTag: Tue Oct 19 10:43:28 2004 Dale Wilson --- TAO/ChangeLog_pnotify | 78 +++++++++++++++++++++ TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp | 53 ++++++++++---- TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h | 20 ++++-- TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp | 3 +- TAO/orbsvcs/orbsvcs/Notify/Consumer.h | 5 +- TAO/orbsvcs/orbsvcs/Notify/Consumer.inl | 37 +--------- TAO/orbsvcs/orbsvcs/Notify/Event.cpp | 46 ++++++++++-- TAO/orbsvcs/orbsvcs/Notify/Event.h | 45 +++++++++--- TAO/orbsvcs/orbsvcs/Notify/Event.inl | 12 +++- .../orbsvcs/Notify/Method_Request_Dispatch.cpp | 16 +++-- .../orbsvcs/Notify/Method_Request_Dispatch.h | 39 +++++------ .../Notify/Method_Request_Dispatch_Base.cpp | 72 +++++++++++++++++++ .../orbsvcs/Notify/Method_Request_Dispatch_Base.h | 67 ++++++++++++++++++ .../Notify/Method_Request_Dispatch_Base.inl | 2 + .../orbsvcs/Notify/Method_Request_Dispatch_T.cpp | 27 -------- .../orbsvcs/Notify/Method_Request_Dispatch_T.h | 73 ------------------- .../orbsvcs/Notify/Method_Request_Dispatch_T.inl | 48 ------------- .../orbsvcs/Notify/Method_Request_Lookup.cpp | 16 +++-- TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h | 30 +++++--- .../orbsvcs/Notify/Method_Request_Lookup_Base.cpp | 81 ++++++++++++++++++++++ .../orbsvcs/Notify/Method_Request_Lookup_Base.h | 62 +++++++++++++++++ .../orbsvcs/Notify/Method_Request_Lookup_Base.inl | 2 + .../orbsvcs/Notify/Method_Request_Lookup_T.cpp | 31 --------- .../orbsvcs/Notify/Method_Request_Lookup_T.h | 68 ------------------ .../orbsvcs/Notify/Method_Request_Lookup_T.inl | 51 -------------- TAO/orbsvcs/orbsvcs/Notify/Proxy.h | 8 --- TAO/orbsvcs/orbsvcs/Notify/Proxy.inl | 9 --- TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp | 29 +------- TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h | 14 ++-- TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h | 5 +- .../orbsvcs/Notify/Refcountable_Guard_T.inl | 18 ++++- .../Notify/Sequence/SequencePushConsumer.cpp | 10 +-- .../orbsvcs/Notify/Sequence/SequencePushConsumer.h | 2 +- .../orbsvcs/Notify/Structured/StructuredEvent.cpp | 32 ++++++++- .../orbsvcs/Notify/Structured/StructuredEvent.h | 16 ++++- .../Notify/Structured/StructuredPushConsumer.cpp | 6 -- .../Notify/Structured/StructuredPushConsumer.h | 3 - 37 files changed, 647 insertions(+), 489 deletions(-) create mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.cpp create mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.h create mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.inl delete mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp delete mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h delete mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl create mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.cpp create mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.h create mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.inl delete mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp delete mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h delete mode 100644 TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl diff --git a/TAO/ChangeLog_pnotify b/TAO/ChangeLog_pnotify index c80fb2cb3b6..6583ba3a56d 100644 --- a/TAO/ChangeLog_pnotify +++ b/TAO/ChangeLog_pnotify @@ -1,3 +1,81 @@ +Tue Oct 19 10:43:28 2004 Dale Wilson + + * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h: + * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl: + * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp: + * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h: + * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl: + * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp: + Removed these files. + Replacing template-based with inheritence-based copy managament. + The problem with a template based approach (other than the + obscurity of overloading methods based on raw vs smart + pointer (some comments would have been nice!)) is the + source code explosion. Because the distinction + between Event * and Event_var is meaningful, every stage of the + process has to provide (at least) two methods to preserve this + distinction even when this stage doesn't care. + This became a problem in adding event persistence because it + meant that the event persistence stuff would also have to preserve + this "state-by-pointer-type" info. + + * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.h: + * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.inl: + * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.cpp: + * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.h: + * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.inl: + * orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.cpp: + Added these files. + + + * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h: + * orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp: + * orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h: + * orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp: + Now derived from *_Base rather than _T + + + * orbsvcs/orbsvcs/Notify/Any/AnyEvent.h: + * orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp: + * orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h: + * orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp: + * orbsvcs/orbsvcs/Notify/Event.h: + * orbsvcs/orbsvcs/Notify/Event.inl: + * orbsvcs/orbsvcs/Notify/Event.cpp: + The distinction that the templates were attempting to preserve + was whether or not the event had been copied to the heap. + The goal was to keep the event on the stack as long as possible, + but make a copy on the heap when it became necessary to queue the + event for later processing or for another thread. + + This is now handled by providing a virtual "Event::copy_on_heap" method. + A event on the stack makes a copy and returns a pointer to it. + A event on the heap just returns a pointer to itself. + + * orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h: + * orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl: + The pointer to events was based on Refcountable_Auto_Ptr which is + not smart enough to have two pointers to the same object unless one + was created from the other. Event was changed to be a Refcountable + object and Refcountable_Guard was extended to allow null pointers, + thereby allowing it to be contained in a collection. Asserts protect + null Refcountable_Guards from misuse. + + * orbsvcs/orbsvcs/Notify/Consumer.h: + * orbsvcs/orbsvcs/Notify/Consumer.inl: + * orbsvcs/orbsvcs/Notify/Consumer.cpp: + * orbsvcs/orbsvcs/Notify/Proxy.h: + * orbsvcs/orbsvcs/Notify/Proxy.inl: + * orbsvcs/orbsvcs/Notify/ProxySupplier.h: + * orbsvcs/orbsvcs/Notify/ProxySupplier.cpp: + * orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h: + * orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp: + * orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h: + * orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp: + Eliminate overridden-by-pointer-type methods that are + no longer needed. Use copy_on_heap when necessary. + + Mon Oct 18 15:21:49 2004 Dale Wilson * orbsvcs/orbsvcs/Notify/Buffering_Strategy.h: diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp index c8c2464998c..7dc4fc893b2 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp @@ -22,18 +22,6 @@ TAO_Notify_AnyEvent_No_Copy::~TAO_Notify_AnyEvent_No_Copy () { } -TAO_Notify_Event* -TAO_Notify_AnyEvent_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) const -{ - TAO_Notify_Event* copy; - - ACE_NEW_THROW_EX (copy, - TAO_Notify_AnyEvent (*this->event_), - CORBA::NO_MEMORY ()); - - return copy; -} - const TAO_Notify_EventType& TAO_Notify_AnyEvent_No_Copy::type (void) const { @@ -98,6 +86,40 @@ TAO_Notify_AnyEvent_No_Copy::push_no_filtering (Event_Forwarder::ProxyPushSuppli forwarder->forward_any_no_filtering (*this->event_ ACE_ENV_ARG_PARAMETER); } +void +TAO_Notify_AnyEvent_No_Copy::marshal (TAO_OutputCDR & cdr) const +{ + static const ACE_CDR::Octet ANY_CODE = MARSHAL_ANY; + cdr.write_octet (ANY_CODE); + cdr << (*this->event_); +} + +//static +TAO_Notify_AnyEvent * +TAO_Notify_AnyEvent_No_Copy::unmarshal (TAO_InputCDR & cdr) +{ + TAO_Notify_AnyEvent * event = 0; + CORBA::Any body; + if (cdr >> body) + { + event = new TAO_Notify_AnyEvent (body); + } + return event; +} + +const TAO_Notify_Event * +TAO_Notify_AnyEvent_No_Copy::copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER) const +{ + TAO_Notify_Event* copy; + + ACE_NEW_THROW_EX (copy, + TAO_Notify_AnyEvent (*this->event_), + CORBA::NO_MEMORY ()); + + return copy; +} + + /*****************************************************************************************************/ TAO_Notify_AnyEvent::TAO_Notify_AnyEvent (const CORBA::Any &event) @@ -110,3 +132,10 @@ TAO_Notify_AnyEvent::TAO_Notify_AnyEvent (const CORBA::Any &event) TAO_Notify_AnyEvent::~TAO_Notify_AnyEvent () { } + +const TAO_Notify_Event * +TAO_Notify_AnyEvent::copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER) const +{ + return this; +} + diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h index d97e7bc2b7e..676607f134a 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h @@ -26,7 +26,7 @@ #include "orbsvcs/CosNotificationC.h" class TAO_Notify_Consumer; - +class TAO_Notify_AnyEvent; /** * @class TAO_Notify_AnyEvent * @@ -43,9 +43,6 @@ public: /// Destructor ~TAO_Notify_AnyEvent_No_Copy (); - /// Copy the event. - virtual TAO_Notify_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const; - /// Get the event type. virtual const TAO_Notify_EventType& type (void) const; @@ -69,6 +66,18 @@ public: /// Push event to the Event_Forwarder interface virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const; + /// marshal this event into a CDR buffer (for persistence) + virtual void marshal (TAO_OutputCDR & cdr) const; + + /// unmarshal this event from a CDR buffer (for persistence) + /// \param code a code indicating what type of event to create. + /// \param cdr a CDR stream containing the marshalled data for the event. + /// \return the new event, or NULL if this is the wrong type of event. + static TAO_Notify_AnyEvent * unmarshal (TAO_InputCDR & cdr); + + /// returns a copy of this event allocated from the heap + virtual const TAO_Notify_Event * copy_on_heap ()const; + protected: /// Any Event const CORBA::Any* event_; @@ -94,6 +103,9 @@ public: /// Destructor ~TAO_Notify_AnyEvent (); + /// return this + virtual const TAO_Notify_Event * copy_on_heap ()const; + protected: /// Copy of the Event. CORBA::Any any_copy_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp index 84506c169de..b606b81f20a 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp @@ -51,7 +51,8 @@ TAO_Notify_Consumer::dispatch_pending (ACE_ENV_SINGLE_ARG_DECL) { if (event_collection_copy.dequeue_head (event) == 0) { - proxy_supplier->push_no_filtering (event ACE_ENV_ARG_PARAMETER); + // push without filtering + proxy_supplier->push (event.get (), false ACE_ENV_ARG_PARAMETER); } } } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h index bac8a0cbded..3f8241ea871 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h @@ -53,9 +53,6 @@ public: /// Push to this consumer. void push (const TAO_Notify_Event* event ACE_ENV_ARG_DECL); - /// Push to this consumer. - void push (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL); - /// Push to this consumer. virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL) = 0; @@ -84,7 +81,7 @@ protected: virtual void push_i (const TAO_Notify_Event* event ACE_ENV_ARG_DECL) = 0; /// Push Implementation. - virtual void push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL) = 0; +// virtual int push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL) = 0; /// Get the shared Proxy Lock TAO_SYNCH_MUTEX* proxy_lock (void); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl b/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl index 77a5f12c554..64f9f0806de 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl @@ -26,47 +26,14 @@ TAO_Notify_Consumer::suspend (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) this->is_suspended_ = 1; } -ACE_INLINE void -TAO_Notify_Consumer::push (const TAO_Notify_Event_var &event ACE_ENV_ARG_DECL) -{ - if (this->is_suspended_ == 1) // If we're suspended, queue for later delivery. - { - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->proxy_lock ()); - - this->event_collection_->enqueue_head (event); - - return; - } - - ACE_TRY - { - this->push_i (event ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_exist) - { - this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::SystemException, sysex) - { - this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - } - ACE_ENDTRY; -} - ACE_INLINE void TAO_Notify_Consumer::push (const TAO_Notify_Event* event ACE_ENV_ARG_DECL) { if (this->is_suspended_ == 1) // If we're suspended, queue for later delivery. { ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->proxy_lock ()); - - TAO_Notify_Event* event_copy = event->copy (ACE_ENV_SINGLE_ARG_PARAMETER); + const TAO_Notify_Event* event_copy = event->copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; TAO_Notify_Event_Copy_var event_var (event_copy); this->event_collection_->enqueue_head (event_var); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event.cpp index b731ccf5f4d..74c3c8ddbeb 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Event.cpp @@ -6,16 +6,21 @@ #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) { // if (TAO_debug_level > 0) // ACE_DEBUG ((LM_DEBUG,"event:%x created\n", this )); @@ -26,6 +31,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 +50,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; -template class ACE_Refcounted_Auto_Ptr; +template TAO_Notify_Refcountable_Guard_T; template class ACE_Unbounded_Queue; template class ACE_Node; template class ACE_Unbounded_Queue_Iterator; @@ -52,7 +88,7 @@ template class ACE_Unbounded_Queue_Iterator; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_Auto_Basic_Ptr -#pragma instantiate ACE_Refcounted_Auto_Ptr +#pragma instantiate TAO_Notify_Refcountable_Guard_T; #pragma instantiate ACE_Unbounded_Queue #pragma instantiate ACE_Node #pragma instantiate ACE_Unbounded_Queue_Iterator diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.h b/TAO/orbsvcs/orbsvcs/Notify/Event.h index 66a8c40bff3..58f0a7c5ebb 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Event.h @@ -9,8 +9,8 @@ * */ -#ifndef TAO_Notify_EVENT_H -#define TAO_Notify_EVENT_H +#ifndef TAO_NOTIFY_EVENT_H +#define TAO_NOTIFY_EVENT_H #include /**/ "ace/pre.h" @@ -21,13 +21,16 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Copy_Disabled.h" -#include "ace/Refcounted_Auto_Ptr.h" + +#include "Refcountable.h" +#include "Refcountable_Guard_T.h" #include "orbsvcs/Event_ForwarderS.h" #include "orbsvcs/CosNotifyFilterC.h" #include "orbsvcs/CosNotificationC.h" #include "Property.h" +#include "Property_Boolean.h" #include "Property_T.h" class TAO_Notify_Consumer; @@ -39,17 +42,20 @@ class TAO_Notify_EventType; * @brief Base class abstraction for Events flowing through the EventChannel. * */ -class TAO_Notify_Serv_Export TAO_Notify_Event : private ACE_Copy_Disabled +class TAO_Notify_Serv_Export TAO_Notify_Event + : public TAO_Notify_Refcountable + , private ACE_Copy_Disabled { public: + // Codes to distinguish marshaled events in persistent storage + enum {MARSHAL_ANY=1,MARSHAL_STRUCTURED=2}; /// Constuctor TAO_Notify_Event (void); /// Destructor virtual ~TAO_Notify_Event (); - /// Copy the event. - virtual TAO_Notify_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const = 0; + virtual void release (void); /// Translate Any to Structured static void translate (const CORBA::Any& any, CosNotification::StructuredEvent& notification); @@ -81,6 +87,17 @@ public: /// Push event to the Event_Forwarder interface virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0; + /// Return a pointer to a copy of this event on the heap + /// Originals should make a copy to return. + /// Copies may return "this". + virtual const TAO_Notify_Event * copy_on_heap () const = 0; + + /// marshal this event into a CDR buffer (for persistence) + virtual void marshal (TAO_OutputCDR & cdr) const = 0; + + /// Unmarshal an event from a CDR. (for persistence) + static TAO_Notify_Event * unmarshal (TAO_InputCDR & cdr); + ///= Accessors /// Priority const TAO_Notify_Property_Short& priority (void) const; @@ -88,6 +105,9 @@ public: /// Timeout const TAO_Notify_Property_Time& timeout (void) const; + /// Reliable + const TAO_Notify_Property_Boolean& reliable(void) const; + protected: /// = QoS properties @@ -96,9 +116,14 @@ protected: /// Timeout. TAO_Notify_Property_Time timeout_; + + /// Reliability + TAO_Notify_Property_Boolean reliable_; }; -typedef ACE_Refcounted_Auto_Ptr TAO_Notify_Event_var_Base; +//typedef ACE_Refcounted_Auto_Ptr TAO_Notify_Event_var_Base; + +typedef TAO_Notify_Refcountable_Guard_T TAO_Notify_Event_var_Base; /** * @class TAO_Notify_Event_var @@ -114,7 +139,7 @@ public: protected: /// Constructor - TAO_Notify_Event_var (TAO_Notify_Event* event); + TAO_Notify_Event_var (const TAO_Notify_Event* event); }; /** @@ -130,7 +155,7 @@ public: TAO_Notify_Event_Copy_var (void); /// Constructor - TAO_Notify_Event_Copy_var (TAO_Notify_Event* event); + TAO_Notify_Event_Copy_var (const TAO_Notify_Event* event); }; typedef ACE_Unbounded_Queue TAO_Notify_Event_Collection; @@ -141,4 +166,4 @@ typedef ACE_Unbounded_Queue TAO_Notify_Event_Collection; #include /**/ "ace/post.h" -#endif /* TAO_Notify_EVENT_H */ +#endif /* TAO_NOTIFY_EVENT_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.inl b/TAO/orbsvcs/orbsvcs/Notify/Event.inl index 02006440911..b83560f1181 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Event.inl @@ -12,6 +12,12 @@ TAO_Notify_Event::timeout (void) const return this->timeout_; } +ACE_INLINE const TAO_Notify_Property_Boolean& +TAO_Notify_Event::reliable (void) const +{ + return this->reliable_; +} + /**********************************************************/ ACE_INLINE @@ -21,8 +27,8 @@ TAO_Notify_Event_var::TAO_Notify_Event_var (void) } ACE_INLINE -TAO_Notify_Event_var::TAO_Notify_Event_var (TAO_Notify_Event* event) - : TAO_Notify_Event_var_Base (event) +TAO_Notify_Event_var::TAO_Notify_Event_var (const TAO_Notify_Event* event) + : TAO_Notify_Event_var_Base (const_cast (event)) { } @@ -35,7 +41,7 @@ TAO_Notify_Event_Copy_var::TAO_Notify_Event_Copy_var (void) } ACE_INLINE -TAO_Notify_Event_Copy_var::TAO_Notify_Event_Copy_var (TAO_Notify_Event* event) +TAO_Notify_Event_Copy_var::TAO_Notify_Event_Copy_var (const TAO_Notify_Event* event) : TAO_Notify_Event_var (event) { } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp index 4322dbc6f29..9a642718e6d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp @@ -15,7 +15,9 @@ ACE_RCSID(Notify, TAO_Notify_Method_Request_Dispatch, "$Id$") #include "ConsumerAdmin.h" TAO_Notify_Method_Request_Dispatch::TAO_Notify_Method_Request_Dispatch (const TAO_Notify_Event_var& event, TAO_Notify_ProxySupplier* proxy_supplier, CORBA::Boolean filtering) - : TAO_Notify_Method_Request_Dispatch_Base (event, proxy_supplier, filtering) + : TAO_Notify_Method_Request_Dispatch_Base (event.get(), proxy_supplier, filtering) + , event_var_ (event) + , proxy_guard_ (proxy_supplier) { this->init (event); } @@ -33,7 +35,7 @@ TAO_Notify_Method_Request_Dispatch::execute (ACE_ENV_SINGLE_ARG_DECL) /*********************************************************************************************************/ TAO_Notify_Method_Request_Dispatch_No_Copy::TAO_Notify_Method_Request_Dispatch_No_Copy (const TAO_Notify_Event* event, TAO_Notify_ProxySupplier* proxy_supplier, CORBA::Boolean filtering) - : TAO_Notify_Method_Request_Dispatch_No_Copy_Base (event, proxy_supplier, filtering) + : TAO_Notify_Method_Request_Dispatch_Base (event, proxy_supplier, filtering) { } @@ -52,7 +54,7 @@ TAO_Notify_Method_Request_Dispatch_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) { TAO_Notify_Method_Request* request; - TAO_Notify_Event* event_copy = this->event_->copy (ACE_ENV_SINGLE_ARG_PARAMETER); + const TAO_Notify_Event * event_copy = this->event_->copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); TAO_Notify_Event_Copy_var event_var (event_copy); @@ -67,7 +69,8 @@ TAO_Notify_Method_Request_Dispatch_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) /*********************************************************************************************************/ TAO_Notify_Method_Request_Dispatch_No_Copy_Ex::TAO_Notify_Method_Request_Dispatch_No_Copy_Ex (const TAO_Notify_Event_var& event, TAO_Notify_ProxySupplier* proxy_supplier, CORBA::Boolean filtering) - : TAO_Notify_Method_Request_Dispatch_No_Copy_Ex_Base (event, proxy_supplier, filtering) + : TAO_Notify_Method_Request_Dispatch_Base (event.get (), proxy_supplier, filtering) + , event_var_ (event) { } @@ -87,7 +90,10 @@ TAO_Notify_Method_Request_Dispatch_No_Copy_Ex::copy (ACE_ENV_SINGLE_ARG_DECL) TAO_Notify_Method_Request* request; ACE_NEW_THROW_EX (request, - TAO_Notify_Method_Request_Dispatch (this->event_, this->proxy_supplier_, this->filtering_), + TAO_Notify_Method_Request_Dispatch ( + this->event_var_, + this->proxy_supplier_, + this->filtering_), CORBA::INTERNAL ()); return request; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h index 156dadf13e9..f4aaa24a238 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h @@ -21,7 +21,8 @@ #include "Method_Request.h" #include "Refcountable.h" -#include "Method_Request_Dispatch_T.h" +//#include "Method_Request_Dispatch_T.h" +#include "Method_Request_Dispatch_Base.h" #include "ProxySupplier.h" /** @@ -31,13 +32,9 @@ * */ -typedef TAO_Notify_Method_Request_Dispatch_T TAO_Notify_Method_Request_Dispatch_Base; - -class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch : public TAO_Notify_Method_Request_Dispatch_Base - , public TAO_Notify_Method_Request +class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch + : public TAO_Notify_Method_Request_Dispatch_Base + , public TAO_Notify_Method_Request { public: /// Constuctor @@ -48,6 +45,9 @@ public: /// Execute the Request virtual int execute (ACE_ENV_SINGLE_ARG_DECL); +private: + const TAO_Notify_Event_var event_var_; + TAO_Notify_ProxySupplier_Guard proxy_guard_; }; /*******************************************************************************************************/ @@ -58,14 +58,9 @@ public: * @brief Dispatchs an event to a proxy supplier. * */ - -typedef TAO_Notify_Method_Request_Dispatch_T TAO_Notify_Method_Request_Dispatch_No_Copy_Base; - -class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_No_Copy : public TAO_Notify_Method_Request_Dispatch_No_Copy_Base - , public TAO_Notify_Method_Request_No_Copy +class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_No_Copy + : public TAO_Notify_Method_Request_Dispatch_Base + , public TAO_Notify_Method_Request_No_Copy { public: /// Constuctor @@ -90,13 +85,9 @@ public: * */ -typedef TAO_Notify_Method_Request_Dispatch_T TAO_Notify_Method_Request_Dispatch_No_Copy_Ex_Base; - -class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_No_Copy_Ex : public TAO_Notify_Method_Request_Dispatch_No_Copy_Ex_Base - , public TAO_Notify_Method_Request_No_Copy +class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Dispatch_No_Copy_Ex + : public TAO_Notify_Method_Request_Dispatch_Base + , public TAO_Notify_Method_Request_No_Copy { public: /// Constuctor @@ -110,6 +101,8 @@ public: /// Create a copy of this object. virtual TAO_Notify_Method_Request* copy (ACE_ENV_SINGLE_ARG_DECL); +private: + const TAO_Notify_Event_var& event_var_; }; #if defined (__ACE_INLINE__) diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.cpp new file mode 100644 index 00000000000..b3c6f5d75bd --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.cpp @@ -0,0 +1,72 @@ +// $Id$ +#include "Method_Request_Dispatch_Base.h" + +#if ! defined (__ACE_INLINE__) +#include "Method_Request_Dispatch_Base.inl" +#endif /* __ACE_INLINE__ */ + +#include "ConsumerAdmin.h" +#include "Consumer.h" +#include "ProxySupplier.h" + +#include "tao/debug.h" + +ACE_RCSID (Notify, + TAO_Notify_Method_Request_Dispatch_Base, + "$Id$") + + +TAO_Notify_Method_Request_Dispatch_Base::TAO_Notify_Method_Request_Dispatch_Base ( + const TAO_Notify_Event * event, + TAO_Notify_ProxySupplier* proxy_supplier, + bool filtering) + : event_ (event) + , proxy_supplier_ (proxy_supplier) + , filtering_ (filtering) +{ +} + +TAO_Notify_Method_Request_Dispatch_Base::~TAO_Notify_Method_Request_Dispatch_Base () +{ +} + +TAO_Notify_Method_Request_Dispatch_Base::execute_i (ACE_ENV_SINGLE_ARG_DECL) +{ + if (this->proxy_supplier_->has_shutdown ()) + return 0; // If we were shutdown while waiting in the queue, return with no action. + + if (this->filtering_ == 1) + { + TAO_Notify_Admin* parent = this->proxy_supplier_->consumer_admin (); + CORBA::Boolean val = this->proxy_supplier_->check_filters (this->event_, + parent->filter_admin (), + parent->filter_operator () + ACE_ENV_ARG_PARAMETER); + + if (TAO_debug_level > 1) + ACE_DEBUG ((LM_DEBUG, "Proxysupplier %x filter eval result = %d",&this->proxy_supplier_ , val)); + + // Filter failed - do nothing. + if (val == 0) + return 0; + } + + ACE_TRY + { + TAO_Notify_Consumer* consumer = this->proxy_supplier_->consumer (); + + if (consumer != 0) + { + consumer->push (this->event_ ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + } + ACE_CATCHANY + { + if (TAO_debug_level > 0) + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Notify_Method_Request_Dispatch::: error sending event. \n "); + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.h new file mode 100644 index 00000000000..6a20e2ff89f --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.h @@ -0,0 +1,67 @@ +/* -*- C++ -*- */ +/** + * @file Method_Request_Dispatch_Base.h + * + * $Id$ + * + * @author Pradeep Gore + * + * + */ + +#ifndef TAO_Notify_METHOD_REQUEST_DISPATCH_BASE_H +#define TAO_Notify_METHOD_REQUEST_DISPATCH_BASE_H + +#include /**/ "ace/pre.h" + +#include "notify_serv_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/Basic_Types.h" + +#include "ace/CORBA_macros.h" +#include "ProxySupplier.h" + +class TAO_Notify_Event; + +/** + * @class TAO_Notify_Method_Request_Dispatch_Base + * + * @brief + * + */ +class TAO_Notify_Method_Request_Dispatch_Base +{ +public: + /// Constuctor + TAO_Notify_Method_Request_Dispatch_Base (const TAO_Notify_Event *, + TAO_Notify_ProxySupplier* proxy, + bool filtering); + + /// Destructor + virtual ~TAO_Notify_Method_Request_Dispatch_Base (); + + /// Execute the dispatch operation. + int execute_i (ACE_ENV_SINGLE_ARG_DECL); + +protected: + /// The Event + const TAO_Notify_Event * event_; + + /// The Proxy + TAO_Notify_ProxySupplier * proxy_supplier_; +// TAO_Notify_ProxySupplier_Guard proxy_supplier_; + /// Flag is true if we want to do fintering else false. + bool filtering_; +}; + +#if defined (__ACE_INLINE__) +#include "Method_Request_Dispatch_Base.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_Notify_METHOD_REQUEST_DISPATCH_BASE_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.inl new file mode 100644 index 00000000000..74e88caa0c5 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_Base.inl @@ -0,0 +1,2 @@ +// $Id$ + diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp deleted file mode 100644 index 4fc841ccc78..00000000000 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// $Id$ -#ifndef TAO_Notify_Method_Request_Dispatch_T_CPP -#define TAO_Notify_Method_Request_Dispatch_T_CPP - -#include "Method_Request_Dispatch_T.h" - -#if ! defined (__ACE_INLINE__) -#include "Method_Request_Dispatch_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (Notify, - TAO_Notify_Method_Request_Dispatch_T, - "$Id$") - - -template -TAO_Notify_Method_Request_Dispatch_T::TAO_Notify_Method_Request_Dispatch_T (EVENT_PARAM event, PROXY_PARAM proxy_supplier, CORBA::Boolean filtering) - :event_ (event), proxy_supplier_ (proxy_supplier), filtering_ (filtering) -{ -} - -template -TAO_Notify_Method_Request_Dispatch_T::~TAO_Notify_Method_Request_Dispatch_T () -{ -} - -#endif /* TAO_Notify_Method_Request_Dispatch_T_CPP */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h deleted file mode 100644 index 961db8c576b..00000000000 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- C++ -*- */ -/** - * @file Method_Request_Dispatch_T.h - * - * $Id$ - * - * @author Pradeep Gore - * - * - */ - -#ifndef TAO_Notify_METHOD_REQUEST_DISPATCH_T_H -#define TAO_Notify_METHOD_REQUEST_DISPATCH_T_H - -#include /**/ "ace/pre.h" - -#include "notify_serv_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Basic_Types.h" - -#include "ace/CORBA_macros.h" - -/** - * @class TAO_Notify_Method_Request_Dispatch_T - * - * @brief - * - */ -template -class TAO_Notify_Method_Request_Dispatch_T -{ -public: - /// Constuctor - TAO_Notify_Method_Request_Dispatch_T (EVENT_PARAM event, - PROXY_PARAM proxy, - CORBA::Boolean filtering); - - /// Destructor - virtual ~TAO_Notify_Method_Request_Dispatch_T (); - - /// Execute the dispatch operation. - int execute_i (ACE_ENV_SINGLE_ARG_DECL); - -protected: - /// The Event - EVENT event_; - - /// The Proxy - PROXY proxy_supplier_; - - /// Flag is true if we want to do fintering else false. - CORBA::Boolean filtering_; -}; - -#if defined (__ACE_INLINE__) -#include "Method_Request_Dispatch_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Method_Request_Dispatch_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Method_Request_Dispatch_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* TAO_Notify_METHOD_REQUEST_DISPATCH_T_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl deleted file mode 100644 index 948d2595e1a..00000000000 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl +++ /dev/null @@ -1,48 +0,0 @@ -// $Id$ - -#include "Admin.h" -#include "Consumer.h" -#include "tao/debug.h" - -template ACE_INLINE int -TAO_Notify_Method_Request_Dispatch_T::execute_i (ACE_ENV_SINGLE_ARG_DECL) -{ - if (this->proxy_supplier_->has_shutdown ()) - return 0; // If we were shutdown while waiting in the queue, return with no action. - - if (this->filtering_ == 1) - { - TAO_Notify_Admin* parent = this->proxy_supplier_->consumer_admin (); - - CORBA::Boolean val = this->proxy_supplier_->check_filters (this->event_, - parent->filter_admin (), - parent->filter_operator () - ACE_ENV_ARG_PARAMETER); - - if (TAO_debug_level > 1) - ACE_DEBUG ((LM_DEBUG, "Proxysupplier %x filter eval result = %d",&this->proxy_supplier_ , val)); - - // Filter failed - do nothing. - if (val == 0) - return 0; - } - - ACE_TRY - { - TAO_Notify_Consumer* consumer = this->proxy_supplier_->consumer (); - - if (consumer != 0) - { - consumer->push (this->event_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCHANY - { - if (TAO_debug_level > 0) - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Notify_Method_Request_Dispatch::: error sending event. \n "); - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp index a99adabdb47..0423093cf12 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp @@ -16,8 +16,12 @@ ACE_RCSID(Notify, TAO_Notify_Method_Request_Lookup, "$Id$") #include "Admin.h" #include "SupplierAdmin.h" -TAO_Notify_Method_Request_Lookup::TAO_Notify_Method_Request_Lookup (const TAO_Notify_Event_var& event, TAO_Notify_ProxyConsumer* proxy_consumer) - : TAO_Notify_Method_Request_Lookup_Base (event, proxy_consumer) +TAO_Notify_Method_Request_Lookup::TAO_Notify_Method_Request_Lookup ( + const TAO_Notify_Event_var& event, + TAO_Notify_ProxyConsumer* proxy_consumer) + : TAO_Notify_Method_Request_Lookup_Base (event.get (), proxy_consumer) + , event_var_ (event) + , proxy_guard_ (proxy_consumer) { this->init (event); } @@ -34,8 +38,10 @@ TAO_Notify_Method_Request_Lookup::execute (ACE_ENV_SINGLE_ARG_DECL) /******************************************************************************************************/ -TAO_Notify_Method_Request_Lookup_No_Copy::TAO_Notify_Method_Request_Lookup_No_Copy (const TAO_Notify_Event* event, TAO_Notify_ProxyConsumer* proxy_consumer) - : TAO_Notify_Method_Request_Lookup_No_Copy_Base (event, proxy_consumer) +TAO_Notify_Method_Request_Lookup_No_Copy::TAO_Notify_Method_Request_Lookup_No_Copy ( + const TAO_Notify_Event* event, + TAO_Notify_ProxyConsumer* proxy_consumer) + : TAO_Notify_Method_Request_Lookup_Base (event, proxy_consumer) { } @@ -54,7 +60,7 @@ TAO_Notify_Method_Request_Lookup_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) { TAO_Notify_Method_Request* request; - TAO_Notify_Event* event_copy = this->event_->copy (ACE_ENV_SINGLE_ARG_PARAMETER); + const TAO_Notify_Event* event_copy = this->event_->copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); TAO_Notify_Event_Copy_var event_var (event_copy); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h index 42bb57b38e7..0329a89d2fb 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h @@ -23,14 +23,16 @@ #include "Method_Request.h" #include "ProxyConsumer.h" #include "Consumer_Map.h" -#include "Method_Request_Lookup_T.h" +//#include "Method_Request_Lookup_T.h" +#include "Method_Request_Lookup_Base.h" class TAO_Notify_ProxyConsumer; - +#if 0 typedef TAO_Notify_Method_Request_Lookup_T TAO_Notify_Method_Request_Lookup_Base; +#endif /** * @class TAO_Notify_Method_Request_Lookup @@ -38,26 +40,35 @@ typedef TAO_Notify_Method_Request_Lookup_T TAO_Notify_Method_Request_Lookup_No_Copy_Base; +#endif /** * @class TAO_Notify_Method_Request_Lookup_No_Copy @@ -65,12 +76,15 @@ typedef TAO_Notify_Method_Request_Lookup_Tpush (this->event_, true ACE_ENV_ARG_PARAMETER); +} + +TAO_Notify_Method_Request_Lookup_Base::execute_i (ACE_ENV_SINGLE_ARG_DECL) +{ + if (this->proxy_consumer_->has_shutdown ()) + return 0; // If we were shutdown while waiting in the queue, return with no action. + + TAO_Notify_SupplierAdmin* parent = this->proxy_consumer_->supplier_admin (); + + CORBA::Boolean val = this->proxy_consumer_->check_filters (this->event_, + parent->filter_admin (), + parent->filter_operator () + ACE_ENV_ARG_PARAMETER); + + if (TAO_debug_level > 1) + ACE_DEBUG ((LM_DEBUG, "Proxyconsumer %x filter eval result = %d",&this->proxy_consumer_ , val)); + + // Filter failed - do nothing. + if (val == 0) + return 0; + + // The map of subscriptions. + TAO_Notify_Consumer_Map* map = this->proxy_consumer_->event_manager ()->consumer_map (); + + TAO_Notify_Consumer_Map::ENTRY* entry = map->find (this->event_->type () ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + TAO_Notify_ProxySupplier_Collection* consumers = 0; + + if (entry != 0) + { + consumers = entry->collection (); + + if (consumers != 0) + consumers->for_each (this ACE_ENV_ARG_PARAMETER); + + map->release (entry); + } + + // Get the default consumers + consumers = map->broadcast_collection (); + + if (consumers != 0) + consumers->for_each (this ACE_ENV_ARG_PARAMETER); + + return 0; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.h new file mode 100644 index 00000000000..55aebf3eabf --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.h @@ -0,0 +1,62 @@ +/* -*- C++ -*- */ +/** + * @file Method_Request_Lookup_Base.h + * + * $Id$ + * + * @author Pradeep Gore + * + * + */ + +#ifndef TAO_Notify_METHOD_REQUEST_LOOKUP_BASE_H +#define TAO_Notify_METHOD_REQUEST_LOOKUP_BASE_H +#include /**/ "ace/pre.h" + +#include "notify_serv_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "orbsvcs/ESF/ESF_Worker.h" +#include "ProxySupplier.h" +class TAO_Notify_Event; +class TAO_Notify_ProxyConsumer; + +/** + * @class TAO_Notify_Method_Request_Lookup_Base + * + * @brief + * + */ +class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup_Base + : public TAO_ESF_Worker +{ +public: + /// Constuctor + TAO_Notify_Method_Request_Lookup_Base (const TAO_Notify_Event * event, TAO_Notify_ProxyConsumer * proxy); + + /// Destructor + virtual ~TAO_Notify_Method_Request_Lookup_Base (); + + /// Execute the dispatch operation. + int execute_i (ACE_ENV_SINGLE_ARG_DECL); + +protected: + ///= TAO_ESF_Worker method + virtual void work (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL); + + /// The Event + const TAO_Notify_Event * event_; + + /// The Proxy + TAO_Notify_ProxyConsumer* proxy_consumer_; +}; + +#if defined (__ACE_INLINE__) +#include "Method_Request_Lookup_Base.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" +#endif /* TAO_Notify_METHOD_REQUEST_LOOKUP_BASE_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.inl new file mode 100644 index 00000000000..74e88caa0c5 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_Base.inl @@ -0,0 +1,2 @@ +// $Id$ + diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp deleted file mode 100644 index 9492aba6155..00000000000 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// $Id$ -#ifndef TAO_Notify_Method_Request_Lookup_T_CPP -#define TAO_Notify_Method_Request_Lookup_T_CPP - -#include "Method_Request_Lookup_T.h" - -#if ! defined (__ACE_INLINE__) -#include "Method_Request_Lookup_T.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (Notify, TAO_Notify_Method_Request_Lookup_T, "$Id$") - -template -TAO_Notify_Method_Request_Lookup_T::TAO_Notify_Method_Request_Lookup_T (EVENT_PARAM event, PROXY_PARAM proxy_consumer) - :event_ (event), proxy_consumer_ (proxy_consumer) -{ -} - -template -TAO_Notify_Method_Request_Lookup_T::~TAO_Notify_Method_Request_Lookup_T () -{ -} - - -template void -TAO_Notify_Method_Request_Lookup_T::work (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL) -{ - proxy_supplier->push (this->event_ ACE_ENV_ARG_PARAMETER); -} - -#endif /* TAO_Notify_Method_Request_Lookup_T_CPP */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h deleted file mode 100644 index f9f830b5d3e..00000000000 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- C++ -*- */ -/** - * @file Method_Request_Lookup_T.h - * - * $Id$ - * - * @author Pradeep Gore - * - * - */ - -#ifndef TAO_Notify_METHOD_REQUEST_LOOKUP_T_H -#define TAO_Notify_METHOD_REQUEST_LOOKUP_T_H -#include /**/ "ace/pre.h" - -#include "notify_serv_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "orbsvcs/ESF/ESF_Worker.h" -#include "ProxySupplier.h" - -/** - * @class TAO_Notify_Method_Request_Lookup_T - * - * @brief - * - */ -template -class TAO_Notify_Serv_Export TAO_Notify_Method_Request_Lookup_T : public TAO_ESF_Worker -{ -public: - /// Constuctor - TAO_Notify_Method_Request_Lookup_T (EVENT_PARAM event, PROXY_PARAM proxy); - - /// Destructor - virtual ~TAO_Notify_Method_Request_Lookup_T (); - - /// Execute the dispatch operation. - int execute_i (ACE_ENV_SINGLE_ARG_DECL); - -protected: - ///= TAO_ESF_Worker method - virtual void work (TAO_Notify_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL); - - /// The Event - EVENT event_; - - /// The Proxy - PROXY proxy_consumer_; -}; - -#if defined (__ACE_INLINE__) -#include "Method_Request_Lookup_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Method_Request_Lookup_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Method_Request_Lookup_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" -#endif /* TAO_Notify_METHOD_REQUEST_LOOKUP_T_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl deleted file mode 100644 index 4367a6ca8e8..00000000000 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl +++ /dev/null @@ -1,51 +0,0 @@ -// $Id$ - -#include "tao/debug.h" -#include "Event_Manager.h" - -template ACE_INLINE int -TAO_Notify_Method_Request_Lookup_T::execute_i (ACE_ENV_SINGLE_ARG_DECL) -{ - if (this->proxy_consumer_->has_shutdown ()) - return 0; // If we were shutdown while waiting in the queue, return with no action. - - TAO_Notify_Admin* parent = this->proxy_consumer_->supplier_admin (); - - CORBA::Boolean val = this->proxy_consumer_->check_filters (this->event_, - parent->filter_admin (), - parent->filter_operator () - ACE_ENV_ARG_PARAMETER); - - if (TAO_debug_level > 1) - ACE_DEBUG ((LM_DEBUG, "Proxyconsumer %x filter eval result = %d",&this->proxy_consumer_ , val)); - - // Filter failed - do nothing. - if (val == 0) - return 0; - - // The map of subscriptions. - TAO_Notify_Consumer_Map* map = this->proxy_consumer_->event_manager ()->consumer_map (); - - TAO_Notify_Consumer_Map::ENTRY* entry = map->find (this->event_->type () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - TAO_Notify_ProxySupplier_Collection* consumers = 0; - - if (entry != 0) - { - consumers = entry->collection (); - - if (consumers != 0) - consumers->for_each (this ACE_ENV_ARG_PARAMETER); - - map->release (entry); - } - - // Get the default consumers - consumers = map->broadcast_collection (); - - if (consumers != 0) - consumers->for_each (this ACE_ENV_ARG_PARAMETER); - - return 0; -} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy.h b/TAO/orbsvcs/orbsvcs/Notify/Proxy.h index 69015ddb0c2..e714e6e3a5c 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Proxy.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy.h @@ -75,14 +75,6 @@ public: ACE_ENV_ARG_DECL ); - /// Check if this event passes the admin and proxy filters. - CORBA::Boolean check_filters ( - const TAO_Notify_Event_var &event, - TAO_Notify_FilterAdmin& parent_filter_admin, - CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator - ACE_ENV_ARG_DECL - ); - /// Inform this proxy that the following types are being advertised. void types_changed (const TAO_Notify_EventTypeSeq& added, const TAO_Notify_EventTypeSeq& removed diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl b/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl index e7bcc8907f5..ef84390455c 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl @@ -6,15 +6,6 @@ TAO_Notify_Proxy::updates_off (void) return this->updates_off_; } -ACE_INLINE CORBA::Boolean -TAO_Notify_Proxy::check_filters (const TAO_Notify_Event_var &event - , TAO_Notify_FilterAdmin& parent_filter_admin - , CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator - ACE_ENV_ARG_DECL) -{ - return this->check_filters (event.get (), parent_filter_admin, filter_operator ACE_ENV_ARG_PARAMETER); -} - ACE_INLINE CORBA::Boolean TAO_Notify_Proxy::check_filters (const TAO_Notify_Event* event , TAO_Notify_FilterAdmin& parent_filter_admin diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp index 1b4049662c1..4352de38029 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp @@ -151,34 +151,9 @@ TAO_Notify_ProxySupplier::destroy (ACE_ENV_SINGLE_ARG_DECL) } void -TAO_Notify_ProxySupplier::push (const TAO_Notify_Event* event ACE_ENV_ARG_DECL) +TAO_Notify_ProxySupplier::push (const TAO_Notify_Event* event, bool filter ACE_ENV_ARG_DECL) { - TAO_Notify_Method_Request_Dispatch_No_Copy request (event, this, 1); - - this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); -} - -void -TAO_Notify_ProxySupplier::push (const TAO_Notify_Event_var &event ACE_ENV_ARG_DECL) -{ - TAO_Notify_Method_Request_Dispatch_No_Copy_Ex request (event, this, 1); - - this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); -} - -void -TAO_Notify_ProxySupplier::push_no_filtering (const TAO_Notify_Event* event ACE_ENV_ARG_DECL) -{ - TAO_Notify_Method_Request_Dispatch_No_Copy request (event, this, 0); // No filtering. - - this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); -} - -void -TAO_Notify_ProxySupplier::push_no_filtering (const TAO_Notify_Event_var &event ACE_ENV_ARG_DECL) -{ - TAO_Notify_Method_Request_Dispatch_No_Copy_Ex request (event, this, 0); // No filtering. - + TAO_Notify_Method_Request_Dispatch_No_Copy request (event, this, filter); this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); } diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h index 903c476b5b1..8a317a08d36 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h +++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h @@ -57,16 +57,16 @@ public: void disconnect (ACE_ENV_SINGLE_ARG_DECL); /// Dispatch Event to consumer - virtual void push (const TAO_Notify_Event* event ACE_ENV_ARG_DECL); + virtual void push (const TAO_Notify_Event* event, bool filter ACE_ENV_ARG_DECL); - /// Dispatch Event to consumer - virtual void push (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL); +// /// Dispatch Event to consumer +// virtual void push (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL); - /// Dispatch Event to consumer, no filtering - virtual void push_no_filtering (const TAO_Notify_Event* event ACE_ENV_ARG_DECL); +// /// Dispatch Event to consumer, no filtering +// virtual void push_no_filtering (const TAO_Notify_Event* event ACE_ENV_ARG_DECL); - /// Dispatch Event to consumer, no filtering - virtual void push_no_filtering (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL); +// /// Dispatch Event to consumer, no filtering +// virtual void push_no_filtering (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL); /// Override TAO_Notify_Container_T::shutdown method virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h index ac1af0f4323..1354378dc62 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h @@ -31,11 +31,14 @@ class TAO_Notify_Refcountable_Guard_T { public: /// Constuctor - TAO_Notify_Refcountable_Guard_T (T* t); + TAO_Notify_Refcountable_Guard_T (T* t = 0); /// Destructor ~TAO_Notify_Refcountable_Guard_T (); + /// Redirection operator + T * get (void) const; + /// Redirection operator T *operator-> (void) const; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl index 5e16e7d04f1..2dedf719c60 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl @@ -4,23 +4,37 @@ template ACE_INLINE TAO_Notify_Refcountable_Guard_T::TAO_Notify_Refcountable_Guard_T (T *t) : t_ (t) { - this->t_->_incr_refcnt (); + if (this->t_ != 0) + { + this->t_->_incr_refcnt (); + } } template ACE_INLINE TAO_Notify_Refcountable_Guard_T::~TAO_Notify_Refcountable_Guard_T () { - this->t_->_decr_refcnt (); + if (this->t_ != 0) + { + this->t_->_decr_refcnt (); + } +} + +template ACE_INLINE T* +TAO_Notify_Refcountable_Guard_T::get (void) const +{ + return this->t_; } template ACE_INLINE T* TAO_Notify_Refcountable_Guard_T::operator-> (void) const { + ACE_ASSERT (this->t_ != 0); return this->t_; } template ACE_INLINE T& TAO_Notify_Refcountable_Guard_T::operator *(void) const { + ACE_ASSERT (this->t_ != 0); return *this->t_; } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp index 1a6268aa7d7..de80034c7f7 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp @@ -107,21 +107,15 @@ TAO_Notify_SequencePushConsumer::cancel_timer (void) void TAO_Notify_SequencePushConsumer::push_i (const TAO_Notify_Event* event ACE_ENV_ARG_DECL) { - TAO_Notify_Event* copy = event->copy (ACE_ENV_SINGLE_ARG_PARAMETER); + const TAO_Notify_Event * copy = event->copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; TAO_Notify_Event_Copy_var copy_var (copy); - this->push_i (copy_var ACE_ENV_ARG_PARAMETER); -} - -void -TAO_Notify_SequencePushConsumer::push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL) -{ TAO_Notify_Method_Request_Event* method_request; ACE_NEW_THROW_EX (method_request, - TAO_Notify_Method_Request_Event (event), + TAO_Notify_Method_Request_Event (copy_var), CORBA::NO_MEMORY ()); int msg_count = this->buffering_strategy_->enqueue (*method_request); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h index 8037ea6d403..d5b5db8fec0 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h @@ -59,7 +59,7 @@ public: /// Push to this consumer. virtual void push_i (const TAO_Notify_Event* event ACE_ENV_ARG_DECL); - virtual void push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL); +// virtual void push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL); /// Push to this consumer. virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp index 1ce4ede4465..24729ff5b5c 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp @@ -36,8 +36,29 @@ TAO_Notify_StructuredEvent_No_Copy::~TAO_Notify_StructuredEvent_No_Copy () { } -TAO_Notify_Event* -TAO_Notify_StructuredEvent_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) const +void +TAO_Notify_StructuredEvent_No_Copy::marshal (TAO_OutputCDR & cdr) const +{ + static const ACE_CDR::Octet STRUCTURED_CODE = MARSHAL_STRUCTURED; + cdr.write_octet (STRUCTURED_CODE); + cdr << (*this->notification_); +} + +//static +TAO_Notify_StructuredEvent * +TAO_Notify_StructuredEvent_No_Copy::unmarshal (TAO_InputCDR & cdr) +{ + TAO_Notify_StructuredEvent * event = 0; + CosNotification::StructuredEvent body; + if (cdr >> body) + { + event = new TAO_Notify_StructuredEvent (body); + } + return event; +} + +const TAO_Notify_Event * +TAO_Notify_StructuredEvent_No_Copy::copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER) const { TAO_Notify_Event* copy; @@ -119,3 +140,10 @@ TAO_Notify_StructuredEvent::TAO_Notify_StructuredEvent (const CosNotification::S TAO_Notify_StructuredEvent::~TAO_Notify_StructuredEvent () { } + +const TAO_Notify_Event * +TAO_Notify_StructuredEvent::copy_on_heap (ACE_ENV_SINGLE_ARG_PARAMETER)const +{ + return this; +} + diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h index d6edc36aa28..54b8061e409 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h @@ -22,6 +22,8 @@ #include "../EventType.h" #include "orbsvcs/CosNotificationC.h" +class TAO_Notify_StructuredEvent; + /** * @class TAO_Notify_StructuredEvent_No_Copy * @@ -38,8 +40,11 @@ public: /// Destructor ~TAO_Notify_StructuredEvent_No_Copy (); - /// Copy the event. - virtual TAO_Notify_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const; + /// returns a copy of this event allocated on the heap + virtual const TAO_Notify_Event * copy_on_heap ()const; + + /// marshal this event into a CDR buffer (for persistence) + virtual void marshal (TAO_OutputCDR & cdr) const; CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const; @@ -64,6 +69,10 @@ public: /// Push event to the Event_Forwarder interface virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const; + /// unmarshal this event from a CDR buffer (for persistence) + /// \return the new event, or NULL if this is the wrong type of event. + static TAO_Notify_StructuredEvent * unmarshal (TAO_InputCDR & cdr); + protected: /// Structured Event const CosNotification::StructuredEvent* notification_; @@ -89,6 +98,9 @@ public: /// Destructor ~TAO_Notify_StructuredEvent (); + /// returns this + virtual const TAO_Notify_Event * copy_on_heap ()const; + protected: /// Copy of the Event. CosNotification::StructuredEvent notification_copy; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp index cccd6095513..53e4bb3daad 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp @@ -42,12 +42,6 @@ TAO_Notify_StructuredPushConsumer::push_i (const TAO_Notify_Event* event ACE_ENV event->push (this ACE_ENV_ARG_PARAMETER); } -void -TAO_Notify_StructuredPushConsumer::push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL) -{ - event->push (this ACE_ENV_ARG_PARAMETER); -} - void TAO_Notify_StructuredPushConsumer::push (const CORBA::Any& event ACE_ENV_ARG_DECL) { diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h index 9cb0c7d1288..4b704cfe0de 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h @@ -48,9 +48,6 @@ public: /// Push to this consumer. virtual void push_i (const TAO_Notify_Event* event ACE_ENV_ARG_DECL); - /// Push to this consumer. - virtual void push_i (const TAO_Notify_Event_var& event ACE_ENV_ARG_DECL); - /// Push to this consumer. virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL); -- cgit v1.2.1