summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-03-31 17:21:22 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-03-31 17:21:22 +0000
commitc89baee2d796fb1b777941834f85d875f0c0a014 (patch)
tree85403bb5f7c7380612705a96ea7f7984ec774254 /TAO/tao
parentabf4db788ff308dfd6dc375ea40953e22531104b (diff)
downloadATCD-c89baee2d796fb1b777941834f85d875f0c0a014.tar.gz
ChangeLogTag:Tue Mar 31 11:05:23 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/Connect.cpp7
-rw-r--r--TAO/tao/IIOP_ORB.cpp88
-rw-r--r--TAO/tao/Sequence.cpp4
-rw-r--r--TAO/tao/Sequence.i2
-rw-r--r--TAO/tao/Sequence_T.cpp41
-rw-r--r--TAO/tao/Sequence_T.i10
-rw-r--r--TAO/tao/decode.cpp3
7 files changed, 105 insertions, 50 deletions
diff --git a/TAO/tao/Connect.cpp b/TAO/tao/Connect.cpp
index 0156d47befc..c0841476165 100644
--- a/TAO/tao/Connect.cpp
+++ b/TAO/tao/Connect.cpp
@@ -538,6 +538,10 @@ TAO_Client_Connection_Handler::send_request (TAO_OutputCDR &stream,
// connection handler were obtained from a factory, then this could
// be dynamically linked in (wouldn't that be cool/freaky?)
+ // Set the state so that we know we're looking for a response.
+ if (is_twoway)
+ this->expecting_response_ = 1;
+
int success = (int) TAO_GIOP::send_request (this, stream);
if (!success)
@@ -545,9 +549,6 @@ TAO_Client_Connection_Handler::send_request (TAO_OutputCDR &stream,
if (is_twoway)
{
- // Set the state so that we know we're looking for a response.
- this->expecting_response_ = 1;
-
// Go into a loop, waiting until it's safe to try to read
// something on the soket. The handle_input() method doesn't
// actualy do the read, though, proper behavior based on what is
diff --git a/TAO/tao/IIOP_ORB.cpp b/TAO/tao/IIOP_ORB.cpp
index 2260bc17923..7f22c642992 100644
--- a/TAO/tao/IIOP_ORB.cpp
+++ b/TAO/tao/IIOP_ORB.cpp
@@ -280,7 +280,8 @@ iiop_string_to_object (CORBA::String string,
string);
// Create the CORBA level proxy.
- TAO_ServantBase *servant = TAO_ORB_Core_instance ()->orb ()->_get_collocated_servant (data);
+ TAO_ServantBase *servant =
+ TAO_ORB_Core_instance ()->orb ()->_get_collocated_servant (data);
CORBA_Object *obj = new CORBA_Object (data, servant, servant != 0);
@@ -319,51 +320,110 @@ int
IIOP_ORB::_register_collocation (ACE_Addr &addr)
{
if (this->optimize_collocation_objects_)
- return this->collocation_record_.insert ((ACE_INET_Addr&) addr);
- else
- return 0;
+ {
+ ACE_INET_Addr& ia =
+ ACE_reinterpret_cast (ACE_INET_Addr&, addr);
+
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ "IIOP_ORB: register collocation addr <%s:%d>\n",
+ ia.get_host_name(),
+ ia.get_port_number()));
+#endif
+ return this->collocation_record_.insert (ia);
+ }
+ return 0;
}
TAO_ServantBase *
IIOP_ORB::_get_collocated_servant (STUB_Object *sobj)
{
+ // ACE_DEBUG ((LM_DEBUG, "IIOP_ORB: get_collocated_servant\n"));
+
if (this->optimize_collocation_objects_ && sobj != 0)
{
IIOP_Object *iiopobj;
- // Make sure users passed in an IIOP_Object otherwise, we don't know what to do next.
+ // Make sure users passed in an IIOP_Object otherwise, we don't
+ // know what to do next.
if (sobj->QueryInterface (IID_IIOP_Object, (void **) &iiopobj) != TAO_NOERROR)
{
- ACE_ERROR ((LM_ERROR, "%p: Passing IIOP ORB and non-IIOP object\n", "_get_collocated_object"));
- return 0; // Something must be wrong!
+#if 0
+ ACE_ERROR ((LM_ERROR,
+ "%p: Passing IIOP ORB and non-IIOP object\n",
+ "_get_collocated_object"));
+#endif
+ // Something must be wrong!
+ return 0;
}
-
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ "IIOP_ORB: checking collocation for <%s:%d>\n",
+ iiopobj->profile.object_addr().get_host_name(),
+ iiopobj->profile.object_addr().get_port_number()));
+#endif
+
+ // Check if the object requested is a collocated object.
if (this->collocation_record_.find (iiopobj->profile.object_addr ()) == 0)
- // Check if the object requested is a collocated object.
{
CORBA::Environment env;
- TAO_ObjectKey *objkey = iiopobj->key (env);
+ TAO_ObjectKey_var objkey = iiopobj->key (env);
+
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ "IIOP_ORB: the addr is collocated <%s:%d>\n",
+ iiopobj->profile.object_addr().get_host_name(),
+ iiopobj->profile.object_addr().get_port_number()));
+#endif
if (env.exception ())
{
- delete objkey;
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ "IIOP_ORB: cannot find key for <%s:%d>\n",
+ iiopobj->profile.object_addr().get_host_name(),
+ iiopobj->profile.object_addr().get_port_number()));
+#endif
return 0;
}
TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa ();
if (poa != 0)
{
- PortableServer::Servant servant = poa->find_servant (*objkey,
- env);
+ PortableServer::Servant servant =
+ poa->find_servant (objkey.in (), env);
if (env.exception ())
{
- delete objkey;
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ "IIOP_ORB: cannot find servant for <%s:%d>\n",
+ iiopobj->profile.object_addr().get_host_name(),
+ iiopobj->profile.object_addr().get_port_number()));
+#endif
return 0;
}
+
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ "IIOP_ORB: object at <%s:%d> is collocated\n",
+ iiopobj->profile.object_addr().get_host_name(),
+ iiopobj->profile.object_addr().get_port_number()));
+#endif
return servant;
}
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ "IIOP_ORB: cannot find poa for <%s:%d>\n",
+ iiopobj->profile.object_addr().get_host_name(),
+ iiopobj->profile.object_addr().get_port_number()));
+#endif
}
}
+#if 0
+ ACE_DEBUG ((LM_DEBUG,
+ "IIOP_ORB: collocation failed for \n"));
+#endif
+
return 0;
}
diff --git a/TAO/tao/Sequence.cpp b/TAO/tao/Sequence.cpp
index db7fbc18058..57b0e9a3771 100644
--- a/TAO/tao/Sequence.cpp
+++ b/TAO/tao/Sequence.cpp
@@ -90,7 +90,7 @@ TAO_Unbounded_String_Sequence (const TAO_Unbounded_String_Sequence &rhs)
: TAO_Unbounded_Base_Sequence (rhs)
{
char* *tmp1 = TAO_Unbounded_String_Sequence::allocbuf (this->maximum_);
- char* *tmp2 = ACE_reinterpret_cast (char **, rhs.buffer_);
+ char ** const tmp2 = ACE_reinterpret_cast (char ** const, rhs.buffer_);
for (CORBA::ULong i = 0; i < rhs.length_; ++i)
tmp1[i] = CORBA::string_dup (tmp2[i]);
@@ -135,7 +135,7 @@ operator= (const TAO_Unbounded_String_Sequence &rhs)
TAO_Unbounded_Base_Sequence::operator= (rhs);
char **tmp1 = ACE_reinterpret_cast (char **, this->buffer_);
- char **tmp2 = ACE_reinterpret_cast (char **, rhs.buffer_);
+ char ** const tmp2 = ACE_reinterpret_cast (char ** const, rhs.buffer_);
for (CORBA::ULong i=0; i < rhs.length_; ++i)
tmp1[i] = CORBA::string_dup (tmp2[i]);
diff --git a/TAO/tao/Sequence.i b/TAO/tao/Sequence.i
index c701feb63b2..272b29560f2 100644
--- a/TAO/tao/Sequence.i
+++ b/TAO/tao/Sequence.i
@@ -218,6 +218,6 @@ ACE_INLINE TAO_Unbounded_String_Sequence::Manager
TAO_Unbounded_String_Sequence::operator[] (CORBA::ULong index) const
{
ACE_ASSERT (index < this->maximum_);
- char **tmp = ACE_reinterpret_cast (char **, this->buffer_);
+ char ** const tmp = ACE_reinterpret_cast (char ** const, this->buffer_);
return Manager (tmp + index, this->release_);
}
diff --git a/TAO/tao/Sequence_T.cpp b/TAO/tao/Sequence_T.cpp
index 9e699faf37d..5d86dd6a96d 100644
--- a/TAO/tao/Sequence_T.cpp
+++ b/TAO/tao/Sequence_T.cpp
@@ -15,8 +15,7 @@ TAO_Unbounded_Sequence (const TAO_Unbounded_Sequence<T> &rhs)
: TAO_Unbounded_Base_Sequence (rhs)
{
T *tmp1 = TAO_Unbounded_Sequence<T>::allocbuf (this->maximum_);
- T *tmp2 = ACE_reinterpret_cast (T *,
- rhs.buffer_);
+ T * const tmp2 = ACE_reinterpret_cast (T * const, rhs.buffer_);
for (CORBA::ULong i = 0; i < this->length_; ++i)
tmp1[i] = tmp2[i];
@@ -48,10 +47,8 @@ TAO_Unbounded_Sequence<T>::operator= (const TAO_Unbounded_Sequence<T> &rhs)
TAO_Unbounded_Base_Sequence::operator= (rhs);
- T *tmp1 = ACE_reinterpret_cast (T *,
- this->buffer_);
- T *tmp2 = ACE_reinterpret_cast (T *,
- rhs.buffer_);
+ T *tmp1 = ACE_reinterpret_cast (T *, this->buffer_);
+ T * const tmp2 = ACE_reinterpret_cast (T * const, rhs.buffer_);
for (CORBA::ULong i = 0; i < this->length_; ++i)
tmp1[i] = tmp2[i];
@@ -109,8 +106,7 @@ TAO_Bounded_Sequence (const TAO_Bounded_Sequence<T, MAX> &rhs)
{
T *tmp1 = TAO_Bounded_Sequence<T, MAX>::allocbuf (MAX);
- T *tmp2 = ACE_reinterpret_cast (T *,
- rhs.buffer_);
+ T * const tmp2 = ACE_reinterpret_cast (T * const, rhs.buffer_);
for (CORBA::ULong i = 0; i < this->length_; ++i)
tmp1[i] = tmp2[i];
@@ -148,7 +144,7 @@ operator= (const TAO_Bounded_Sequence<T, MAX> &rhs)
TAO_Bounded_Base_Sequence::operator= (rhs);
T* tmp1 = ACE_reinterpret_cast (T *, this->buffer_);
- T* tmp2 = ACE_reinterpret_cast (T *, rhs.buffer_);
+ T* const tmp2 = ACE_reinterpret_cast (T * const, rhs.buffer_);
for (CORBA::ULong i = 0; i < this->length_; ++i)
tmp1[i] = tmp2[i];
@@ -241,8 +237,7 @@ TAO_Unbounded_Object_Sequence (const TAO_Unbounded_Object_Sequence<T> &rhs)
: TAO_Unbounded_Base_Sequence (rhs)
{
T **tmp1 = TAO_Unbounded_Object_Sequence<T>::allocbuf (this->maximum_);
- T **tmp2 = ACE_reinterpret_cast (T **,
- rhs.buffer_);
+ T ** const tmp2 = ACE_reinterpret_cast (T ** const, rhs.buffer_);
for (CORBA::ULong i = 0; i < rhs.length_; ++i)
tmp1[i] = T::_duplicate (tmp2[i]);
@@ -288,10 +283,8 @@ operator= (const TAO_Unbounded_Object_Sequence<T> &rhs)
TAO_Unbounded_Base_Sequence::operator= (rhs);
- T **tmp1 = ACE_reinterpret_cast (T **,
- this->buffer_);
- T **tmp2 = ACE_reinterpret_cast (T **,
- rhs.buffer_);
+ T **tmp1 = ACE_reinterpret_cast (T **, this->buffer_);
+ T ** const tmp2 = ACE_reinterpret_cast (T ** const, rhs.buffer_);
for (CORBA::ULong i = 0; i < rhs.length_; ++i)
tmp1[i] = T::_duplicate (tmp2[i]);
@@ -405,7 +398,7 @@ TAO_Bounded_Object_Sequence (const TAO_Bounded_Object_Sequence<T, MAX> &rhs)
{
T **tmp1 =
TAO_Bounded_Object_Sequence<T, MAX>::allocbuf (MAX);
- T **tmp2 = ACE_reinterpret_cast (T**, rhs.buffer_);
+ T ** const tmp2 = ACE_reinterpret_cast (T** const, rhs.buffer_);
for (CORBA::ULong i = 0; i < rhs.length_; i++)
tmp1[i] = T::_duplicate (tmp2[i]);
this->buffer_ = tmp1;
@@ -446,7 +439,7 @@ TAO_Bounded_Object_Sequence<T, MAX>::operator=
TAO_Bounded_Base_Sequence::operator= (rhs);
T **tmp1 = ACE_reinterpret_cast (T **, this->buffer_);
- T **tmp2 = ACE_reinterpret_cast (T **, rhs.buffer_);
+ T ** const tmp2 = ACE_reinterpret_cast (T ** const, rhs.buffer_);
for (CORBA::ULong i=0; i < rhs.length_; ++i)
tmp1[i] = T::_duplicate (tmp2[i]);
return *this;
@@ -532,7 +525,7 @@ TAO_Bounded_String_Sequence (const TAO_Bounded_String_Sequence<MAX> &rhs)
{
char **tmp1 =
TAO_Bounded_String_Sequence<MAX>::allocbuf (this->maximum_);
- char **tmp2 = ACE_reinterpret_cast (char **, rhs.buffer_);
+ char ** const tmp2 = ACE_reinterpret_cast (char ** const, rhs.buffer_);
for (CORBA::ULong i=0; i < rhs.length_; i++)
tmp1[i] = CORBA::string_dup (tmp2[i]);
@@ -543,9 +536,9 @@ TAO_Bounded_String_Sequence (const TAO_Bounded_String_Sequence<MAX> &rhs)
template<CORBA::ULong MAX>
TAO_Bounded_String_Sequence<MAX>&
TAO_Bounded_String_Sequence<MAX>::operator=
-(const TAO_Bounded_String_Sequence<MAX> &seq)
+(const TAO_Bounded_String_Sequence<MAX> &rhs)
{
- if (this == &seq)
+ if (this == &rhs)
return *this;
if (this->release_)
@@ -558,7 +551,7 @@ TAO_Bounded_String_Sequence<MAX>::operator=
tmp[i] = 0;
}
#if 0
- if (this->maximum_ < seq.maximum_)
+ if (this->maximum_ < rhs.maximum_)
{
TAO_Bounded_String_Sequence<T, MAX>::freebuf (tmp);
this->buffer_ =
@@ -568,14 +561,14 @@ TAO_Bounded_String_Sequence<MAX>::operator=
}
else
this->buffer_ =
- TAO_Bounded_String_Sequence<T>::allocbuf (rhs.maximum_);
+ TAO_Bounded_String_Sequence<MAX>::allocbuf (rhs.maximum_);
TAO_Bounded_Base_Sequence::operator= (rhs);
char **tmp1 = ACE_reinterpret_cast (char **, this->buffer_);
- char **tmp2 = ACE_reinterpret_cast (char **, seq.buffer_);
+ char ** const tmp2 = ACE_reinterpret_cast (char ** const, rhs.buffer_);
- for (CORBA::ULong i=0; i < seq.length_; i++)
+ for (CORBA::ULong i = 0; i < rhs.length_; i++)
tmp1[i] = CORBA::string_dup (tmp2[i]);
return *this;
}
diff --git a/TAO/tao/Sequence_T.i b/TAO/tao/Sequence_T.i
index da4e140a9ef..8a8bab0d909 100644
--- a/TAO/tao/Sequence_T.i
+++ b/TAO/tao/Sequence_T.i
@@ -86,7 +86,7 @@ template <class T> ACE_INLINE const T &
TAO_Unbounded_Sequence<T>::operator[] (CORBA::ULong i) const
{
ACE_ASSERT (i < this->maximum_);
- T *tmp = ACE_reinterpret_cast (T *, this->buffer_);
+ T * const tmp = ACE_reinterpret_cast (T* const, this->buffer_);
return tmp[i];
}
@@ -179,7 +179,7 @@ template <class T, CORBA::ULong MAX> ACE_INLINE const T &
TAO_Bounded_Sequence<T, MAX>::operator[] (CORBA::ULong i) const
{
ACE_ASSERT (i < this->maximum_);
- T* tmp = ACE_reinterpret_cast (T*,this->buffer_);
+ const T* tmp = ACE_reinterpret_cast (const T*,this->buffer_);
return tmp[i];
}
@@ -254,7 +254,7 @@ template <class T> ACE_INLINE TAO_Object_Manager<T>
TAO_Unbounded_Object_Sequence<T>::operator[] (CORBA::ULong index) const
{
ACE_ASSERT (index < this->maximum_);
- T **tmp = ACE_reinterpret_cast (T **, this->buffer_);
+ T ** const tmp = ACE_reinterpret_cast (T ** const, this->buffer_);
return Manager (tmp + index, this->release_);
}
@@ -281,7 +281,7 @@ template <class T, CORBA::ULong MAX> ACE_INLINE TAO_Object_Manager<T>
TAO_Bounded_Object_Sequence<T,MAX>::operator[] (CORBA::ULong index) const
{
ACE_ASSERT (index < this->maximum_);
- T* tmp = ACE_reinterpret_cast (T*, this->buffer_);
+ T** const tmp = ACE_reinterpret_cast (T** const, this->buffer_);
return Manager(tmp + index, this->release_);
}
@@ -308,6 +308,6 @@ template<CORBA::ULong MAX> ACE_INLINE TAO_String_Manager
TAO_Bounded_String_Sequence<MAX>::operator[] (CORBA::ULong index) const
{
ACE_ASSERT (index < this->maximum_);
- char** tmp = ACE_reinterpret_cast (char**, this->buffer_);
+ char** const tmp = ACE_reinterpret_cast (char** const, this->buffer_);
return Manager(tmp + index, this->release_);
}
diff --git a/TAO/tao/decode.cpp b/TAO/tao/decode.cpp
index b323b62cd89..52c244b5ae5 100644
--- a/TAO/tao/decode.cpp
+++ b/TAO/tao/decode.cpp
@@ -674,7 +674,8 @@ TAO_Marshal_ObjRef::decode (CORBA::TypeCode_ptr,
{
// Create a new CORBA_Object and give it the IIOP_Object just
// created.
- TAO_ServantBase *servant = TAO_ORB_Core_instance ()->orb ()->_get_collocated_servant (objdata);
+ TAO_ServantBase *servant =
+ TAO_ORB_Core_instance ()->orb ()->_get_collocated_servant (objdata);
CORBA_Object *corba_proxy = 0;
ACE_NEW_RETURN (corba_proxy,