Event.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 /**
00003  *  @file Event.h
00004  *
00005  *  Event.h,v 1.16 2006/03/14 06:14:34 jtc Exp
00006  *
00007  *  @author Pradeep Gore <pradeep@oomworks.com>
00008  *
00009  *
00010  */
00011 
00012 #ifndef TAO_NOTIFY_EVENT_H
00013 #define TAO_NOTIFY_EVENT_H
00014 
00015 #include /**/ "ace/pre.h"
00016 
00017 #include "orbsvcs/Notify/notify_serv_export.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 #include "orbsvcs/Notify/Refcountable.h"
00024 #include "orbsvcs/Notify/Property.h"
00025 #include "orbsvcs/Notify/Property_Boolean.h"
00026 #include "orbsvcs/Notify/Property_T.h"
00027 
00028 #include "orbsvcs/Event_ForwarderS.h"
00029 #include "orbsvcs/CosNotifyFilterC.h"
00030 #include "orbsvcs/CosNotificationC.h"
00031 
00032 #include "ace/Copy_Disabled.h"
00033 
00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00035 
00036 class TAO_Notify_Consumer;
00037 class TAO_Notify_EventType;
00038 
00039 /**
00040  * @class TAO_Notify_Event
00041  *
00042  * @brief Base class abstraction for Events flowing through the EventChannel.
00043  *
00044  */
00045 class TAO_Notify_Serv_Export TAO_Notify_Event
00046     : public TAO_Notify_Refcountable
00047     , private ACE_Copy_Disabled
00048 {
00049 public:
00050   typedef TAO_Notify_Refcountable_Guard_T<TAO_Notify_Event> Ptr;
00051 
00052   // Codes to distinguish marshaled events in persistent storage
00053   enum {MARSHAL_ANY=1,MARSHAL_STRUCTURED=2};
00054   /// Constuctor
00055   TAO_Notify_Event (void);
00056 
00057   /// Destructor
00058   virtual ~TAO_Notify_Event ();
00059 
00060   /// Translate Any to Structured
00061   static void translate (const CORBA::Any& any, CosNotification::StructuredEvent& notification);
00062 
00063   /// Translate Structured to Any
00064   static void translate (const CosNotification::StructuredEvent& notification, CORBA::Any& any);
00065 
00066   /// Get the event type.
00067   virtual const TAO_Notify_EventType& type (void) const = 0;
00068 
00069   /// Returns true if the filter matches.
00070   virtual CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const = 0;
00071 
00072   /// Convert to CosNotification::Structured type
00073   virtual void convert (CosNotification::StructuredEvent& notification) const = 0;
00074 
00075   /// Push event to consumer
00076   virtual void push (TAO_Notify_Consumer* consumer ACE_ENV_ARG_DECL) const = 0;
00077 
00078   /// Push event to the Event_Forwarder interface
00079   virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0;
00080 
00081   /// Push event to the Event_Forwarder interface
00082   virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0;
00083 
00084   /// Push event to the Event_Forwarder interface
00085   virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0;
00086 
00087   /// Push event to the Event_Forwarder interface
00088   virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0;
00089 
00090   /// Return a pointer to a copy of this event on the heap
00091   TAO_Notify_Event* queueable_copy (ACE_ENV_SINGLE_ARG_DECL) const;
00092 
00093   /// marshal this event into a CDR buffer (for persistence)
00094   virtual void marshal (TAO_OutputCDR& cdr) const = 0;
00095 
00096   /// Unmarshal an event from a CDR. (for persistence)
00097   static TAO_Notify_Event* unmarshal (TAO_InputCDR & cdr);
00098 
00099   ///= Accessors
00100   /// Priority
00101   const TAO_Notify_Property_Short& priority (void) const;
00102 
00103   /// Timeout
00104   const TAO_Notify_Property_Time& timeout (void) const;
00105 
00106   /// Reliable
00107   const TAO_Notify_Property_Boolean& reliable(void) const;
00108 
00109 protected:
00110   /// = QoS properties
00111 
00112   /// Priority.
00113   TAO_Notify_Property_Short priority_;
00114 
00115   /// Timeout.
00116   TAO_Notify_Property_Time timeout_;
00117 
00118   /// Reliability
00119   TAO_Notify_Property_Boolean reliable_;
00120 
00121 private:
00122   /// Return a pointer to a copy of this event on the heap
00123   virtual TAO_Notify_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const = 0;
00124 
00125   virtual void release (void);
00126 
00127   mutable Ptr clone_;
00128   bool        is_on_heap_;
00129 };
00130 
00131 TAO_END_VERSIONED_NAMESPACE_DECL
00132 
00133 #if defined (__ACE_INLINE__)
00134 #include "orbsvcs/Notify/Event.inl"
00135 #endif /* __ACE_INLINE__ */
00136 
00137 #include /**/ "ace/post.h"
00138 
00139 #endif /* TAO_NOTIFY_EVENT_H */

Generated on Thu Nov 9 13:24:10 2006 for TAO_CosNotification by doxygen 1.3.6