EventType.h

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

Generated on Tue Feb 2 17:45:29 2010 for TAO_CosNotification by  doxygen 1.4.7