summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-02-27 18:29:17 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-02-27 18:29:17 +0000
commit1b72b236396d505040b22e61030e5d8678db2354 (patch)
tree698e5a56b36b7bad0bfeba61b93f824b983cb9d7
parent1abad7fbb4e9c0dd30bffd3c08dfd78021311e31 (diff)
downloadATCD-1b72b236396d505040b22e61030e5d8678db2354.tar.gz
ChangeLogTag: Tue Feb 27 12:17:18 2001 Jeff Parsons <parsons@cs.wustl.edu>
-rw-r--r--TAO/tao/Any.cpp16
-rw-r--r--TAO/tao/MessagingC.h12
-rw-r--r--TAO/tao/Sequence.cpp39
-rw-r--r--TAO/tao/Sequence_T.cpp126
4 files changed, 153 insertions, 40 deletions
diff --git a/TAO/tao/Any.cpp b/TAO/tao/Any.cpp
index 9b94071da57..8c0c8f7b6d3 100644
--- a/TAO/tao/Any.cpp
+++ b/TAO/tao/Any.cpp
@@ -45,14 +45,22 @@ CORBA_Any::type (CORBA::TypeCode_ptr tc,
}
}
-// TAO doesn't give any guarantees if the value returned by value can
-// be cast to the desired type. This is a deprecated routine and its
-// use must be avoided. Use the >>= operators.
+// This method is deprecated and will eventually be removed from the
+// spec. It is included here for backward compatibility and its return
+// value may NOT be cast to anything useful. It will only tell whether the
+// Any contains a value or not. Use of >>= is recommended for anything else.
const void *
CORBA_Any::value (void) const
{
- return this->value_;
+ if (this->cdr_ != 0 || this->value_ != 0)
+ {
+ return this;
+ }
+ else
+ {
+ return 0;
+ }
}
// Default "Any" constructor -- initializes to nulls per the
diff --git a/TAO/tao/MessagingC.h b/TAO/tao/MessagingC.h
index 678cf7362fe..7ce7ac79570 100644
--- a/TAO/tao/MessagingC.h
+++ b/TAO/tao/MessagingC.h
@@ -2410,11 +2410,7 @@ class TAO_Export QueueOrderPolicy: public virtual CORBA::Policy
#endif /* end #if !defined */
-#if !defined (__GNUC__) || !defined (ACE_HAS_GNUG_PRE_2_8)
- typedef _tao_seq_Octet _marshaled_exception_seq;
- #endif /* ! __GNUC__ || ACE_HAS_GNUG_PRE_2_8 */
-
- virtual void marshaled_exception (const Messaging::ExceptionHolder::_tao_seq_Octet &) = 0; // set
+ virtual void marshaled_exception (const Messaging::ExceptionHolder::_tao_seq_Octet &) = 0; // set
virtual const Messaging::ExceptionHolder::_tao_seq_Octet &marshaled_exception (void) const = 0; // get method (read only)
virtual Messaging::ExceptionHolder::_tao_seq_Octet &marshaled_exception (void) = 0; // get method (read/write only)
@@ -2726,11 +2722,7 @@ TAO_NAMESPACE OBV_Messaging
virtual void byte_order (CORBA::Boolean); // set
virtual CORBA::Boolean byte_order (void) const; // get method
-#if !defined (__GNUC__) || !defined (ACE_HAS_GNUG_PRE_2_8)
- typedef _tao_seq_Octet _marshaled_exception_seq;
- #endif /* ! __GNUC__ || ACE_HAS_GNUG_PRE_2_8 */
-
- virtual void marshaled_exception (const Messaging::ExceptionHolder::_tao_seq_Octet &); // set
+ virtual void marshaled_exception (const Messaging::ExceptionHolder::_tao_seq_Octet &); // set
virtual const Messaging::ExceptionHolder::_tao_seq_Octet &marshaled_exception (void) const; // get method (read only)
virtual Messaging::ExceptionHolder::_tao_seq_Octet &marshaled_exception (void); // get method (read/write only)
diff --git a/TAO/tao/Sequence.cpp b/TAO/tao/Sequence.cpp
index 5b1eea46615..7f6ba1d9432 100644
--- a/TAO/tao/Sequence.cpp
+++ b/TAO/tao/Sequence.cpp
@@ -118,8 +118,17 @@ operator= (const TAO_Unbounded_String_Sequence &rhs)
}
}
else
- this->buffer_ =
- TAO_Unbounded_String_Sequence::allocbuf (rhs.maximum_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Unbounded_String_Sequence::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Unbounded_Base_Sequence::operator= (rhs);
@@ -343,8 +352,17 @@ operator= (const TAO_Unbounded_WString_Sequence &rhs)
}
}
else
- this->buffer_ =
- TAO_Unbounded_WString_Sequence::allocbuf (rhs.maximum_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Unbounded_WString_Sequence::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Unbounded_Base_Sequence::operator= (rhs);
@@ -588,8 +606,17 @@ TAO_Unbounded_Sequence<CORBA::Octet>::operator= (const TAO_Unbounded_Sequence<CO
}
}
else
- this->buffer_ =
- TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (rhs.length_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Unbounded_Sequence<CORBA::Octet>::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Unbounded_Base_Sequence::operator= (rhs);
diff --git a/TAO/tao/Sequence_T.cpp b/TAO/tao/Sequence_T.cpp
index 2667ed56d1d..7ee4ed1eaeb 100644
--- a/TAO/tao/Sequence_T.cpp
+++ b/TAO/tao/Sequence_T.cpp
@@ -55,8 +55,17 @@ TAO_Unbounded_Sequence<T>::operator= (const TAO_Unbounded_Sequence<T> &rhs)
}
}
else
- this->buffer_ =
- TAO_Unbounded_Sequence<T>::allocbuf (rhs.maximum_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Unbounded_Sequence<T>::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Unbounded_Base_Sequence::operator= (rhs);
@@ -170,8 +179,17 @@ operator= (const TAO_Bounded_Sequence<T, MAX> &rhs)
// always of size MAX.
}
else
- this->buffer_ =
- TAO_Unbounded_Sequence<T>::allocbuf (rhs.maximum_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Bounded_Sequence<T>::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Bounded_Base_Sequence::operator= (rhs);
@@ -412,8 +430,17 @@ operator= (const TAO_Unbounded_Object_Sequence<T,T_var> &rhs)
}
}
else
- this->buffer_ =
- TAO_Unbounded_Object_Sequence<T,T_var>::allocbuf (rhs.maximum_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Unbounded_Object_Sequence<T,T_var>::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Unbounded_Base_Sequence::operator= (rhs);
@@ -591,8 +618,17 @@ TAO_Bounded_Object_Sequence<T, T_var,MAX>::operator=
// MAX
}
else
- this->buffer_ =
- TAO_Bounded_Object_Sequence<T, T_var,MAX>::allocbuf (rhs.maximum_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Bounded_Object_Sequence<T,T_var>::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Bounded_Base_Sequence::operator= (rhs);
@@ -755,8 +791,17 @@ operator= (const TAO_Unbounded_Pseudo_Sequence<T,T_var> &rhs)
}
}
else
- this->buffer_ =
- TAO_Unbounded_Pseudo_Sequence<T,T_var>::allocbuf (rhs.maximum_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Unbounded_Pseudo_Sequence<T,T_var>::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Unbounded_Base_Sequence::operator= (rhs);
@@ -914,8 +959,17 @@ TAO_Bounded_Pseudo_Sequence<T, T_var,MAX>::operator=
// MAX
}
else
- this->buffer_ =
- TAO_Bounded_Pseudo_Sequence<T, T_var, MAX>::allocbuf (rhs.maximum_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Bounded_Pseudo_Sequence<T,T_var>::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Bounded_Base_Sequence::operator= (rhs);
@@ -1067,8 +1121,15 @@ operator= (const TAO_Unbounded_Array_Sequence<T, T_var> &rhs)
}
else
{
- this->buffer_ =
- TAO_Unbounded_Array_Sequence<T, T_var>::allocbuf (rhs.maximum_);
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Unbounded_Array_Sequence<T,T_var>::allocbuf (rhs.maximum_);
+ }
}
TAO_Unbounded_Base_Sequence::operator= (rhs);
@@ -1203,8 +1264,15 @@ TAO_Bounded_Array_Sequence<T, T_var, MAX>::operator=
}
else
{
- this->buffer_ =
- TAO_Bounded_Array_Sequence<T, T_var, MAX>::allocbuf (rhs.maximum_);
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Bounded_Array_Sequence<T,T_var>::allocbuf (rhs.maximum_);
+ }
}
TAO_Bounded_Base_Sequence::operator= (rhs);
@@ -1313,8 +1381,17 @@ TAO_Bounded_String_Sequence<MAX>::operator=
// <MAX> size.
}
else
- this->buffer_ =
- TAO_Bounded_String_Sequence<MAX>::allocbuf (rhs.maximum_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Bounded_String_Sequence<MAX>::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Bounded_Base_Sequence::operator= (rhs);
@@ -1462,8 +1539,17 @@ TAO_Bounded_WString_Sequence<MAX>::operator=
// <MAX> size.
}
else
- this->buffer_ =
- TAO_Bounded_WString_Sequence<MAX>::allocbuf (rhs.maximum_);
+ {
+ if (rhs.maximum_ == 0)
+ {
+ this->buffer_ = 0;
+ }
+ else
+ {
+ this->buffer_ =
+ TAO_Bounded_WString_Sequence<MAX>::allocbuf (rhs.maximum_);
+ }
+ }
TAO_Bounded_Base_Sequence::operator= (rhs);