PropertySeq.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 /**
00004  *  @file PropertySeq.h
00005  *
00006  *  PropertySeq.h,v 1.13 2006/03/14 06:14:34 jtc Exp
00007  *
00008  *  @author Pradeep Gore <pradeep@oomworks.com>
00009  */
00010 
00011 #ifndef TAO_Notify_PROPERTYSEQ_H
00012 #define TAO_Notify_PROPERTYSEQ_H
00013 
00014 #include /**/ "ace/pre.h"
00015 
00016 #include "orbsvcs/Notify/notify_serv_export.h"
00017 
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 # pragma once
00020 #endif /* ACE_LACKS_PRAGMA_ONCE */
00021 
00022 #include "orbsvcs/CosNotificationC.h"
00023 
00024 #include "ace/Hash_Map_Manager.h"
00025 #include "ace/SString.h"
00026 #include "ace/Null_Mutex.h"
00027 
00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00029 
00030 /**
00031  * @class TAO_Notify_PropertySeq
00032  *
00033  * @brief
00034  *
00035  */
00036 class TAO_Notify_Serv_Export TAO_Notify_PropertySeq
00037 {
00038 public:
00039   /// Constuctor
00040   TAO_Notify_PropertySeq (void);
00041 
00042   /// Destructor
00043   ~TAO_Notify_PropertySeq ();
00044 
00045   /// Return 0 on success, -1 on error.
00046   int init (const CosNotification::PropertySeq& prop_seq);
00047 
00048   /// Find the <value> for property <name>. Returns 0 on success.
00049   int find (const char* name, CosNotification::PropertyValue& value) const;
00050 
00051   /// Return -1 on error.
00052   int populate (CosNotification::PropertySeq_var& prop_seq) const;
00053 
00054   /// return the number of properties available as a sequence
00055   size_t size() const;
00056 
00057 protected:
00058   /// Add the value. Used by subclasses to initialize the property map from their
00059   /// member variables.
00060   void add(const ACE_CString& name, const CORBA::Any& val);
00061 
00062 protected:
00063   /// Property Map.
00064   typedef ACE_Hash_Map_Manager <ACE_CString, CosNotification::PropertyValue, ACE_SYNCH_NULL_MUTEX> PROPERTY_MAP;
00065 
00066   PROPERTY_MAP property_map_;
00067 };
00068 
00069 TAO_END_VERSIONED_NAMESPACE_DECL
00070 
00071 #if defined (__ACE_INLINE__)
00072 #include "orbsvcs/Notify/PropertySeq.inl"
00073 #endif /* __ACE_INLINE__ */
00074 
00075 #include /**/ "ace/post.h"
00076 
00077 #endif /* TAO_Notify_PROPERTYSEQ_H */

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