diff options
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/ChangeLog-98c | 20 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_interface.cpp | 38 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_module.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/servant_base.cpp | 18 |
4 files changed, 51 insertions, 34 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 8f9a0dd0221..5f8eed820fb 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,23 @@ +Mon Mar 16 15:27:21 1998 Carlos O'Ryan <coryan@cs.wustl.edu> + + * TAO_IDL/be/be_visitor_interface.cpp: + The _narrow() method is more careful about collocation: the + servant could return 0 on the call to _downcast (for instance if + the servant is using DSI or is implementing the default servant + posicies), in such a case a remote object is created. + Generate the _interface_repository_id() method in all classes. + + * TAO_IDL/be/be_visitor_module.cpp: + In some cases the export macros were not generated. + + * tao/object.h: + * tao/object.cpp: + Added a new method to get the interface repository id (only + locally). + + * tao/servant_base.cpp: + Removed some dead code. + Mon Mar 16 14:28:34 1998 David L. Levine <levine@cs.wustl.edu> * tao/orbconf.h: cleaned up #define of TAO_ALIGNMENT_MAGIC_NUMBER, diff --git a/TAO/TAO_IDL/be/be_visitor_interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface.cpp index f19b0f51388..3662e0d4761 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface.cpp @@ -703,19 +703,18 @@ be_visitor_interface_ch::visit_interface (be_interface *node) // the _is_a method os->indent (); *os << "virtual CORBA::Boolean _is_a (const CORBA::Char *type_id, " - << "CORBA::Environment &env);\n"; + << "CORBA::Environment &env);" + << "virtual const char* " + << "_interface_repository_id (void) const;" << be_uidt_nl; // generate the "protected" constructor so that users cannot instantiate // us - os->decr_indent (); - *os << "protected:\n"; - os->incr_indent (); - *os << node->local_name () << " (void); // default constructor" << be_nl + *os << "protected:" << be_idt_nl + << node->local_name () << " (void); // default constructor" << be_nl << node->local_name () << " (STUB_Object *objref, " << "TAO_ServantBase *_tao_servant = 0, " << "CORBA::Boolean _tao_collocated = 0);" << be_nl - << "virtual ~" << node->local_name () << " (void);\n"; - os->decr_indent (); + << "virtual ~" << node->local_name () << " (void);" << be_uidt_nl; // private copy constructor and assignment operator. These are not // allowed, hence they are private. @@ -735,15 +734,15 @@ be_visitor_interface_ch::visit_interface (be_interface *node) { // we have a scoped name os->indent (); - *os << "static CORBA::TypeCode_ptr " << node->tc_name - ()->last_component () << ";\n\n"; + *os << "static CORBA::TypeCode_ptr " + << node->tc_name ()->last_component () << ";\n\n"; } else { // we are in the ROOT scope os->indent (); - *os << "extern CORBA::TypeCode_ptr " << node->tc_name - ()->last_component () << ";\n\n"; + *os << "extern CORBA::TypeCode_ptr " + << node->tc_name ()->last_component () << ";\n\n"; } node->cli_hdr_gen (I_TRUE); @@ -881,9 +880,14 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << be_idt_nl << "return " << node->name () << "::_nil ();" << be_uidt_nl; - *os << "if (!obj->_is_collocated () || !obj->_servant())" << be_nl + *os << "if (!obj->_is_collocated ()" << be_idt << be_idt << be_idt_nl + << " || !obj->_servant()" << be_nl + << " || obj->_servant()->_downcast (\"" + << node->repoID () << "\") == 0" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl << "{" << be_idt_nl; - *os << node->name () << "_ptr new_obj = new " << node->name () << "(obj->_get_parent ());" << be_nl + *os << node->name () << "_ptr new_obj = new " + << node->name () << "(obj->_get_parent ());" << be_nl << "return new_obj;" << be_uidt_nl << "} // end of if" << be_nl; @@ -948,6 +952,14 @@ be_visitor_interface_cs::visit_interface (be_interface *node) os->decr_indent (); *os << "}\n\n"; + os->indent (); + *os << "const char* " << node->name () + << "::_interface_repository_id (void) const" + << be_nl + << "{" << be_idt_nl + << "return \"" << node->repoID () << "\";" << be_uidt_nl + << "}\n\n"; + // generate the typecode information here os->indent (); // start from current indentation level *os << "static const CORBA::Long _oc_" << node->flatname () << "[] =" << diff --git a/TAO/TAO_IDL/be/be_visitor_module.cpp b/TAO/TAO_IDL/be/be_visitor_module.cpp index de1da46861e..5b7107f9886 100644 --- a/TAO/TAO_IDL/be/be_visitor_module.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module.cpp @@ -577,7 +577,8 @@ be_visitor_module_ch::visit_module (be_module *node) os->indent (); // start from whatever indentation level we were at // now generate the class definition - *os << "class " << node->local_name () << be_nl + *os << "class " << idl_global->export_macro () + << " " << node->local_name () << be_nl << "{" << be_nl << "public:\n"; os->incr_indent (0); @@ -630,10 +631,12 @@ be_visitor_module_sh::visit_module (be_module *node) // name only if we are the outermost module if (!node->is_nested ()) // we are outermost module - *os << "class POA_" << node->local_name () << be_nl; + *os << "class " << idl_global->export_macro () + << " POA_" << node->local_name () << be_nl; else // we are inside another module - *os << "class " << node->local_name () << be_nl; + *os << "class " << idl_global->export_macro () + << " " << node->local_name () << be_nl; *os << "{" << be_nl << "public:" diff --git a/TAO/tao/servant_base.cpp b/TAO/tao/servant_base.cpp index 4ec5eb52dea..65e7063f718 100644 --- a/TAO/tao/servant_base.cpp +++ b/TAO/tao/servant_base.cpp @@ -5,9 +5,6 @@ TAO_ServantBase::TAO_ServantBase (void) : optable_ (0) -#if 0 - , parent_ (0) -#endif { } @@ -47,21 +44,6 @@ TAO_ServantBase::_is_a (const char* logical_type_id, return CORBA::B_FALSE; } -#if 0 -void -TAO_ServantBase::_set_parent (TAO_IUnknown *p) -{ - this->parent_ = p; - ACE_ASSERT (this->parent_ != 0); -} - -TAO_IUnknown * -TAO_ServantBase::_get_parent (void) const -{ - return this->parent_; -} -#endif - int TAO_ServantBase::_find (const CORBA::String &opname, TAO_Skeleton& skelfunc) |