diff options
Diffstat (limited to 'TAO/TAO_IDL')
7 files changed, 111 insertions, 28 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp index e00d7bb3369..a31233bc12a 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp @@ -42,7 +42,7 @@ be_visitor_component_exh::visit_component (be_component *node) /// CIDL-generated namespace used 'CIDL_' + composition name. /// Now we use 'CIAO_' + component's flat name. os_ << be_nl_2 - << "/// Component implementation namespace" << be_nl + << "/// Namespace for implementation of " << node->full_name () << " component" << be_nl << "namespace CIAO_" << node->flat_name () << "_Impl" << be_nl << "{" << be_idt; diff --git a/TAO/TAO_IDL/be/be_visitor_component/executor_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/executor_exh.cpp index 59b91fcad5b..0bb39c5ca82 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/executor_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/executor_exh.cpp @@ -67,10 +67,8 @@ be_visitor_executor_exh::visit_component (be_component *node) const char *global = (sname_str == "" ? "" : "::"); os_ << be_nl_2 - << comment_start_border_ << be_nl - << " * Component executor implementation class for " - << lname << "" << be_nl - << comment_end_border_; + << "/// Component Executor Implementation Class: " + << lname << "_exec_i"; os_ << be_nl << "class "; @@ -132,13 +130,14 @@ be_visitor_executor_exh::visit_component (be_component *node) -1); } - os_ << "/** @name Operations from Components::" << be_global->ciao_container_type () - << "Component. */" << be_nl + os_ << "/** @name Session component operations */" << be_nl + // Operations from Components::" << be_global->ciao_container_type () + // << "Component. */" << be_nl << "//@{"; const char *container_type = be_global->ciao_container_type (); - os_ << be_nl + os_ << be_nl_2 << "/// Setter for container context for this component" << be_nl << "/// @param[in] ctx - Container context" << be_nl << "virtual void set_" @@ -149,18 +148,18 @@ be_visitor_executor_exh::visit_component (be_component *node) if (ACE_OS::strcmp (be_global->ciao_container_type (), "Session") == 0) { - os_ << be_nl + os_ << be_nl_2 << "/// Component state change method to configuration_complete state" << be_nl << "virtual void configuration_complete (void);"; - os_ << be_nl + os_ << be_nl_2 << "/// Component state change method to activated state" << be_nl - << "virtual void ccm_activate (void);" << be_nl + << "virtual void ccm_activate (void);" << be_nl_2 << "/// Component state change method to passivated state" << be_nl << "virtual void ccm_passivate (void);"; } - os_ << be_nl + os_ << be_nl_2 << "/// Component state change method to removed state" << be_nl << "virtual void ccm_remove (void);"; @@ -175,12 +174,18 @@ be_visitor_executor_exh::visit_component (be_component *node) os_ << be_uidt << be_nl_2 << "private:" << be_idt_nl - << "/// Context for component instance" << be_nl + << "/// Context for component instance. Used for all middleware communication" << be_nl << global << sname << "::CCM_" << lname << "_Context_var ciao_context_;" << be_nl_2; - /// The overload of traverse_inheritance_graph() used here - /// doesn't automatically prime the queues. + + // Traverse inheritance graph twice to group + // component attributes and component facets for DOxygen documentation + + // Traverse inheritance grapp for component facets: + + // The overload of traverse_inheritance_graph() used here + // doesn't automatically prime the queues. node->get_insert_queue ().reset (); node->get_del_queue ().reset (); node->get_insert_queue ().enqueue_tail (node_); @@ -188,7 +193,9 @@ be_visitor_executor_exh::visit_component (be_component *node) be_visitor_executor_private_exh v (this->ctx_); v.node (node); - os_ << "/** @name Component attributes. */" << be_nl + v.set_flags (false, true); + + os_ << "/** @name Component attributes. */" << be_nl << "//@{"; Exec_Attr_Decl_Generator attr_decl (&v); @@ -211,6 +218,43 @@ be_visitor_executor_exh::visit_component (be_component *node) os_<< be_nl << "//@}" << be_nl_2; + // Traverse inheritance grapp for component facets: + + // The overload of traverse_inheritance_graph() used here + // doesn't automatically prime the queues. + node->get_insert_queue ().reset (); + node->get_del_queue ().reset (); + node->get_insert_queue ().enqueue_tail (node_); + + be_visitor_executor_private_exh v_f (this->ctx_); + v_f.node (node); + + v_f.set_flags (true, false); + + os_ << "/** @name Component facets. */" << be_nl + << "//@{"; + + Exec_Attr_Decl_Generator facet_decl (&v_f); + + status = + node->traverse_inheritance_graph (facet_decl, + &os_, + false, + false); + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_executor_exh::") + ACE_TEXT ("visit_component - ") + ACE_TEXT ("traverse_inheritance_graph() ") + ACE_TEXT ("for facet decls failed\n")), + -1); + } + + os_<< be_nl << "//@}" << be_nl_2; + + os_ << "/** @name User defined members. */" << be_nl << "//@{"; @@ -294,9 +338,10 @@ Exec_Attr_Decl_Generator::Exec_Attr_Decl_Generator ( int Exec_Attr_Decl_Generator::emit ( be_interface * /*derived_interface */, - TAO_OutStream * /* os */, + TAO_OutStream * os, be_interface * base_interface) { + // Even though this call seems unaware of CCM types, the // visitor must inherit from be_visitor_component_scope so // it will pick up attributes via porttypes. diff --git a/TAO/TAO_IDL/be/be_visitor_component/executor_private_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/executor_private_exh.cpp index 115e44d51b4..42ee1a7e8f1 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/executor_private_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/executor_private_exh.cpp @@ -17,7 +17,9 @@ be_visitor_executor_private_exh::be_visitor_executor_private_exh ( be_visitor_context *ctx) - : be_visitor_component_scope (ctx) + : be_visitor_component_scope (ctx), + do_provides_ (true), + do_attribute_(true) { } @@ -28,6 +30,9 @@ be_visitor_executor_private_exh::~be_visitor_executor_private_exh (void) int be_visitor_executor_private_exh::visit_provides (be_provides *node) { + if (!this->do_provides_) + return 0; + be_type *impl = node->provides_type (); AST_Decl *i_scope = ScopeAsDecl (impl->defined_in ()); bool is_global = (i_scope->node_type () == AST_Decl::NT_root); @@ -35,6 +40,10 @@ be_visitor_executor_private_exh::visit_provides (be_provides *node) ACE_CString scope_name = IdentifierHelper::orig_sn (i_scope->name (), false); + os_ << be_nl_2; + os_ << "/// Object reference to "<< this->ctx_->port_prefix ().c_str () + << node->original_local_name () << " facet"; + os_ << be_nl << smart_scope << scope_name.c_str () << "::CCM_" << impl->original_local_name () << "_var ciao_" @@ -47,6 +56,9 @@ be_visitor_executor_private_exh::visit_provides (be_provides *node) int be_visitor_executor_private_exh::visit_attribute (be_attribute *node) { + if (!this->do_attribute_) + return 0; + AST_Decl::NodeType nt = this->node_->node_type (); // Executor attribute code generated for porttype attributes @@ -58,7 +70,7 @@ be_visitor_executor_private_exh::visit_attribute (be_attribute *node) os_ << be_nl_2; - os_ << "/// @copydoc " << node->full_name () << be_nl; + os_ << "/// Class member storing value of "<< node->local_name () << " attribute" << be_nl; be_visitor_member_type_decl v (this->ctx_); @@ -76,3 +88,11 @@ be_visitor_executor_private_exh::visit_attribute (be_attribute *node) return 0; } + +void +be_visitor_executor_private_exh::set_flags (bool do_provides, + bool do_attribute) +{ + this->do_provides_ = do_provides; + this->do_attribute_ = do_attribute; +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp index 9e623abebc5..40973f6d49b 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp @@ -53,10 +53,8 @@ be_visitor_facet_exh::visit_provides (be_provides *node) const char *smart_scope = (is_global ? "" : "::"); os_ << be_nl_2 - << comment_start_border_ << be_nl - << " * Executor implementation class for " - << lname << " facet" << be_nl - << comment_end_border_; + << "/// Executor implementation class for " + << lname << " facet"; os_ << be_nl << "class " @@ -106,7 +104,7 @@ be_visitor_facet_exh::visit_provides (be_provides *node) os_ << be_uidt << be_nl_2 << "private:" << be_idt_nl - << "/// Context for component instance" << be_nl + << "/// Context for component instance. Uses for all middleware communication." << be_nl << smart_scope << c_scope->full_name () << "::CCM_" << this->node_->local_name () << "_Context_var ciao_context_;" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_component_scope.cpp b/TAO/TAO_IDL/be/be_visitor_component_scope.cpp index 15c01eb028d..a8def8bd445 100644 --- a/TAO/TAO_IDL/be/be_visitor_component_scope.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component_scope.cpp @@ -285,7 +285,8 @@ void be_visitor_component_scope::gen_exec_entrypoint_decl (void) { os_ << be_nl_2 - << "/// Factory method for " << node_->full_name () << be_nl + << "/// Factory method and library entry point used by the middelware" << be_nl + << "/// @return new component instance" << be_nl << "extern \"C\" " << export_macro_.c_str () << " ::Components::EnterpriseComponent_ptr" << be_nl << "create_" << node_->flat_name () diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp index bc683a913af..564d4bc341a 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp @@ -36,9 +36,6 @@ be_visitor_operation_ch::visit_operation (be_operation *node) *os << be_nl_2; - *os << "/// @copydoc " << node->full_name () << be_nl - << "virtual "; - // STEP I: generate the return type. be_type *bt = be_type::narrow_from_decl (node->return_type ()); @@ -50,6 +47,24 @@ be_visitor_operation_ch::visit_operation (be_operation *node) ACE_TEXT ("Bad return type\n")), -1); } + //Only if we are generating exec header file, generate DOxygen documentation + if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_EXH) + { + if (this->void_return_type (bt)) + { + *os << "/// Setter for " << node->local_name() << " attribute " << be_nl + << "/// @param[in] " << node->local_name() << " - New value for " + << node->local_name() << " attribute " << be_nl; + + + } + else + { + *os << "/// Getter for " << node->local_name() << " attribute " << be_nl + << "/// @return value of " << node->local_name() << " attribute " << be_nl; + } + } + *os << "virtual "; // Grab the right visitor to generate the return type. be_visitor_context ctx (*this->ctx_); diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/executor_private_exh.h b/TAO/TAO_IDL/be_include/be_visitor_component/executor_private_exh.h index 00b8925e2da..0cb4ffc36ed 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_component/executor_private_exh.h +++ b/TAO/TAO_IDL/be_include/be_visitor_component/executor_private_exh.h @@ -31,6 +31,10 @@ public: virtual int visit_provides (be_provides *node); virtual int visit_attribute (be_attribute *node); + virtual void set_flags (bool do_provides, bool do_attribute); +private: + bool do_provides_; + bool do_attribute_; }; #endif /* _BE_COMPONENT_EXECUTOR_PRIVATE_EXH_H_ */ |