diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-11-18 20:59:50 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-11-18 20:59:50 +0000 |
commit | afffab20b9355c0a108b5e0519dfb42560e892f7 (patch) | |
tree | 43331806af388de129d879e87f9da0751431ecab | |
parent | b3da9f61e99d6ae963a7802aae82edda2083d2b2 (diff) | |
download | ATCD-afffab20b9355c0a108b5e0519dfb42560e892f7.tar.gz |
ChangeLogTag: Mon Nov 18 14:50:31 2002 Jeff Parsons <parsons@isis-server.isis.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 23 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_global.cpp | 17 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_interface.cpp | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp | 30 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp | 42 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp | 16 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_global.h | 7 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_ccm_pre_proc.h | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_component/component_sh.h | 2 |
9 files changed, 128 insertions, 17 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index db7a86a319c..08e07764e02 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,26 @@ +Mon Nov 18 14:50:31 2002 Jeff Parsons <parsons@isis-server.isis.vanderbilt.edu> + + * TAO_IDL/be_include/be_global.h: + * TAO_IDL/be/be_global.cpp: + + Added storage and accessors for the AST node + Components::CCMObject, which is looked up and stored + if there is at least one component in the IDL file. + + * TAO_IDL/be/be_interface.cpp: + * TAO_IDL/be/be_visitor_ccm_pre_proc.cpp: + * TAO_IDL/be/be_visitor_component/component_sh.cpp: + + Added the operations of Components::CCMObject to the operation + table and *_skel method generation for component equivalent + interfaces. Thanks to Nanbor <nanbor@cse.wustl.edu> for uncovering + this bug. + + * TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp: + + Added base component equivalent interface (if any) to the generated + inheritance list for component equivalent interfaces. + Mon Nov 18 12:11:53 2002 Jeff Parsons <parsons@isis-server.isis.vanderbilt.edu> * orbsvcs/orbsvcs/CosNotification_Static.dsp: diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp index ec952aa9e79..994412c6469 100644 --- a/TAO/TAO_IDL/be/be_global.cpp +++ b/TAO/TAO_IDL/be/be_global.cpp @@ -71,7 +71,9 @@ BE_GlobalData::BE_GlobalData (void) gen_tie_classes_ (I_TRUE), gen_smart_proxies_ (I_FALSE), gen_inline_constants_ (I_FALSE), - lookup_strategy_ (TAO_PERFECT_HASH) + lookup_strategy_ (TAO_PERFECT_HASH), + void_type_ (0), + ccmobject_ (0) { } @@ -876,3 +878,16 @@ BE_GlobalData::void_type (AST_PredefinedType *val) { this->void_type_ = val; }; + +be_interface * +BE_GlobalData::ccmobject (void) const +{ + return this->ccmobject_; +} + +void +BE_GlobalData::ccmobject (be_interface *val) +{ + this->ccmobject_ = val; +} + diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index 68486468996..39a2ed56b24 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -1681,6 +1681,10 @@ be_interface::traverse_inheritance_graph ( (void) this->insert_non_dup (supports[j]); } } + else + { + (void) this->insert_non_dup (be_global->ccmobject ()); + } } // Now check if the dequeued element has any ancestors. If yes, insert diff --git a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp index a2e1ac058d1..080147e1e83 100644 --- a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp @@ -115,6 +115,15 @@ be_visitor_ccm_pre_proc::visit_component (be_component *node) return 0; } + if (this->lookup_ccmobject () == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_component - " + "Components::CCMObject lookup failed\n"), + -1); + } + if (this->lookup_cookie (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -1311,6 +1320,27 @@ be_visitor_ccm_pre_proc::gen_get_primary_key (be_home *node, // ******************************************************************** int +be_visitor_ccm_pre_proc::lookup_ccmobject (void) +{ + Identifier local_id ("CCMObject"); + UTL_ScopedName local_name (&local_id, + 0); + UTL_ScopedName sn (&this->module_id_, + &local_name); + AST_Decl *d = + idl_global->scopes ().top_non_null ()->lookup_by_name (&sn, + I_TRUE); + + if (d == 0) + { + return -1; + } + + be_global->ccmobject (be_interface::narrow_from_decl (d)); + return 0; +} + +int be_visitor_ccm_pre_proc::lookup_cookie (be_component *node) { if (this->cookie_ == 0) diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp index 80392e6076b..8dc85a2fdf2 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp @@ -59,6 +59,15 @@ be_visitor_component_sh::visit_component (be_component *node) } } + if (this->generate_amh_classes (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface_sh::" + "visit_interface - " + "codegen for AMH classes failed\n"), + -1); + } + TAO_OutStream *os = this->ctx_->stream (); ACE_CString class_name; @@ -108,16 +117,16 @@ be_visitor_component_sh::visit_component (be_component *node) *os << "class " << be_global->skel_export_macro () << " " << class_name.c_str () << be_idt_nl << ": " << be_idt; - int has_concrete_parent = 0; - AST_Component *base = node->base_component (); if (base != 0) { - has_concrete_parent = 1; - *os << "public virtual POA_" << base->name (); } + else + { + *os << "public virtual POA_Components::CCMObject"; + } long nsupports = node->n_inherits (); AST_Interface **supports = node->supports (); @@ -132,19 +141,8 @@ be_visitor_component_sh::visit_component (be_component *node) continue; } - if (has_concrete_parent) - { - *os << "," << be_nl; - } - + *os << "," << be_nl; *os << "public virtual POA_" << supported->name (); - - has_concrete_parent = 1; - } - - if (has_concrete_parent == 0) - { - *os << "public virtual PortableServer::ServantBase"; } *os << be_uidt << be_uidt_nl @@ -316,3 +314,15 @@ be_visitor_component_sh::visit_component (be_component *node) return 0; } + +int +be_visitor_component_sh::generate_amh_classes (be_component *node) +{ + if (be_global->gen_amh_classes ()) + { + be_visitor_amh_interface_sh amh_intf (this->ctx_); + return amh_intf.visit_interface (node); + } + + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp index ed1b26abd4e..9e32c2c826b 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp @@ -66,6 +66,22 @@ be_visitor_interface_thru_poa_proxy_impl_sh::visit_interface ( } } + if (node->node_type () == AST_Decl::NT_component) + { + AST_Component *base = + AST_Component::narrow_from_decl (node)->base_component (); + + if (base != 0) + { + be_interface *inherited = + be_interface::narrow_from_decl (base); + + *os << "," << be_nl + << "public virtual " + << "::" << inherited->full_thru_poa_proxy_impl_name (); + } + } + *os << be_uidt_nl; *os << "{" << be_nl << "public:" << be_idt_nl; diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h index 0033597775e..6401a0bdff8 100644 --- a/TAO/TAO_IDL/be_include/be_global.h +++ b/TAO/TAO_IDL/be_include/be_global.h @@ -395,6 +395,10 @@ public: void void_type (AST_PredefinedType *val); // Accessors for the member. + be_interface *ccmobject (void) const; + void ccmobject (be_interface *val); + // Accessors for the member. + private: size_t changing_standard_include_files_; // To switch between changing or non-changing standard include @@ -514,6 +518,9 @@ private: AST_PredefinedType *void_type_; // Used for void operation return types. + + be_interface *ccmobject_; + // Reference holder for component skeleton visitors. }; #endif /* _BE_GLOBAL_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_ccm_pre_proc.h b/TAO/TAO_IDL/be_include/be_visitor_ccm_pre_proc.h index da3f5826140..0db2bbf7106 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_ccm_pre_proc.h +++ b/TAO/TAO_IDL/be_include/be_visitor_ccm_pre_proc.h @@ -110,6 +110,10 @@ private: int gen_get_primary_key (be_home *node, AST_Interface *implicit); + // Called if there is at least one component in the IDL file, saves + // lookup in be_global for later use by component skeleton visitors. + int lookup_ccmobject (void); + // Utility functions to create and destroy the various things // needed by operations generated from CCM-related declarations. diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_sh.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_sh.h index 42076bdaf7c..011c1bc2888 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_component/component_sh.h +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_sh.h @@ -41,6 +41,8 @@ public: virtual int visit_component (be_component *node); // set the right context and make a visitor +protected: + virtual int generate_amh_classes (be_component *node); }; #endif /* _BE_COMPONENT_COMPONENT_SH_H_ */ |