summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-10-17 00:40:33 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-10-17 00:40:33 +0000
commit34956626c23ae3dae470877eed3fc4c96b19fcf9 (patch)
treef2f7bedfde1cfe4002552d5599722b16dde22a96
parent0f5e8ff1b24c69e848ed49975f656ee28d387b90 (diff)
downloadATCD-34956626c23ae3dae470877eed3fc4c96b19fcf9.tar.gz
.
-rw-r--r--ChangeLog-98b6
-rw-r--r--TAO/tao/NVList.cpp13
-rw-r--r--TAO/tao/Object_Table.i65
-rw-r--r--TAO/tao/Operation_Table.cpp25
-rw-r--r--TAO/tao/POA.cpp9
-rw-r--r--apps/JAWS/clients/Caching/Local_Locator.cpp11
-rw-r--r--examples/Registry/test_registry_iterator.cpp2
7 files changed, 79 insertions, 52 deletions
diff --git a/ChangeLog-98b b/ChangeLog-98b
index 06f6396ca2e..0849efd0e85 100644
--- a/ChangeLog-98b
+++ b/ChangeLog-98b
@@ -1,5 +1,11 @@
Fri Oct 16 15:45:08 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+ * tests/Upgradable_RW_Test.cpp: Revised the programming style ;-).
+
+ * tests/Map_Manager_Test.cpp: Replaced all uses of postfix ++
+ operators with prefix ++ operators because they are faster when
+ iterating over the various Maps.
+
* ace/[Hash_]Map_Manager: Today we decided to remove the use of
locking for the ACE[_Hash]_Map_Manager Iterators. The original
scheme acquired the mutex of the [Hash_]Map_Manager on every
diff --git a/TAO/tao/NVList.cpp b/TAO/tao/NVList.cpp
index ce05729f648..fb7b8b40fb6 100644
--- a/TAO/tao/NVList.cpp
+++ b/TAO/tao/NVList.cpp
@@ -128,8 +128,8 @@ CORBA_NVList::add_value (const char *name,
// the ORB, but rather that the ORB copies its value.
//
// Initialize the newly allocated memory using a copy
- // constructor that places the new "Any" value at just the right
- // place, and makes a "deep copy" of the data.
+ // constructor that places the new "Any" value at just the
+ // right place, and makes a "deep copy" of the data.
nv->any_ = value;
else
{
@@ -184,14 +184,13 @@ CORBA_NVList::add_value_consume (char * name,
// consume name
nv->name_ = name;
- // consume the value @@ (ASG) have we? we may need to destroy the in
- // parameter
+ // consume the value @@ (ASG) have we? we may need to destroy
+ // the in parameter
nv->any_ = *value;
return nv;
}
else
return 0;
-
}
//CORBA::Status
@@ -200,7 +199,6 @@ CORBA_NVList::remove (CORBA::ULong /*n*/, CORBA::Environment &/*env*/)
{
// not implemented
// @@ (ASG) - TODO
-
}
// Helper method
@@ -208,7 +206,8 @@ CORBA::NamedValue_ptr
CORBA_NVList::add_element (CORBA::Flags flags, CORBA::Environment &env)
{
env.clear ();
- if (ACE_BIT_DISABLED (flags, CORBA::ARG_IN | CORBA::ARG_OUT | CORBA::ARG_INOUT))
+ if (ACE_BIT_DISABLED (flags,
+ CORBA::ARG_IN | CORBA::ARG_OUT | CORBA::ARG_INOUT))
{
env.exception (new CORBA::BAD_PARAM (CORBA::COMPLETED_NO));
return 0;
diff --git a/TAO/tao/Object_Table.i b/TAO/tao/Object_Table.i
index ac03b9deafb..891d696f868 100644
--- a/TAO/tao/Object_Table.i
+++ b/TAO/tao/Object_Table.i
@@ -37,9 +37,7 @@ TAO_Object_Table_Iterator::TAO_Object_Table_Iterator (const TAO_Object_Table_Ite
: impl_ (0)
{
if (x.impl_ != 0)
- {
- this->impl_ = x.impl_->clone ();
- }
+ this->impl_ = x.impl_->clone ();
}
ACE_INLINE TAO_Object_Table_Iterator &
@@ -49,13 +47,9 @@ TAO_Object_Table_Iterator::operator= (const TAO_Object_Table_Iterator &x)
{
delete this->impl_;
if (x.impl_ == 0)
- {
- this->impl_ = 0;
- }
+ this->impl_ = 0;
else
- {
- this->impl_ = x.impl_->clone ();
- }
+ this->impl_ = x.impl_->clone ();
}
return *this;
}
@@ -230,7 +224,12 @@ TAO_Dynamic_Hash_ObjTable::begin (void) const
{
TAO_Dynamic_Hash_ObjTable *non_const =
ACE_const_cast(TAO_Dynamic_Hash_ObjTable*, this);
- return new TAO_Dynamic_Hash_ObjTable_Iterator (Iterator (non_const->hash_map_));
+
+ TAO_Object_Table_Iterator_Impl *tmp;
+ ACE_NEW_RETURN (tmp,
+ TAO_Dynamic_Hash_ObjTable_Iterator (Iterator (non_const->hash_map_)),
+ 0);
+ return tmp;
}
ACE_INLINE TAO_Object_Table_Iterator_Impl *
@@ -242,20 +241,28 @@ TAO_Dynamic_Hash_ObjTable::end (void) const
ACE_INLINE TAO_Object_Table_Iterator_Impl*
TAO_Dynamic_Hash_ObjTable_Iterator::clone (void) const
{
- return new TAO_Dynamic_Hash_ObjTable_Iterator (*this);
+ TAO_Object_Table_Iterator_Impl *tmp;
+ ACE_NEW_RETURN (tmp,
+ TAO_Dynamic_Hash_ObjTable_Iterator (*this),
+ 0);
+ return tmp;
}
ACE_INLINE const TAO_Object_Table_Entry &
TAO_Dynamic_Hash_ObjTable_Iterator::item (void) const
{
TAO_Object_Table_Entry &entry =
- ACE_const_cast(TAO_Object_Table_Entry&, this->entry_);
+ ACE_const_cast (TAO_Object_Table_Entry &,
+ this->entry_);
ACE_Hash_Map_Entry<PortableServer::ObjectId,PortableServer::Servant> *tmp;
- if (ACE_const_cast(TAO_Dynamic_Hash_ObjTable_Iterator*,this)->impl_.next (tmp) == 1)
+
+ if (ACE_const_cast (TAO_Dynamic_Hash_ObjTable_Iterator*,
+ this)->impl_.next (tmp) == 1)
{
entry.servant_ = tmp->int_id_;
entry.id_ = tmp->ext_id_;
}
+
return entry;
}
@@ -280,7 +287,11 @@ TAO_Array_ObjTable_Iterator::TAO_Array_ObjTable_Iterator (TAO_Object_Table_Entry
ACE_INLINE TAO_Object_Table_Iterator_Impl *
TAO_Array_ObjTable_Iterator::clone (void) const
{
- return new TAO_Array_ObjTable_Iterator (*this);
+ TAO_Object_Table_Iterator_Impl *tmp;
+ ACE_NEW_RETURN (tmp,
+ TAO_Array_ObjTable_Iterator (*this),
+ 0);
+ return tmp;
}
ACE_INLINE const TAO_Object_Table_Entry &
@@ -292,21 +303,21 @@ TAO_Array_ObjTable_Iterator::item (void) const
ACE_INLINE void
TAO_Array_ObjTable_Iterator::advance (void)
{
- this->pos_++;
+ ++this->pos_;
}
ACE_INLINE int
TAO_Array_ObjTable_Iterator::done (const TAO_Object_Table_Iterator_Impl *end) const
{
const TAO_Array_ObjTable_Iterator *tmp =
- ACE_dynamic_cast(const TAO_Array_ObjTable_Iterator*, end);
- return (this->pos_ == tmp->pos_);
+ ACE_dynamic_cast (const TAO_Array_ObjTable_Iterator*, end);
+ return this->pos_ == tmp->pos_;
}
ACE_INLINE
TAO_Linear_ObjTable::~TAO_Linear_ObjTable (void)
{
- delete[] this->table_;
+ delete [] this->table_;
}
ACE_INLINE int
@@ -337,13 +348,21 @@ TAO_Linear_ObjTable::system_id_size (void) const
ACE_INLINE TAO_Object_Table_Iterator_Impl *
TAO_Linear_ObjTable::begin (void) const
{
- return new TAO_Array_ObjTable_Iterator (this->table_);
+ TAO_Object_Table_Iterator_Impl *tmp;
+ ACE_NEW_RETURN (tmp,
+ TAO_Array_ObjTable_Iterator (this->table_),
+ 0);
+ return tmp;
}
ACE_INLINE TAO_Object_Table_Iterator_Impl*
TAO_Linear_ObjTable::end (void) const
{
- return new TAO_Array_ObjTable_Iterator (this->table_ + this->next_);
+ TAO_Object_Table_Iterator_Impl *tmp;
+ ACE_NEW_RETURN (tmp,
+ TAO_Array_ObjTable_Iterator (this->table_ + this->next_),
+ 0);
+ return tmp;
}
ACE_INLINE
@@ -381,8 +400,10 @@ TAO_Active_Demux_ObjTable::parse_object_id (const PortableServer::ObjectId &id,
id.get_buffer (),
sizeof id_data);
- index = id_data[TAO_Active_Demux_ObjTable::INDEX_FIELD];
- generation = id_data[TAO_Active_Demux_ObjTable::GENERATION_FIELD];
+ index =
+ id_data[TAO_Active_Demux_ObjTable::INDEX_FIELD];
+ generation =
+ id_data[TAO_Active_Demux_ObjTable::GENERATION_FIELD];
return 0;
}
diff --git a/TAO/tao/Operation_Table.cpp b/TAO/tao/Operation_Table.cpp
index 1c05f79b323..90ba0b8592a 100644
--- a/TAO/tao/Operation_Table.cpp
+++ b/TAO/tao/Operation_Table.cpp
@@ -119,8 +119,12 @@ TAO_Active_Demux_OpTable::TAO_Active_Demux_OpTable (const
CORBA::ULong dbsize)
: next_ (0),
tablesize_ (dbsize),
- tbl_ (new TAO_Active_Demux_OpTable_Entry[dbsize])
+ tbl_ (0)
{
+
+ ACE_NEW (tbl_,
+ TAO_Active_Demux_OpTable_Entry[dbsize]);
+
// The job of the constructor is to go thru each entry of the
// database and bind the operation name to its corresponding
// skeleton.
@@ -185,10 +189,10 @@ TAO_Perfect_Hash_OpTable::~TAO_Perfect_Hash_OpTable (void)
{
}
-
// Uses <{opname}> to look up the skeleton function and pass it back
-// in <{skelfunc}>. Returns non-negative integer on success, or -1
-// on failure.
+// in <{skelfunc}>. Returns non-negative integer on success, or -1 on
+// failure.
+
int
TAO_Perfect_Hash_OpTable::find (const char *opname,
TAO_Skeleton &skelfunc)
@@ -225,20 +229,20 @@ TAO_Binary_Search_OpTable::~TAO_Binary_Search_OpTable (void)
{
}
-
// Uses <{opname}> to look up the skeleton function and pass it back
-// in <{skelfunc}>. Returns non-negative integer on success, or -1
-// on failure.
+// in <{skelfunc}>. Returns non-negative integer on success, or -1 on
+// failure.
+
int
TAO_Binary_Search_OpTable::find (const char *opname,
- TAO_Skeleton &skelfunc)
+ TAO_Skeleton &skelfunc)
{
const TAO_operation_db_entry *entry = lookup (opname);
+
if (entry == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"TAO_Binary_Search_Table:find failed\n"),
-1);
-
// Valid entry. Figure out the skel_ptr.
skelfunc = entry->skel_ptr_;
@@ -302,7 +306,8 @@ TAO_Operation_Table_Factory::~TAO_Operation_Table_Factory (void)
TAO_Operation_Table *
TAO_Operation_Table_Factory::opname_lookup_strategy (void)
{
- TAO_Operation_Table_Parameters *p = TAO_OP_TABLE_PARAMETERS::instance ();
+ TAO_Operation_Table_Parameters *p =
+ TAO_OP_TABLE_PARAMETERS::instance ();
return p->concrete_strategy ();
}
diff --git a/TAO/tao/POA.cpp b/TAO/tao/POA.cpp
index 5d6086a94aa..0c386e897d3 100644
--- a/TAO/tao/POA.cpp
+++ b/TAO/tao/POA.cpp
@@ -2998,10 +2998,8 @@ TAO_POA::decode_string_to_sequence (TAO_Unbounded_Sequence<CORBA::Octet> &seq,
cp += 3;
}
else
- {
- // Copy it in
- seq[i] = *cp++;
- }
+ // Copy it in
+ seq[i] = *cp++;
}
// Set the length appropriately
@@ -3193,7 +3191,8 @@ TAO_POA_Manager::deactivate (CORBA::Boolean etherealize_objects,
// crisis (for example, unrecoverable error) situation.
for (POA_COLLECTION::iterator iterator = this->poa_collection_.begin ();
- iterator != this->poa_collection_.end () && env.exception () == 0;
+ iterator != this->poa_collection_.end ()
+ && env.exception () == 0;
++iterator)
{
TAO_POA *poa = *iterator;
diff --git a/apps/JAWS/clients/Caching/Local_Locator.cpp b/apps/JAWS/clients/Caching/Local_Locator.cpp
index 67b4ca8b606..5c084bd783a 100644
--- a/apps/JAWS/clients/Caching/Local_Locator.cpp
+++ b/apps/JAWS/clients/Caching/Local_Locator.cpp
@@ -37,18 +37,15 @@ ACE_URL_Local_Locator::url_query (const ACE_URL_Locator::ACE_Selection_Criteria
size_t i_db;
int found = 0;
- // Now this is a stupid implementation. Perhaps we can implement this
- // using Hash_Map. Better yet, I think we should put this in a database
- // and put SQL query here.
+ // Now this is a stupid implementation. Perhaps we can
+ // implement this using Hash_Map. Better yet, I think we should
+ // put this in a database and put SQL query here.
for (i_query = 0; found == 0 && i_query < pseq->size (); i_query++)
for (i_db = 0; i_db < item->offer_->url_properties ().size (); i_db++)
{
if ((*pseq)[i_query].name () == item->offer_->url_properties ()[i_db].name ())
if (how == ACE_URL_Locator::SOME)
- {
-
-
- }
+ ;
// if match and Some, copy to <offer>, inc <num_query>, advance iterator
diff --git a/examples/Registry/test_registry_iterator.cpp b/examples/Registry/test_registry_iterator.cpp
index 7794a02e42f..fadd6e52f01 100644
--- a/examples/Registry/test_registry_iterator.cpp
+++ b/examples/Registry/test_registry_iterator.cpp
@@ -66,7 +66,7 @@ print_naming_context (ACE_Registry::Naming_Context &naming_context,
// Iterator through all entries
for (ACE_Registry::Binding_List::iterator i = list.begin ();
i != list.end ();
- i++)
+ ++i)
{
// Yeeesss! STL rules!
ACE_Registry::Binding &binding = *i;