EventType.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 /**
00003  *  @file EventType.h
00004  *
00005  *  $Id: EventType.h 78005 2007-04-12 19:14:05Z elliott_c $
00006  *
00007  *  @author Pradeep Gore <pradeep@oomworks.com>
00008  *
00009  *
00010  */
00011 
00012 #ifndef TAO_Notify_EVENTTYPE_H
00013 #define TAO_Notify_EVENTTYPE_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/CosNotificationC.h"
00024 #include "orbsvcs/Notify/Topology_Object.h"
00025 
00026 
00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 /**
00030  * @class TAO_Notify_EventType
00031  *
00032  * @brief
00033  *
00034  * This type is used to compare different event types.
00035  * It is used by the Event Manager as a key to find subscription lists.
00036  *
00037  */
00038 class TAO_Notify_Serv_Export TAO_Notify_EventType : public TAO_Notify::Topology_Savable
00039 {
00040 public:
00041   /// Constuctor
00042   TAO_Notify_EventType (void);
00043   TAO_Notify_EventType (const char* domain_name, const char* type_name);
00044   TAO_Notify_EventType (const CosNotification::EventType& event_type);
00045   // Constuctor
00046 
00047   /// Destructor
00048   virtual ~TAO_Notify_EventType ();
00049 
00050   /// hash value
00051   u_long hash (void) const;
00052 
00053   /// Assignment from CosNotification::EventType
00054   TAO_Notify_EventType& operator=(const CosNotification::EventType& event_type);
00055 
00056   /// Assignment operator.
00057   TAO_Notify_EventType& operator=(const TAO_Notify_EventType& event_type);
00058 
00059   /// == operator
00060   bool operator==(const TAO_Notify_EventType& notify_event_type) const;
00061 
00062   /// != operator
00063   bool operator!=(const TAO_Notify_EventType& notify_event_type) const;
00064 
00065   static TAO_Notify_EventType special (void);
00066   // Return the special event type.
00067 
00068   CORBA::Boolean is_special (void) const;
00069   // Is this the special event (accept everything).
00070 
00071   const CosNotification::EventType& native (void) const;
00072   // Get the type underneath us.
00073 
00074   /// Helper to print contents.
00075   void dump (void) const;
00076 
00077   /// Initialize from an NVPList, return false on failure
00078   bool init(const TAO_Notify::NVPList& attrs);
00079 
00080   // TAO_Notify::Topology_Object
00081 
00082   virtual void save_persistent (TAO_Notify::Topology_Saver& saver);
00083 
00084 protected:
00085   /// Init this object.
00086   void init_i (const char* domain_name, const char* type_name);
00087 
00088   void recompute_hash (void);
00089   // Recompute the hash value.
00090 
00091   bool domain_is_wildcard (const char* domain) const;
00092   bool type_is_wildcard (const char* type) const;
00093   
00094   // = Data Members
00095   CosNotification::EventType event_type_;
00096   // The event_type that we're decorating.
00097 
00098   u_long hash_value_;
00099   // The hash value computed.
00100 };
00101 
00102 TAO_END_VERSIONED_NAMESPACE_DECL
00103 
00104 #if defined (__ACE_INLINE__)
00105 #include "orbsvcs/Notify/EventType.inl"
00106 #endif /* __ACE_INLINE__ */
00107 
00108 #include /**/ "ace/post.h"
00109 
00110 #endif /* TAO_Notify_EVENTTYPE_H */

Generated on Sun Jan 27 15:39:55 2008 for TAO_CosNotification by doxygen 1.3.6