diff options
author | mayur <mayur@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-07-03 18:27:02 +0000 |
---|---|---|
committer | mayur <mayur@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-07-03 18:27:02 +0000 |
commit | 14c6cf790db273da0780eb8aba1ef7aea8834a4b (patch) | |
tree | 46719224b0d218d7fb6b55b2b2c5440ef1a5f1f8 | |
parent | 7f83042e42bc92f19b848ae57120e4091f99b8f3 (diff) | |
download | ATCD-14c6cf790db273da0780eb8aba1ef7aea8834a4b.tar.gz |
Wed Jul 3 11:23:10 2002 Mayur Deshpande <mayur@ics.uci.edu>
-rw-r--r-- | TAO/ChangeLog | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp | 30 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_cs.h | 5 |
4 files changed, 45 insertions, 4 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 14175dc36fd..d361675f6e4 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,11 @@ +Wed Jul 3 11:23:10 2002 Mayur Deshpande <mayur@ics.uci.edu> + + * TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp: + * TAO_IDL/be/be_visitor_valuetype/valuetype_cs.h: + * TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp: + Fixed generation of AMH ExceptionHolders after Jeff's large + commit. Somehow, something got missed :-) + Wed Jul 3 14:04:57 2002 Carlos O'Ryan <coryan@atdesk.com> * TAO_IDL/be/be_visitor_valuetype/arglist.cpp: diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp index d9e7dab2036..bf74fd7233c 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp @@ -327,7 +327,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) << "virtual void *_tao_obv_narrow (ptr_arith_t);" << be_nl; // Support for marshalling. - if (!node->is_abstract ()) + if (!node->is_abstract () && !is_an_amh_exception_holder) { *os << "virtual CORBA::Boolean " << "_tao_marshal_v (TAO_OutputCDR &);" << be_nl; @@ -387,10 +387,10 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) if (is_an_amh_exception_holder) { *os << "virtual CORBA::Boolean _tao_marshal__" - << node->flat_name () << " (TAO_OutputCDR &);" + << node->flat_name () << " (TAO_OutputCDR &) {return 1;}" << be_nl; *os << "virtual CORBA::Boolean _tao_unmarshal__" - << node->flat_name () << " (TAO_InputCDR &);" + << node->flat_name () << " (TAO_InputCDR &) {return 1;}" << be_nl; } /*********************************************************/ diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp index 529fd388412..25689ad47c8 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp @@ -37,6 +37,34 @@ be_visitor_valuetype_cs::~be_visitor_valuetype_cs (void) } int +be_visitor_valuetype_cs::is_amh_exception_holder (be_valuetype *node) +{ + // 1) Find out if the ValueType is an AMH_*ExceptionHolder, the + // conditions are: + // a) The local_name starts with AMH_ + // b) The local_name ends with ExceptionHolder + int is_an_amh_exception_holder = 0; + const char *amh_underbar = "AMH_"; + const char *node_name = node->local_name (); + + if( amh_underbar[0] == node_name[0] && + amh_underbar[1] == node_name[1] && + amh_underbar[2] == node_name[2] && + amh_underbar[3] == node_name[3] + ) // node name starts with "AMH_" + { + const char *last_E = ACE_OS::strrchr (node->full_name (), 'E'); + + if (last_E != 0 + && ACE_OS::strcmp (last_E, "ExceptionHolder") == 0) + { + is_an_amh_exception_holder = 1; + } + } + return is_an_amh_exception_holder; +} + +int be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) { if (node->cli_stub_gen () || node->imported ()) @@ -233,7 +261,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) // Nothing to marshal if abstract valuetype. - if (!node->is_abstract ()) + if (!node->is_abstract () && !is_amh_exception_holder (node)) { // The virtual _tao_marshal_v method. *os << "CORBA::Boolean " << node->name () diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_cs.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_cs.h index b05f5ddc9ab..a0adef76ea7 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_cs.h @@ -40,6 +40,11 @@ public: ~be_visitor_valuetype_cs (void); // destructor + virtual int is_amh_exception_holder (be_valuetype *node); + // Test if valuetype is an AMH ExceptionHolder. Special generation + // of marshalling/unmarshalling tests if it is an AMH + // ExceptionHolder + virtual int visit_valuetype (be_valuetype *node); // set the right context and make a visitor }; |