summaryrefslogtreecommitdiff
path: root/TAO/tao/encode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/encode.cpp')
-rw-r--r--TAO/tao/encode.cpp59
1 files changed, 16 insertions, 43 deletions
diff --git a/TAO/tao/encode.cpp b/TAO/tao/encode.cpp
index ac3a0892cd3..03bda8a8ecc 100644
--- a/TAO/tao/encode.cpp
+++ b/TAO/tao/encode.cpp
@@ -99,7 +99,7 @@ TAO_Marshal_Primitive::encode (CORBA::TypeCode_ptr tc,
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"TAO_Marshal_Primitive::encode detected error\n"));
- env.exception (new CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE));
+ env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_MAYBE));
return CORBA::TypeCode::TRAVERSE_STOP;
}
}
@@ -149,7 +149,7 @@ TAO_Marshal_Any::encode (CORBA::TypeCode_ptr,
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"TAO_Marshal_Any::encode detected error\n"));
- env.exception (new CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE));
+ env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_MAYBE));
return CORBA::TypeCode::TRAVERSE_STOP;
}
}
@@ -219,7 +219,7 @@ TAO_Marshal_TypeCode::encode (CORBA::TypeCode_ptr,
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"TAO_Marshal_TypeCode::encode detected error\n"));
- env.exception (new CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE));
+ env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_MAYBE));
return CORBA::TypeCode::TRAVERSE_STOP;
}
}
@@ -238,7 +238,7 @@ TAO_Marshal_Principal::encode (CORBA::TypeCode_ptr,
if ((*stream << p) == 0)
{
- env.exception (new CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE));
+ env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_MAYBE));
return CORBA::TypeCode::TRAVERSE_STOP;
}
return CORBA::TypeCode::TRAVERSE_CONTINUE;
@@ -265,7 +265,7 @@ TAO_Marshal_ObjRef::encode (CORBA::TypeCode_ptr,
if ((*stream << obj) == 0)
{
- env.exception (new CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE));
+ env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_MAYBE));
return CORBA::TypeCode::TRAVERSE_STOP;
}
return CORBA::TypeCode::TRAVERSE_CONTINUE;
@@ -400,7 +400,7 @@ TAO_Marshal_Struct::encode (CORBA::TypeCode_ptr tc,
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"TAO_Marshal_Struct::encode detected error\n"));
- env.exception (new CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE));
+ env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_MAYBE));
return CORBA::TypeCode::TRAVERSE_STOP;
}
}
@@ -546,7 +546,7 @@ TAO_Marshal_Union::encode (CORBA::TypeCode_ptr tc,
ACE_DEBUG ((LM_DEBUG,
"Union::encode - "
"Bad discriminant type\n"));
- ACE_THROW_RETURN (CORBA::BAD_TYPECODE (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE),
+ ACE_THROW_RETURN (CORBA::BAD_TYPECODE (CORBA::COMPLETED_MAYBE),
CORBA::TypeCode::TRAVERSE_STOP);
}// end of switch
@@ -565,50 +565,23 @@ TAO_Marshal_Union::encode (CORBA::TypeCode_ptr tc,
{
member_val = base_union->_access (0);
// marshal according to the matched typecode
-
- if (member_tc->kind () == CORBA::tk_objref)
- {
- // we know that the object pointer is stored in a
- // TAO_Object_Field_T parametrized type
- TAO_Object_Field_T<CORBA_Object>* field =
- ACE_reinterpret_cast (TAO_Object_Field_T<CORBA_Object> *,
- member_val);
- CORBA::Object_ptr ptr = field->_upcast ();
- return stream->encode (member_tc, &ptr, data2, ACE_TRY_ENV);
- }
- else
- {
- return stream->encode (member_tc, member_val,
- data2, ACE_TRY_ENV);
- }
+ return stream->encode (member_tc, member_val,
+ data2, ACE_TRY_ENV);
}
}
// we are here only if there was no match
if (default_tc)
{
member_val = base_union->_access (0);
- if (default_tc->kind () == CORBA::tk_objref)
- {
- // we know that the object pointer is stored in a
- // TAO_Object_Field_T parametrized type
- TAO_Object_Field_T<CORBA_Object>* field =
- ACE_reinterpret_cast (TAO_Object_Field_T<CORBA_Object> *,
- member_val);
- CORBA::Object_ptr ptr = field->_upcast ();
- return stream->encode (default_tc, &ptr, data2, ACE_TRY_ENV);
- }
- else
- {
- return stream->encode (default_tc, member_val,
- data2, ACE_TRY_ENV);
- }
+ return stream->encode (default_tc, member_val, data2,
+ ACE_TRY_ENV);
}
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"Union::encode - failed. "
"No match and no default case\n"));
- ACE_THROW_RETURN (CORBA::MARSHAL (),
+ ACE_THROW_RETURN (CORBA::MARSHAL (CORBA::COMPLETED_NO),
CORBA::TypeCode::TRAVERSE_STOP);
}
@@ -849,7 +822,7 @@ TAO_Marshal_Sequence::encode (CORBA::TypeCode_ptr tc,
// If an error was detected but no exception was raised then raise a
// marshal exception.
if (env.exception () == 0)
- env.exception (new CORBA::MARSHAL ());
+ env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_NO));
return CORBA::TypeCode::TRAVERSE_STOP;
}
@@ -999,7 +972,7 @@ TAO_Marshal_Array::encode (CORBA::TypeCode_ptr tc,
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"TAO_Marshal_Sequence::encode detected error\n"));
- env.exception (new CORBA::MARSHAL ());
+ env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_NO));
return CORBA::TypeCode::TRAVERSE_STOP;
}
@@ -1083,7 +1056,7 @@ TAO_Marshal_Alias::encode (CORBA::TypeCode_ptr tc,
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"TAO_Marshal_Alias::encode detected error\n"));
- env.exception (new CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE));
+ env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_MAYBE));
return CORBA::TypeCode::TRAVERSE_STOP;
}
}
@@ -1205,7 +1178,7 @@ TAO_Marshal_Except::encode (CORBA::TypeCode_ptr tc,
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"TAO_Marshal_Except::encode detected error\n"));
- env.exception (new CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE));
+ env.exception (new CORBA::MARSHAL (CORBA::COMPLETED_MAYBE));
return CORBA::TypeCode::TRAVERSE_STOP;
}
}