summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-03-20 04:42:46 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-03-20 04:42:46 +0000
commita6a07c0e67c6429ddd2c4bc36c8d263593b0864a (patch)
treef6c397cfdb592601827521f23a5ba2f776a6ec36
parent9cfd0ef2ccd8996e56fd2507fa8cdd9acff2147e (diff)
downloadATCD-a6a07c0e67c6429ddd2c4bc36c8d263593b0864a.tar.gz
*** empty log message ***
-rw-r--r--TAO/docs/releasenotes/ec.html18
-rw-r--r--TAO/docs/releasenotes/index.html2
-rw-r--r--TAO/docs/releasenotes/orbcore.html2
-rw-r--r--TAO/examples/Simulator/README5
-rw-r--r--TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.cpp282
-rw-r--r--TAO/orbsvcs/orbsvcs/Property/CosProperty_Hash.cpp15
6 files changed, 208 insertions, 116 deletions
diff --git a/TAO/docs/releasenotes/ec.html b/TAO/docs/releasenotes/ec.html
index 599810c899b..ec703e4759c 100644
--- a/TAO/docs/releasenotes/ec.html
+++ b/TAO/docs/releasenotes/ec.html
@@ -6,10 +6,8 @@
</HEAD>
<BODY>
- <CENTER>
<H3>Event Service Status</H3>
Point of contact: <A HREF="mailto:coryan@cs.wustl.edu">Carlos O'Ryan</A>
- </CENTER>
<H4>Last Updated: $Date$ </H4>
@@ -114,35 +112,37 @@
<H3>Features in previous releases</H3>
+<UL>
<LI>
When several suppliers are consumers are distributed over the
network it could be nice to exploit locality and have a
separate Event Channel on each process (or host).
Only when an event is required by some remote consumer we need
- to send it through the network.
+ to send it through the network. <P>
The basic architecture to achieve this seems very simple,
each Event Channel has a proxy that connects to the EC peers,
providing a "merge" of its (local) consumer subscriptions as
- its own subscription list.
+ its own subscription list. <P>
Locally the proxy connects as a supplier,
- publishing all the events it has register for.
+ publishing all the events it has register for. <P>
To avoid event looping the events carry a time-to-live field
that is decremented each time the event goes through a proxy,
when the TTL gets to zero the event is not propagated by the
- proxy.
+ proxy. <P>
In the current release an experimental implementation is
provided,
it basically hardcodes all the subscriptions and publications,
we are researching on how to automatically build the
- publication list.</LI>
+ publication list.<P>
- <LI>
+ <LI> <P>
We use the COS Time Service types (not the services) to
- specify time for the Event Service and Scheduling Service.</LI>
+ specify time for the Event Service and Scheduling Service.<P>
+</UL>
</BODY>
</HTML>
diff --git a/TAO/docs/releasenotes/index.html b/TAO/docs/releasenotes/index.html
index a7a4fcd0ae4..ee9ec381688 100644
--- a/TAO/docs/releasenotes/index.html
+++ b/TAO/docs/releasenotes/index.html
@@ -435,7 +435,7 @@ Concurrency Control Service Specification.</A>
<P>
<HR>
-<A NAME="av"></A>CORBA Audio/Video Control Service</H3><br>
+<H3><A NAME="av"></A>CORBA Audio/Video Control Service</H3>
Point of contact: <A HREF="mailto:sumedh@cs.wustl.edu">Sumedh
Mungee</a> and <A HREF="mailto:naga@cs.wustl.edu">Nagarajan
diff --git a/TAO/docs/releasenotes/orbcore.html b/TAO/docs/releasenotes/orbcore.html
index 8ae4cb68dca..1f5ea690923 100644
--- a/TAO/docs/releasenotes/orbcore.html
+++ b/TAO/docs/releasenotes/orbcore.html
@@ -8,7 +8,7 @@
</head>
<HR> <H3><A NAME="orb"></A>ORB &amp; ORB Core</H3> Point of
- contact: <A HREF="mailto:cleeland@cs.wustl.edu">Chris Cleeland</A>
+ contact: <A HREF="mailto:nanbor@cs.wustl.edu">Nanbor Wang</A>
<p>Last Update: $Date$ </P>
diff --git a/TAO/examples/Simulator/README b/TAO/examples/Simulator/README
index 8f728b8afcc..fe6a805a023 100644
--- a/TAO/examples/Simulator/README
+++ b/TAO/examples/Simulator/README
@@ -17,7 +17,6 @@ Implementation: A C++ Supplier pushes events containing a
consumer extracts the data of the structs and dispatches
it to various display components.
-
Requirements:
C++ compiler, TAO environment, Visibroker 3.2 for JAVA
@@ -81,9 +80,6 @@ Compiling:
make
-
-
-
DOVE Browser: in directory $TAO/orbsvcs/tests/Simulator/Sim_Display/.)
cp ../NavWeap.idl .
cp $TAO_ROOT/orbsvcs/orbsvcs/CosNaming.idl .
@@ -100,7 +96,6 @@ Compiling:
vbjc *.java
-
Starting:
Supplier:
diff --git a/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.cpp b/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.cpp
index 5a479f81528..0f73dbbc76e 100644
--- a/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/Property/CosPropertyService_i.cpp
@@ -1,5 +1,5 @@
// $Id$
-//
+
// ============================================================================
//
// = LIBRARY
@@ -23,7 +23,6 @@ CosPropertyService::PropertySet_ptr
TAO_PropertySetFactory::create_propertyset (CORBA::Environment &env)
{
CosPropertyService::PropertySet_ptr return_val = 0;
-
return return_val;
}
@@ -60,7 +59,7 @@ TAO_PropertySetDefFactory::~TAO_PropertySetDefFactory (void)
}
CosPropertyService::PropertySetDef_ptr
-TAO_PropertySetDefFactory::create_propertysetdef ( CORBA::Environment &env)
+TAO_PropertySetDefFactory::create_propertysetdef (CORBA::Environment &env)
{
CosPropertyService::PropertySetDef_ptr return_val = 0;
@@ -69,8 +68,8 @@ TAO_PropertySetDefFactory::create_propertysetdef ( CORBA::Environment &env)
CosPropertyService::PropertySetDef_ptr
TAO_PropertySetDefFactory::create_constrained_propertysetdef (const CosPropertyService::PropertyTypes &allowed_property_types,
- const CosPropertyService::PropertyDefs &allowed_property_defs,
- CORBA::Environment &env)
+ const CosPropertyService::PropertyDefs &allowed_property_defs,
+ CORBA::Environment &env)
{
CosPropertyService::PropertySetDef_ptr return_val = 0;
@@ -87,25 +86,28 @@ TAO_PropertySetDefFactory::create_initial_propertysetdef (const CosPropertyServi
}
// Makes default sized hash_table_.
+
TAO_PropertySet::TAO_PropertySet (void)
{
ACE_DEBUG ((LM_DEBUG,
- "TAO_PropertySet Constructor-Hash_Map_Manager created:: CurntSize : %d , TotalSize : %d \n",
+ "TAO_PropertySet Constructor-Hash_Map_Manager created, current_size %d, total_size %d \n",
this->hash_table_.current_size (),
this->hash_table_.total_size ()));
}
// Destructor.
+
TAO_PropertySet::~TAO_PropertySet (void)
{
}
-// Function to modify or add a property to the PropertySet
-// alex: Just adds the name value to the set... Doesn't check for
-// Typecode overwriting, duplicate names, void names etc, yet.
-// @@ Using Normal mode as the default mode of properties, I need to
-// change this based on the Initial set of allowed modes, if there is
-// anything like that set by the client.
+// Function to modify or add a property to the PropertySet alex: Just
+// adds the name value to the set... Doesn't check for Typecode
+// overwriting, duplicate names, void names etc, yet. @@ Using Normal
+// mode as the default mode of properties, I need to change this based
+// on the Initial set of allowed modes, if there is anything like that
+// set by the client.
+
void
TAO_PropertySet::define_property (const char *property_name,
const CORBA::Any &property_value,
@@ -127,22 +129,23 @@ TAO_PropertySet::define_property (const char *property_name,
ret));
}
-// Defining a sequence of properties ( Need to check for overwriting,
-// duplicate names, void names etc.
+// Defining a sequence of properties
+//
+// @@ Need to check for overwriting, duplicate names, void names etc.
+
void
TAO_PropertySet::define_properties (const CosPropertyService::Properties &nproperties,
CORBA::Environment &env)
{
for (int pi = 0; pi < nproperties.length (); pi++)
- {
- this->define_property (nproperties [pi].property_name.in (),
- nproperties [pi].property_value,
- env);
- }
+ this->define_property (nproperties [pi].property_name.in (),
+ nproperties [pi].property_value,
+ env);
}
// Returns the current number of properties associated with this
// PropertySet.
+
CORBA::ULong
TAO_PropertySet::get_number_of_properties ( CORBA::Environment &env)
{
@@ -153,27 +156,39 @@ TAO_PropertySet::get_number_of_properties ( CORBA::Environment &env)
// PropertySet. If the PropertySet contains more than how_many
// property names, then the remaining property names are put into the
// PropertyNamesIterator.
+
void
TAO_PropertySet::get_all_property_names (CORBA::ULong how_many,
CosPropertyService::PropertyNames_out property_names,
CosPropertyService::PropertyNamesIterator_out rest,
CORBA::Environment &env)
{
- size_t num_of_properties = get_number_of_properties (env);
+ size_t num_of_properties =
+ this->get_number_of_properties (env);
+
if (num_of_properties == 0)
// Nothing to do.
return;
+
// Set the length of the property_names appropriately.
CORBA::ULong sequence_length = 0;
+
if (how_many > 0)
{
- property_names = new CosPropertyService::PropertyNames;
- sequence_length = (how_many >= num_of_properties) ? num_of_properties : how_many;
+ ACE_NEW (property_names,
+ CosPropertyService::PropertyNames);
+ if (how_many >= num_of_properties)
+ sequence_length = num_of_properties;
+ else
+ sequence_length = how_many;
property_names->length (sequence_length);
}
+
// Iterate thru names and put them in the property_names.
+
CosProperty_Hash_Entry_ptr entry_ptr;
CosProperty_Hash_Iterator iterator (this->hash_table_);
+
for (int ni = 0;
ni < sequence_length;
ni++, iterator.advance ())
@@ -181,25 +196,34 @@ TAO_PropertySet::get_all_property_names (CORBA::ULong how_many,
property_names [ni] = CORBA::string_dup (entry_ptr->ext_id_.pname_);
// If there are some more properties, put them in the
- // iterator. How?? Make a new PropertSet and use that to create
+ // iterator. How?? Make a new PropertSet and use that to create
// propertyNames Iterator.
+
if (num_of_properties > how_many)
{
- TAO_PropertySet *property_set = new TAO_PropertySet;
+ TAO_PropertySet *property_set;
+
+ ACE_NEW (property_set, TAO_PropertySet);
+
for (size_t i = how_many;
i < num_of_properties;
i++, iterator.advance ())
if (iterator.next (entry_ptr) != 0)
if (property_set->hash_table_.bind (entry_ptr->ext_id_,
entry_ptr->int_id_) < 0)
- ACE_DEBUG ((LM_DEBUG, "Err: get_all_property_names\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Err: get_all_property_names\n"));
+
// Make the NamesIterator out of this TAO_PropertySet.
- TAO_PropertyNamesIterator *names_iterator = new TAO_PropertyNamesIterator (*property_set);
+ TAO_PropertyNamesIterator *names_iterator;
+ ACE_NEW (names_iterator, TAO_PropertyNamesIterator (*property_set));
+
rest = CosPropertyService::PropertyNamesIterator::_duplicate (names_iterator->_this (env));
}
}
// Returns the value of a property in the PropertySet.
+
CORBA::Any *
TAO_PropertySet::get_property_value (const char *property_name,
CORBA::Environment &env)
@@ -207,12 +231,15 @@ TAO_PropertySet::get_property_value (const char *property_name,
CosProperty_Hash_Key hash_key (CORBA::string_copy (property_name));
CosProperty_Hash_Value hash_value;
- ACE_DEBUG ((LM_DEBUG, "get_prop_value: hash_key.pname_.in () : %s \n",
+ ACE_DEBUG ((LM_DEBUG,
+ "get_prop_value: hash_key.pname_.in () : %s \n",
hash_key.pname_.in ()));
if (this->hash_table_.find (hash_key, hash_value) != 0)
- ACE_ERROR ((LM_ERROR, "Find failed: \n"));
+ ACE_ERROR ((LM_ERROR,
+ "Find failed: \n"));
else
- ACE_DEBUG ((LM_DEBUG, "Find succeeded \n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "Find succeeded \n"));
return hash_value.pvalue_._retn ();
}
@@ -221,37 +248,53 @@ TAO_PropertySet::get_property_value (const char *property_name,
// values for all requested property names. If false, then all
// properties with a value of type tk_void may have failed due to
// PropertyNotFound or InvalidPropertyName.
+
CORBA::Boolean
TAO_PropertySet::get_properties (const CosPropertyService::PropertyNames &property_names,
CosPropertyService::Properties_out nproperties,
CORBA::Environment &env)
{
size_t n = property_names.length ();
+
if (n == 0)
return CORBA::B_FALSE;
+
CORBA::Any_ptr any_ptr = 0;
- nproperties = new CosPropertyService::Properties;
+
+ ACE_NEW_RETURN (nproperties,
+ CosPropertyService::Properties,
+ CORBA::B_FALSE);
+
nproperties->length (n);
+
CORBA::Boolean ret_val = CORBA::B_TRUE;
+
for (size_t i = 0; i < n; i++)
- if ((any_ptr = get_property_value (property_names [i], env)) != 0)
- {
- // Property name is valid.
- nproperties [i].property_name = CORBA::string_dup (property_names [i]);
- nproperties [i].property_value = *any_ptr;
- }
- else
- {
- // Invalid name. Ret value is False.
- ret_val = CORBA::B_FALSE;
- nproperties [i].property_name = CORBA::string_dup (property_names [i]);
- // @@ Make any value with tk_void type. Using replace method,
- // <<= operator doesnot exist yet for this.
- nproperties [i].property_value.replace (CORBA::_tc_void,
- 0,
- CORBA::B_FALSE,
- env);
- }
+ {
+ any_ptr = get_property_value (property_names [i], env);
+
+ if (any_ptr != 0)
+ {
+ // Property name is valid.
+ nproperties [i].property_name =
+ CORBA::string_dup (property_names [i]);
+ nproperties [i].property_value = *any_ptr;
+ }
+ else
+ {
+ // Invalid name. Ret value is False.
+ ret_val = CORBA::B_FALSE;
+ nproperties [i].property_name =
+ CORBA::string_dup (property_names [i]);
+
+ // @@ Make any value with tk_void type. Using replace
+ // method, <<= operator doesnot exist yet for this.
+ nproperties [i].property_value.replace (CORBA::_tc_void,
+ 0,
+ CORBA::B_FALSE,
+ env);
+ }
+ }
TAO_CHECK_ENV_RETURN (env, 1);
return ret_val;
}
@@ -262,49 +305,74 @@ TAO_PropertySet::get_all_properties (CORBA::ULong how_many,
CosPropertyService::PropertiesIterator_out rest,
CORBA::Environment &env)
{
- size_t num_of_properties = hash_table_.current_size ();
+ size_t num_of_properties =
+ hash_table_.current_size ();
+
if (num_of_properties == 0)
return;
+
// Alloc memory for nproperties if how_many > 0.
CORBA::ULong sequence_length = 0;
+
if (how_many > 0)
{
- nproperties= new CosPropertyService::Properties;
- sequence_length = (how_many >= num_of_properties) ? num_of_properties : how_many;
+ ACE_NEW (nproperties,
+ CosPropertyService::Properties);
+ if (how_many >= num_of_properties)
+ sequence_length = num_of_properties;
+ else
+ sequence_length = how_many;
nproperties->length (sequence_length);
}
+
// Prepare an iterator and iterate thru the PropertySet. Retrive the
// values.
CosProperty_Hash_Iterator iterator (this->hash_table_);
CosProperty_Hash_Entry_ptr entry_ptr = 0;
+
for (CORBA::ULong i = 0;
i < sequence_length;
i++, iterator.advance ())
if (iterator.next (entry_ptr) != 0)
{
- nproperties[i].property_name = CORBA::string_dup (entry_ptr->ext_id_.pname_);
- nproperties[i].property_value = entry_ptr->int_id_.pvalue_.in ();
+ nproperties[i].property_name =
+ CORBA::string_dup (entry_ptr->ext_id_.pname_);
+ nproperties[i].property_value =
+ entry_ptr->int_id_.pvalue_.in ();
}
// If there are more properties, put them in the PropertiesIterator.
// Make a new TAO_PropertySet and use that to create an Properties
// iterator. put that in a iterator and assign that to the out
- // paramerter.
+ // paramerter.
+
if (num_of_properties > how_many)
{
- TAO_PropertySet *prop_set = new TAO_PropertySet;
- for (size_t i = how_many; i < num_of_properties; i++, iterator.advance ())
- if (iterator.next (entry_ptr) != 0)
- if (prop_set->hash_table_.bind (entry_ptr->ext_id_,
- entry_ptr->int_id_) < 0)
- ACE_DEBUG ((LM_DEBUG, "Err: get_all_properties\n"));
+ TAO_PropertySet *prop_set;
+
+ ACE_NEW (prop_set, TAO_PropertySet);
+
+ for (size_t i = how_many;
+ i < num_of_properties;
+ i++)
+ {
+ if (iterator.next (entry_ptr) != 0)
+ if (prop_set->hash_table_.bind (entry_ptr->ext_id_,
+ entry_ptr->int_id_) < 0)
+ ACE_DEBUG ((LM_DEBUG, "Err: get_all_properties\n"));
+ iterator.advance ();
+ }
+
// Make the iterator out of the new TAO_Propset.
- TAO_PropertiesIterator *prop_iterator = new TAO_PropertiesIterator (*prop_set);
+ ACE_NEW (TAO_PropertiesIterator *prop_iterator,
+ TAO_PropertiesIterator (*prop_set));
+
rest = CosPropertyService::PropertiesIterator::_duplicate (prop_iterator->_this (env));
}
}
// Deletes the specified property if it exists from a PropertySet.
+
void
TAO_PropertySet::delete_property (const char *property_name,
CORBA::Environment &env)
@@ -314,58 +382,59 @@ TAO_PropertySet::delete_property (const char *property_name,
ACE_DEBUG ((LM_DEBUG, "delete_property : hash_key.pname_.in() %s \n",
hash_key.pname_.in()));
// Doing unbinding.. Not getting CosProperty_Hash_Value
- // back... Problem if dynamic allocation is done.
- // @@ Is memory deallocation done?
+ // back... Problem if dynamic allocation is done. @@ Is memory
+ // deallocation done?
if (this->hash_table_.unbind (hash_key) != 0)
ACE_ERROR ((LM_ERROR,
"Unbind failed \n"));
}
// Deletes the properties defined in the property_names
-// parameter. This is a batch operation that returns the
-// MultipleExceptions exception if any delete failed.
+// parameter. This is a batch operation that returns the
+// MultipleExceptions exception if any delete failed.
+
void
TAO_PropertySet::delete_properties (const CosPropertyService::PropertyNames &property_names,
CORBA::Environment &env)
{
for (size_t pi = 0; pi < property_names.length (); pi++)
- delete_property (property_names[pi], env);
+ this->delete_property (property_names[pi], env);
}
// Delete all the properties in the current ProperySet : Do it one by
// one. close () and then open ().
+
CORBA::Boolean
TAO_PropertySet::delete_all_properties (CORBA::Environment &env)
{
if (hash_table_.close () != 0)
- {
- ACE_DEBUG ((LM_DEBUG, "delete_all_properties:Error Closing the Hash_Map_Manager"));
- return CORBA::B_FALSE;
- }
- if (hash_table_.open () != 0)
- {
- ACE_DEBUG ((LM_DEBUG, "Could not open Hash_Map_Manager"));
- return CORBA::B_FALSE;
- }
- return CORBA::B_TRUE;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "delete_all_properties:Error Closing the Hash_Map_Manager"),
+ CORBA::B_FALSE);
+ else if (hash_table_.open () != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not open Hash_Map_Manager"),
+ CORBA::B_FALSE);
+ else
+ return CORBA::B_TRUE;
}
// Returns TRUE if the property is defined in the PropertySet.
+
CORBA::Boolean
TAO_PropertySet::is_property_defined (const char *property_name, CORBA::Environment &env)
{
CosProperty_Hash_Key hash_key (property_name);
if (this->hash_table_.find (hash_key) == 0)
- {
- ACE_DEBUG ((LM_DEBUG, "is_property_defined :find successfull \n"));
- return CORBA::B_TRUE;
- }
+ ACE_DEBUG ((LM_DEBUG,
+ "is_property_defined :find successfull \n"));
else
- {
- ACE_DEBUG ((LM_DEBUG, "is_property_defined :find failed \n"));
- return CORBA::B_FALSE;
- }
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "is_property_defined :find failed \n"),
+ CORBA::B_FALSE);
+
+ return CORBA::B_TRUE;
}
TAO_PropertySetDef::TAO_PropertySetDef (void)
@@ -435,18 +504,21 @@ TAO_PropertySetDef::set_property_modes (const CosPropertyService::PropertyModes
}
// Constructor. Construct the iterator from the PropertySet object.
+
TAO_PropertyNamesIterator::TAO_PropertyNamesIterator (TAO_PropertySet &property_set)
: iterator_ (property_set.hash_table_)
{
}
// Destructor.
-TAO_PropertyNamesIterator::~TAO_PropertyNamesIterator ()
+
+TAO_PropertyNamesIterator::~TAO_PropertyNamesIterator (void)
{
}
// Resets the position in an iterator to the first property name, if
// one exists.
+
void
TAO_PropertyNamesIterator::reset (CORBA::Environment &env)
{
@@ -455,15 +527,19 @@ TAO_PropertyNamesIterator::reset (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.
+// property name. A return of false signifies no more items in the
+// iterator.
+
CORBA::Boolean
TAO_PropertyNamesIterator::next_one (CORBA::String_out property_name,
CORBA::Environment &env)
{
CosProperty_Hash_Entry_ptr entry_ptr;
+
if (this->iterator_.next (entry_ptr) != 0)
{
- property_name = CORBA::string_copy (entry_ptr->ext_id_.pname_);
+ property_name =
+ CORBA::string_copy (entry_ptr->ext_id_.pname_);
this->iterator_.advance ();
return CORBA::B_TRUE;
}
@@ -480,16 +556,24 @@ TAO_PropertyNamesIterator::next_n (CORBA::ULong how_many,
CORBA::Environment &env)
{
CosProperty_Hash_Entry_ptr entry_ptr = 0;
- if ((this->iterator_.next (entry_ptr) == 0) || (how_many == 0))
+
+ if (this->iterator_.next (entry_ptr) == 0 || how_many == 0)
return CORBA::B_FALSE;
- property_names = new CosPropertyService::PropertyNames;
- size_t size = this->iterator_.map().current_size ();
- property_names->length ((how_many <= size) ? how_many : size);
+
+ ACE_NEW_RETURN (property_names,
+ CosPropertyService::PropertyNames,
+ CORBA::B_FALSE);
+
+ size_t size = this->iterator_.map ().current_size ();
+
+ property_names->length (how_many <= size ? how_many : size);
+
for (size_t ni = 0;
ni < property_names->length ();
ni++, this->iterator_.advance ())
if (this->iterator_.next (entry_ptr) != 0)
property_names [ni] = CORBA::string_dup (entry_ptr->ext_id_.pname_);
+
return CORBA::B_TRUE;
}
@@ -503,7 +587,7 @@ TAO_PropertiesIterator::TAO_PropertiesIterator (TAO_PropertySet &property_set)
{
}
-TAO_PropertiesIterator::~TAO_PropertiesIterator ()
+TAO_PropertiesIterator::~TAO_PropertiesIterator (void)
{
}
@@ -518,6 +602,7 @@ TAO_PropertiesIterator::next_one (CosPropertyService::Property_out aproperty,
CORBA::Environment &env)
{
CosProperty_Hash_Entry_ptr entry_ptr;
+
if (this->iterator_.next (entry_ptr) != 0)
{
aproperty = new CosPropertyService::Property ;
@@ -536,11 +621,18 @@ TAO_PropertiesIterator::next_n (CORBA::ULong how_many,
CORBA::Environment &env)
{
CosProperty_Hash_Entry_ptr entry_ptr = 0;
- if ((this->iterator_.next (entry_ptr) == 0) || (how_many == 0))
+
+ if (this->iterator_.next (entry_ptr) == 0 || how_many == 0)
return CORBA::B_FALSE;
- nproperties = new CosPropertyService::Properties;
+
+ ACE_NEW_RETURN (nproperties,
+ CosPropertyService::Properties,
+ CORBA::B_FALSE);
+
size_t size = this->iterator_.map ().current_size ();
- nproperties->length ((how_many <= size) ? how_many : size);
+
+ nproperties->length (how_many <= size ? how_many : size);
+
for (size_t ni = 0;
ni < nproperties->length ();
ni++,
diff --git a/TAO/orbsvcs/orbsvcs/Property/CosProperty_Hash.cpp b/TAO/orbsvcs/orbsvcs/Property/CosProperty_Hash.cpp
index c632f9d8f56..c0138c527cb 100644
--- a/TAO/orbsvcs/orbsvcs/Property/CosProperty_Hash.cpp
+++ b/TAO/orbsvcs/orbsvcs/Property/CosProperty_Hash.cpp
@@ -37,9 +37,12 @@ CosProperty_Hash_Key::CosProperty_Hash_Key (const CosProperty_Hash_Key &src)
int
CosProperty_Hash_Key::operator == (const CosProperty_Hash_Key &hash_key) const
{
- ACE_DEBUG ((LM_DEBUG, "CosProperty_Hash_Key::operator == : %s == %s \n",
- this->pname_.in (), hash_key.pname_.in ()));
- return ACE_OS::strcmp (this->pname_.in (), hash_key.pname_.in ()) == 0;
+ ACE_DEBUG ((LM_DEBUG,
+ "CosProperty_Hash_Key::operator == : %s == %s \n",
+ this->pname_.in (),
+ hash_key.pname_.in ()));
+ return ACE_OS::strcmp (this->pname_.in (),
+ hash_key.pname_.in ()) == 0;
}
u_long
@@ -47,8 +50,10 @@ CosProperty_Hash_Key::hash (void) const
{
u_long ret = ACE::hash_pjw (this->pname_.in ());
- ACE_DEBUG ((LM_DEBUG, "CosProperty_Hash_Key::hash : hashing %s : val : %d \n",
- this->pname_.in (), ret));
+ ACE_DEBUG ((LM_DEBUG,
+ "CosProperty_Hash_Key::hash : hashing %s : val : %d \n",
+ this->pname_.in (),
+ ret));
return ret;
}