TAO_Notify_Event Class Reference

Base class abstraction for Events flowing through the EventChannel. More...

#include <Event.h>

Inheritance diagram for TAO_Notify_Event:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_Event:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TAO_Notify_Refcountable_Guard_T<
TAO_Notify_Event
Ptr
 MARSHAL_ANY = 1
 MARSHAL_STRUCTURED = 2
enum  { MARSHAL_ANY = 1, MARSHAL_STRUCTURED = 2 }

Public Member Functions

 TAO_Notify_Event (void)
 Constructor.
virtual ~TAO_Notify_Event ()
 Destructor.
virtual const TAO_Notify_EventTypetype (void) const =0
 Get the event type.
virtual CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter) const =0
 Returns true if the filter matches.
virtual void convert (CosNotification::StructuredEvent &notification) const =0
 Convert to CosNotification::Structured type.
virtual void push (TAO_Notify_Consumer *consumer) const =0
 Push event to consumer.
virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder) const =0
 Push event to the Event_Forwarder interface.
virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder) const =0
 Push event to the Event_Forwarder interface.
virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder) const =0
 Push event to the Event_Forwarder interface.
virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder) const =0
 Push event to the Event_Forwarder interface.
TAO_Notify_Eventqueueable_copy (void) const
virtual void marshal (TAO_OutputCDR &cdr) const =0
 marshal this event into a CDR buffer (for persistence)
const TAO_Notify_Property_Shortpriority (void) const
const TAO_Notify_Property_Timetimeout (void) const
 Timeout.
const TAO_Notify_Property_Booleanreliable (void) const
 Reliable.
const ACE_Time_Valuecreation_time (void) const
 Event creation time.

Static Public Member Functions

static void translate (const CORBA::Any &any, CosNotification::StructuredEvent &notification)
 Translate Any to Structured.
static void translate (const CosNotification::StructuredEvent &notification, CORBA::Any &any)
 Translate Structured to Any.
static TAO_Notify_Eventunmarshal (TAO_InputCDR &cdr)
 Unmarshal an event from a CDR. (for persistence).

Protected Attributes

TAO_Notify_Property_Short priority_
 Priority.
TAO_Notify_Property_Time timeout_
 Timeout.
TAO_Notify_Property_Boolean reliable_
 Reliability.

Private Member Functions

virtual TAO_Notify_Eventcopy (void) const =0
 Return a pointer to a copy of this event on the heap.
virtual void release (void)
 The release method is called when the refcount reaches 0.

Private Attributes

Ptr clone_
bool is_on_heap_
ACE_Time_Value time_

Detailed Description

Base class abstraction for Events flowing through the EventChannel.

Definition at line 45 of file Event.h.


Member Typedef Documentation

typedef TAO_Notify_Refcountable_Guard_T<TAO_Notify_Event> TAO_Notify_Event::Ptr

Reimplemented from TAO_Notify_Refcountable.

Definition at line 50 of file Event.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
MARSHAL_ANY 
MARSHAL_STRUCTURED 

Definition at line 53 of file Event.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Notify_Event::TAO_Notify_Event ( void   ) 

Constructor.

Definition at line 22 of file Event.cpp.

00023 : priority_ (CosNotification::Priority, CosNotification::DefaultPriority)
00024 , timeout_ (CosNotification::Timeout)
00025 , reliable_ (CosNotification::EventReliability, true)
00026 , clone_ (0)
00027 , is_on_heap_ (false)
00028 , time_ (ACE_OS::gettimeofday ())
00029 {
00030   //  if (TAO_debug_level > 0)
00031   //  ACE_DEBUG ((LM_DEBUG,"event:%x  created\n", this ));
00032 }

TAO_Notify_Event::~TAO_Notify_Event (  )  [virtual]

Destructor.

Definition at line 34 of file Event.cpp.

00035 {
00036   // if (TAO_debug_level > 1)
00037   //  ACE_DEBUG ((LM_DEBUG,"event:%x  destroyed\n", this ));
00038 }


Member Function Documentation

virtual void TAO_Notify_Event::convert ( CosNotification::StructuredEvent notification  )  const [pure virtual]

Convert to CosNotification::Structured type.

Implemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

Referenced by TAO_Notify_SequencePushConsumer::dispatch_from_queue().

virtual TAO_Notify_Event* TAO_Notify_Event::copy ( void   )  const [private, pure virtual]

Return a pointer to a copy of this event on the heap.

Implemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

Referenced by queueable_copy().

ACE_INLINE const ACE_Time_Value & TAO_Notify_Event::creation_time ( void   )  const

Event creation time.

Definition at line 26 of file Event.inl.

References time_.

Referenced by TAO_Notify_Method_Request_Queueable::init().

00027 {
00028   return this->time_;
00029 }

virtual CORBA::Boolean TAO_Notify_Event::do_match ( CosNotifyFilter::Filter_ptr  filter  )  const [pure virtual]

Returns true if the filter matches.

Implemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

Referenced by TAO_Notify_FilterAdmin::match().

virtual void TAO_Notify_Event::marshal ( TAO_OutputCDR cdr  )  const [pure virtual]

marshal this event into a CDR buffer (for persistence)

Implemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE const TAO_Notify_Property_Short & TAO_Notify_Event::priority ( void   )  const

= Accessors Priority

Definition at line 8 of file Event.inl.

References priority_.

Referenced by TAO_Notify_Method_Request_Queueable::init().

00009 {
00010   return this->priority_;
00011 }

virtual void TAO_Notify_Event::push ( Event_Forwarder::ProxyPushSupplier_ptr  forwarder  )  const [pure virtual]

Push event to the Event_Forwarder interface.

Implemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

virtual void TAO_Notify_Event::push ( Event_Forwarder::StructuredProxyPushSupplier_ptr  forwarder  )  const [pure virtual]

Push event to the Event_Forwarder interface.

Implemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

virtual void TAO_Notify_Event::push ( TAO_Notify_Consumer consumer  )  const [pure virtual]

Push event to consumer.

Implemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

Referenced by TAO_Notify_RT_StructuredProxyPushSupplier::deliver(), and TAO_Notify_Consumer::dispatch_request().

virtual void TAO_Notify_Event::push_no_filtering ( Event_Forwarder::ProxyPushSupplier_ptr  forwarder  )  const [pure virtual]

Push event to the Event_Forwarder interface.

Implemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

virtual void TAO_Notify_Event::push_no_filtering ( Event_Forwarder::StructuredProxyPushSupplier_ptr  forwarder  )  const [pure virtual]

Push event to the Event_Forwarder interface.

Implemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

Referenced by TAO_Notify_RT_StructuredProxyPushSupplier::push_no_filtering().

ACE_INLINE TAO_Notify_Event * TAO_Notify_Event::queueable_copy ( void   )  const

Return a pointer to a copy of this event on the heap. The event is not owned by the caller, so it should not be deleted or released.

Definition at line 33 of file Event.inl.

References clone_, copy(), TAO_Notify_Refcountable_Guard_T< T >::get(), is_on_heap_, and TAO_Notify_Refcountable_Guard_T< T >::reset().

Referenced by TAO_Notify_Consumer::enqueue_if_necessary(), TAO_Notify_Consumer::enqueue_request(), and TAO_Notify_ProxyConsumer::push_i().

00034 {
00035   if ( is_on_heap_ )
00036   {
00037     return const_cast< TAO_Notify_Event* >( this );
00038   }
00039   else if (this->clone_.get() == 0)
00040   {
00041     TAO_Notify_Event* copied = this->copy ();
00042     copied->is_on_heap_ = true;
00043     this->clone_.reset( copied );
00044   }
00045   return this->clone_.get();
00046 }

void TAO_Notify_Event::release ( void   )  [private, virtual]

The release method is called when the refcount reaches 0.

Implements TAO_Notify_Refcountable.

Definition at line 40 of file Event.cpp.

00041 {
00042   delete this;
00043 }

ACE_INLINE const TAO_Notify_Property_Boolean & TAO_Notify_Event::reliable ( void   )  const

Reliable.

Definition at line 20 of file Event.inl.

References reliable_.

00021 {
00022   return this->reliable_;
00023 }

ACE_INLINE const TAO_Notify_Property_Time & TAO_Notify_Event::timeout ( void   )  const

Timeout.

Definition at line 14 of file Event.inl.

References timeout_.

Referenced by TAO_Notify_Method_Request_Queueable::init().

00015 {
00016   return this->timeout_;
00017 }

void TAO_Notify_Event::translate ( const CosNotification::StructuredEvent notification,
CORBA::Any &  any 
) [static]

Translate Structured to Any.

Definition at line 54 of file Event.cpp.

00055 {
00056   any <<= notification;   // is the typecode set by this operation or do we need to set it explicity.
00057 }

void TAO_Notify_Event::translate ( const CORBA::Any &  any,
CosNotification::StructuredEvent notification 
) [static]

Translate Any to Structured.

Definition at line 46 of file Event.cpp.

References CosNotification::StructuredEvent::header, CosNotification::StructuredEvent::remainder_of_body, and CORBA::string_dup().

Referenced by TAO_Notify_AnyEvent_No_Copy::convert(), TAO_Notify_StructuredPushConsumer::push(), TAO_Notify_StructuredEvent_No_Copy::push(), TAO_Notify_PushConsumer::push(), TAO_Notify_AnyEvent_No_Copy::push(), TAO_Notify_StructuredEvent_No_Copy::push_no_filtering(), and TAO_Notify_AnyEvent_No_Copy::push_no_filtering().

00047 {
00048   notification.remainder_of_body <<= any;
00049   notification.header.fixed_header.event_type.type_name = CORBA::string_dup ("%ANY");
00050   notification.header.fixed_header.event_type.domain_name = CORBA::string_dup ("");
00051 }

virtual const TAO_Notify_EventType& TAO_Notify_Event::type ( void   )  const [pure virtual]

Get the event type.

Implemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

TAO_Notify_Event * TAO_Notify_Event::unmarshal ( TAO_InputCDR cdr  )  [static]

Unmarshal an event from a CDR. (for persistence).

Reimplemented in TAO_Notify_AnyEvent_No_Copy, and TAO_Notify_StructuredEvent_No_Copy.

Definition at line 61 of file Event.cpp.

References ACE_ERROR, ACE_TEXT(), LM_ERROR, MARSHAL_ANY, MARSHAL_STRUCTURED, ACE_InputCDR::read_octet(), TAO_Notify_StructuredEvent_No_Copy::unmarshal(), and TAO_Notify_AnyEvent_No_Copy::unmarshal().

Referenced by TAO_Notify::Routing_Slip::create().

00062 {
00063   TAO_Notify_Event * result = 0;
00064   ACE_CDR::Octet code = 0;
00065   if (cdr.read_octet (code))
00066   {
00067     switch (code)
00068     {
00069     case MARSHAL_ANY:
00070       result = TAO_Notify_AnyEvent::unmarshal (cdr);
00071       break;
00072     case MARSHAL_STRUCTURED:
00073       result = TAO_Notify_StructuredEvent::unmarshal (cdr);
00074       break;
00075     default:
00076       ACE_ERROR ((LM_ERROR,
00077         ACE_TEXT ("(%P|%t) TAO_Notify_Event::unmarshal: unknown event code %d\n"),
00078         code));
00079       break;
00080     }
00081   }
00082   return result;
00083 }


Member Data Documentation

Ptr TAO_Notify_Event::clone_ [mutable, private]

Definition at line 132 of file Event.h.

Referenced by queueable_copy().

bool TAO_Notify_Event::is_on_heap_ [private]

Definition at line 133 of file Event.h.

Referenced by queueable_copy().

TAO_Notify_Property_Short TAO_Notify_Event::priority_ [protected]

Priority.

Definition at line 118 of file Event.h.

Referenced by priority(), and TAO_Notify_StructuredEvent_No_Copy::TAO_Notify_StructuredEvent_No_Copy().

TAO_Notify_Property_Boolean TAO_Notify_Event::reliable_ [protected]

Reliability.

Definition at line 124 of file Event.h.

Referenced by reliable().

ACE_Time_Value TAO_Notify_Event::time_ [private]

Definition at line 134 of file Event.h.

Referenced by creation_time().

TAO_Notify_Property_Time TAO_Notify_Event::timeout_ [protected]

Timeout.

Definition at line 121 of file Event.h.

Referenced by TAO_Notify_StructuredEvent_No_Copy::TAO_Notify_StructuredEvent_No_Copy(), and timeout().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:46:18 2010 for TAO_CosNotification by  doxygen 1.4.7