diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.h')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.h | 276 |
1 files changed, 74 insertions, 202 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.h b/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.h index 7e4c73939e8..11161e3973b 100644 --- a/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.h +++ b/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.h @@ -26,10 +26,8 @@ #include "orbsvcs/orbsvcs_export.h" #include "orbsvcs/CosPropertyServiceS.h" -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined (_MSC_VER) -# pragma warning (disable : 4250) +#if defined(_MSC_VER) +#pragma warning(disable:4250) #endif /* _MSC_VER */ // = Classes to deal with the ACE_Hash_Map_Manager. @@ -41,7 +39,6 @@ class TAO_ORBSVCS_Export CosProperty_Hash_Key // ACE_Hash_Map_Manager. public: // = Initialization and termination methods. - CosProperty_Hash_Key (void); // Default constructor. @@ -63,10 +60,8 @@ public: virtual u_long hash (void) const; // The function that computes a hash value. -// private: - - CosPropertyService::PropertyName pname_; - // Storage pointer. + CosPropertyService::PropertyName_var pname_; + // This is still the public variable. }; class TAO_ORBSVCS_Export CosProperty_Hash_Value @@ -90,199 +85,22 @@ public: virtual ~CosProperty_Hash_Value (void); // Destructor. -//private: - - CORBA::Any pvalue_; + CORBA::Any_var pvalue_; // property value. CosPropertyService::PropertyModeType pmode_; // Property Mode. }; -class TAO_ORBSVCS_Export TAO_PropertySet : public virtual POA_CosPropertyService::PropertySet -{ - // = TITLE - // Gives operations for defining, deleting, enumerating and - // checking of properties. - // - // = DESCRIPTION - // Uses a HashTable to manage the properties. -public: - friend class TAO_PropertyNamesIterator; - friend class TAO_PropertiesIterator; - - // = Initialization and termination methods. - - TAO_PropertySet (void); - // Default constructor. - - TAO_PropertySet (const CosPropertyService::PropertyTypes allowed_property_types, - const CosPropertyService::Properties allowed_properties, - CORBA::Environment &_env); - // Init values that the PropertySetFactory will want to specify. - - TAO_PropertySet (const CosPropertyService::Properties initial_properties, - CORBA::Environment &_env); - // PropertySetFactory needs this constructor. - - TAO_PropertySet (const CosPropertyService::PropertyTypes allowed_property_types, - const CORBA::ULong number_of_allowed_propertydefs, - CORBA::Environment &_env); - // PropertySetDef's construction needs this. - - virtual ~TAO_PropertySet (void); - // Destructor function. - - virtual void define_property (const char *property_name, - const CORBA::Any &property_value, - CORBA::Environment &env); - // Store the property in the hash after checking for validity of the - // property name, duplicate name, type code over writing etc. - - virtual void define_properties (const CosPropertyService::Properties &nproperties, - CORBA::Environment &env); - // Define a sequence of properties at a time. - - virtual CORBA::ULong get_number_of_properties (CORBA::Environment &env); - // Get the number of properties that are currently defined in the - // PropertySet. - - virtual void get_all_property_names (CORBA::ULong how_many, - CosPropertyService::PropertyNames_out property_names, - CosPropertyService::PropertyNamesIterator_out rest, - CORBA::Environment &env); - // Get the names of all the properties that are currently defined in - // the property set. - - virtual CORBA::Any *get_property_value (const char *property_name, - CORBA::Environment &env); - // Get the value of the property, given the name. - - virtual CORBA::Boolean get_properties (const CosPropertyService::PropertyNames &property_names, - CosPropertyService::Properties_out nproperties, - CORBA::Environment &env); - // Get all names and their property values. - - virtual void get_all_properties (CORBA::ULong how_many, - CosPropertyService::Properties_out nproperties, - CosPropertyService::PropertiesIterator_out rest, - CORBA::Environment &env); - // Returns all of the property names currently defined in the - // PropertySet. If the PropertySet contains more than how_many - // property names, then the remaining property names are put into the PropertyNamesIterator. - - virtual void delete_property (const char *property_name, - CORBA::Environment &env); - // Delete a property given a name. - - virtual void delete_properties (const CosPropertyService::PropertyNames &property_names, - CORBA::Environment &env); - // Delete all the these properties from this property set. - - virtual CORBA::Boolean delete_all_properties (CORBA::Environment &env); - // Delete everything from this property set. - - virtual CORBA::Boolean is_property_defined (const char *property_name, - CORBA::Environment &env); - // Tell whether this property is defined or no. Forget about the - // value. - -protected: - typedef ACE_Hash_Map_Manager<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex> - COSPROPERTY_HASH_MAP; - typedef ACE_Hash_Map_Entry<CosProperty_Hash_Key, CosProperty_Hash_Value> - COSPROPERTY_HASH_ENTRY; - typedef ACE_Hash_Map_Iterator<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex> - COSPROPERTY_HASH_ITERATOR; - // Typedefs are useful. - - CORBA::Boolean is_type_allowed (CORBA::TypeCode_ptr type); - // Tells whether this type is allowed in this property set or no. - - CORBA::Boolean is_property_allowed (const char *name); - // Tells whether this property is allowed in this property set or - // no. - - void operator= (const TAO_PropertySet &); - // hack to avoid strange undefined symbol errors for operator= for PropertyTypes. - - // XXX:This public: is a hack to keep the compiler complain about access violation. -public: - COSPROPERTY_HASH_MAP hash_table_; - // This Hash_Table manages storage for our properties. - -protected: - CosPropertyService::PropertyTypes allowed_property_types_; - // Stores the property types that can be allowed in this property - // set. - - CosPropertyService::PropertyNames allowed_property_names_; - // Stores the property names that are allowed in this property - // set. These properties will be defined with *fixed-normal* modes, by default, at - // creation. - // If this is *not* empty, these properties will be the only - // properties that will exist in this property set. Nothing more - // can be defined. -}; - -class TAO_ORBSVCS_Export TAO_PropertyNamesIterator : public virtual PortableServer::RefCountServantBase, - public virtual POA_CosPropertyService::PropertyNamesIterator -{ - // = TITLE - // The PropertyNamesIterator interface allows a client to - // iterate through the names using the next_one or next_n operations. - // - // = DESCRIPTION - // A PropertySet maintains a set of name-value pairs. The - // get_all_property_names operation returns a sequence of names - // (PropertyNames). If there are additional names, the - // get_all_property_names operation returns an object supporting - // the PropertyNamesIterator interface with the additional names. -public: - // = Initialization and termination methods. - TAO_PropertyNamesIterator (TAO_PropertySet &property_set); - // Constructor. - - virtual ~TAO_PropertyNamesIterator (void); - // Destructor. - - virtual void reset (CORBA::Environment &env); - // The reset operation resets the position in an iterator to the - // first property name, if one exists. - - virtual CORBA::Boolean next_one (CORBA::String_out property_name, - CORBA::Environment &env); - // The next_one operation returns true if an item exists at the - // current position in the iterator with an output parameter of a - // property name. A return of false signifies no more items in the iterator. - - - virtual CORBA::Boolean next_n (CORBA::ULong how_many, - CosPropertyService::PropertyNames_out property_names, - CORBA::Environment &env); - // The next_n operation returns true if an item exists at the - // current position in the iterator and the how_many parameter was - // set greater than zero. The output is a PropertyNames sequence - // with at most the how_many number of names. A return of false - // signifies no more items in the iterator. - - virtual void destroy (CORBA::Environment &env); - // Destroys the iterator. -private: - typedef ACE_Hash_Map_Manager<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex> - COSPROPERTY_HASH_MAP; - typedef ACE_Hash_Map_Iterator<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex> - COSPROPERTY_HASH_ITERATOR; - typedef ACE_Hash_Map_Entry<CosProperty_Hash_Key, CosProperty_Hash_Value> - COSPROPERTY_HASH_ENTRY; - - COSPROPERTY_HASH_ITERATOR iterator_; - // The Iterator object. -}; +// forward declarations. +class TAO_PropertyNamesIterator; +class TAO_PropertiesIterator; +// Include templates here. +#include "CosPropertyService_i_T.h" class TAO_ORBSVCS_Export TAO_PropertySetDef : public virtual POA_CosPropertyService::PropertySetDef, - public virtual TAO_PropertySet + public virtual TAO_PropertySet<POA_CosPropertyService::PropertySetDef> { // = TITLE // This class implements PropertySetDef interface, which is @@ -416,7 +234,7 @@ public: // modes". private: - TAO_Unbounded_Sequence<TAO_PropertySet*> propertyset_products_; + TAO_Unbounded_Sequence<TAO_PropertySet<POA_CosPropertyService::PropertySet>*> propertyset_products_; // The PropertySet objects new'ed and given to the client. Let us // keep track all of them so that we can delete them at the end. }; @@ -459,8 +277,62 @@ private: // keep track all of them so that we can delete them at the end. }; -class TAO_ORBSVCS_Export TAO_PropertiesIterator : public virtual PortableServer::RefCountServantBase, - public virtual POA_CosPropertyService::PropertiesIterator +class TAO_ORBSVCS_Export TAO_PropertyNamesIterator : public virtual POA_CosPropertyService::PropertyNamesIterator +{ + // = TITLE + // The PropertyNamesIterator interface allows a client to + // iterate through the names using the next_one or next_n operations. + // + // = DESCRIPTION + // A PropertySet maintains a set of name-value pairs. The + // get_all_property_names operation returns a sequence of names + // (PropertyNames). If there are additional names, the + // get_all_property_names operation returns an object supporting + // the PropertyNamesIterator interface with the additional names. +public: + // = Initialization and termination methods. + TAO_PropertyNamesIterator (TAO_PropertySet<POA_CosPropertyService::PropertySet> &property_set); + // Constructor. + + virtual ~TAO_PropertyNamesIterator (void); + // Destructor. + + virtual void reset (CORBA::Environment &env); + // The reset operation resets the position in an iterator to the + // first property name, if one exists. + + virtual CORBA::Boolean next_one (CORBA::String_out property_name, + CORBA::Environment &env); + // The next_one operation returns true if an item exists at the + // current position in the iterator with an output parameter of a + // property name. A return of false signifies no more items in the iterator. + + + virtual CORBA::Boolean next_n (CORBA::ULong how_many, + CosPropertyService::PropertyNames_out property_names, + CORBA::Environment &env); + // The next_n operation returns true if an item exists at the + // current position in the iterator and the how_many parameter was + // set greater than zero. The output is a PropertyNames sequence + // with at most the how_many number of names. A return of false + // signifies no more items in the iterator. + + virtual void destroy (CORBA::Environment &env); + // Destroys the iterator. +private: + typedef ACE_Hash_Map_Manager<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex> + CosProperty_Hash_Map; + typedef ACE_Hash_Map_Iterator<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex> + CosProperty_Hash_Iterator; + typedef ACE_Hash_Map_Entry<CosProperty_Hash_Key, CosProperty_Hash_Value> + CosProperty_Hash_Entry; + typedef CosProperty_Hash_Entry * CosProperty_Hash_Entry_ptr; + + CosProperty_Hash_Iterator iterator_; + // The Iterator object. +}; + +class TAO_ORBSVCS_Export TAO_PropertiesIterator : public virtual POA_CosPropertyService::PropertiesIterator { // = TITLE // Thid class implements PropertiesIterator interface allows a client to @@ -476,7 +348,7 @@ class TAO_ORBSVCS_Export TAO_PropertiesIterator : public virtual PortableServer: // interface with the additional properties. public: // = Initialization and termination methods. - TAO_PropertiesIterator (TAO_PropertySet &property_set); + TAO_PropertiesIterator (TAO_PropertySet<POA_CosPropertyService::PropertySet> &property_set); // Constructor. virtual ~TAO_PropertiesIterator (void); @@ -506,17 +378,17 @@ public: private: typedef ACE_Hash_Map_Manager<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex> - COSPROPERTY_HASH_MAP; + CosProperty_Hash_Map; typedef ACE_Hash_Map_Iterator<CosProperty_Hash_Key, CosProperty_Hash_Value, ACE_Null_Mutex> - COSPROPERTY_HASH_ITERATOR; + CosProperty_Hash_Iterator; typedef ACE_Hash_Map_Entry<CosProperty_Hash_Key, CosProperty_Hash_Value> - COSPROPERTY_HASH_ENTRY; + CosProperty_Hash_Entry; + typedef CosProperty_Hash_Entry * CosProperty_Hash_Entry_ptr; - COSPROPERTY_HASH_ITERATOR iterator_; + CosProperty_Hash_Iterator iterator_; // The iterator object. }; - #if defined(_MSC_VER) #pragma warning(default:4250) #endif /* _MSC_VER */ |