summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorgokhale <asgokhale@users.noreply.github.com>1998-06-25 12:17:29 +0000
committergokhale <asgokhale@users.noreply.github.com>1998-06-25 12:17:29 +0000
commit5fed6e0b8d156b8f87ef8489e241ffb32e66e865 (patch)
tree66e18d5e81093ef4406f79a62cf0a52a8bc0bdbe /TAO/tao
parentf3822c777ca49e50505b5b7d1239c8828ede00e9 (diff)
downloadATCD-5fed6e0b8d156b8f87ef8489e241ffb32e66e865.tar.gz
*** empty log message ***
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/Union.h3
-rw-r--r--TAO/tao/decode.cpp5
-rw-r--r--TAO/tao/encode.cpp5
3 files changed, 7 insertions, 6 deletions
diff --git a/TAO/tao/Union.h b/TAO/tao/Union.h
index 85b7961ef82..292763892fa 100644
--- a/TAO/tao/Union.h
+++ b/TAO/tao/Union.h
@@ -35,6 +35,9 @@ public:
virtual ~TAO_Base_Union (void);
// destructor.
+ virtual void *_discriminant (void) = 0;
+ // return pointer to the discriminant
+
virtual void *_access (CORBA::Boolean flag) = 0;
// Provides access to the right data member at the right offset. If the flag
// is TRUE, we allocate the necessary storage. This will be required for the
diff --git a/TAO/tao/decode.cpp b/TAO/tao/decode.cpp
index 5b56dc5cfa3..c0acae85692 100644
--- a/TAO/tao/decode.cpp
+++ b/TAO/tao/decode.cpp
@@ -839,15 +839,14 @@ TAO_Marshal_Union::decode (CORBA::TypeCode_ptr tc,
if (env.exception () == 0)
{
// decode the discriminator value
- retval = stream->decode (discrim_tc, data, data2, env);
+ discrim_val = base_union->_discriminant ();
+ retval = stream->decode (discrim_tc, discrim_val, data2, env);
if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE)
{
discrim_size_with_pad = tc->TAO_discrim_pad_size (env);
if (env.exception () == 0)
{
- discrim_val = data; // save the pointer to the discriminator
- // value
// move the pointer to point to the actual value
data = (char *) data + discrim_size_with_pad;
data2 = (char *) data2 + discrim_size_with_pad;
diff --git a/TAO/tao/encode.cpp b/TAO/tao/encode.cpp
index a78e5afd454..344e1d3a359 100644
--- a/TAO/tao/encode.cpp
+++ b/TAO/tao/encode.cpp
@@ -507,16 +507,15 @@ TAO_Marshal_Union::encode (CORBA::TypeCode_ptr tc,
void *member_val;
// encode the discriminator value
+ discrim_val = base_union->_discriminant ();
CORBA::TypeCode::traverse_status retval =
- stream->encode (discrim_tc, data, data2, env);
+ stream->encode (discrim_tc, discrim_val, data2, env);
if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE)
{
discrim_size_with_pad = tc->TAO_discrim_pad_size (env);
if (env.exception () == 0)
{
- discrim_val = data; // save the pointer to the discriminator
- // value
// move the pointer to point to the actual value
data = (char *) data + discrim_size_with_pad;
data2 = (char *) data2 + discrim_size_with_pad;