summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-04-19 18:32:58 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-04-19 18:32:58 +0000
commite16714f3329c2a23929c3984fecde0aa0274fc3d (patch)
treea2777897b9978beefe0ca42409d889447432a8bf
parent4a5108c810e6a1662b4605e5268bc9dfde8ae59d (diff)
downloadATCD-e16714f3329c2a23929c3984fecde0aa0274fc3d.tar.gz
ChangeLogTag: Mon Apr 19 18:27:48 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog27
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp34
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp253
3 files changed, 167 insertions, 147 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 2a4894d3356..d596fb2a517 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,14 +1,33 @@
+Mon Apr 19 18:27:48 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/be/be_visitor_component\servant_svh.cpp:
+ * TAO_IDL/be/be_visitor_component\servant_svs.cpp:
+
+ Changed logic of code generation for get_all_receptacles()
+ get_all_pulishers() and get_all_emitters() to generate
+ method in the class except when LwCCM flag is present.
+ Otherwise if the component has no ports of the
+ given kind, the method returns a sequence (of port
+ descriptors) of length 0. This change in logic means
+ that these methods can be totally removed from the
+ servant base class. In the case of get_all_facets()
+ and get_all_consumers(), the servant base class
+ maintains a table of associated object references,
+ used in several other spec method calls, and is
+ much more efficient than a generated method would be,
+ so we have left them in the base class.
+
Mon Apr 19 10:24:12 UTC 2010 Martin Corino <mcorino@remedy.nl>
- * orbsvcs/tests/Notify/Timeout/run_test.pl:
+ * orbsvcs/tests/Notify/Timeout/run_test.pl:
- Fixed missing library path customization for test target.
+ Fixed missing library path customization for test target.
Mon Apr 19 07:47:12 UTC 2010 Martin Corino <mcorino@remedy.nl>
- * tests/CSD_Strategy_Tests/TP_Test_Static/run_test.pl:
+ * tests/CSD_Strategy_Tests/TP_Test_Static/run_test.pl:
- Fixed missing library path customization for client processes.
+ Fixed missing library path customization for client processes.
Fri Apr 16 20:11:12 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
diff --git a/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp b/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp
index 8fd64c6159b..712c49ad879 100644
--- a/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp
@@ -371,14 +371,14 @@ be_visitor_servant_svh::gen_non_type_specific (void)
<< "virtual ::CORBA::Object_ptr" << be_nl
<< "disconnect (const char * name," << be_nl
<< " ::Components::Cookie * ck);";
-
- if (!be_global->gen_lwccm ())
- {
- os_ << be_nl << be_nl
- << "virtual ::Components::ReceptacleDescriptions *"
- << be_nl
- << "get_all_receptacles (void);";
- }
+ }
+
+ if (!be_global->gen_lwccm ())
+ {
+ os_ << be_nl << be_nl
+ << "virtual ::Components::ReceptacleDescriptions *"
+ << be_nl
+ << "get_all_receptacles (void);";
}
/// If the node is a connector, event sources and sinks cannot
@@ -400,24 +400,16 @@ be_visitor_servant_svh::gen_non_type_specific (void)
<< "unsubscribe (const char * publisher_name,"
<< be_nl
<< " ::Components::Cookie * ck);";
-
- if (!be_global->gen_lwccm ())
- {
- os_ << be_nl << be_nl
- << "virtual ::Components::PublisherDescriptions *"
- << be_nl
- << "get_all_publishers (void);";
- }
}
- /// Generated whether the component has emits ports
- /// or not, except if we are generating a LwCCM
- /// profile, in which case the base class method
- /// (returning a null pointer to a sequence of
- /// emitter descriptions) is seen instead.
if (!be_global->gen_lwccm ())
{
os_ << be_nl << be_nl
+ << "virtual ::Components::PublisherDescriptions *"
+ << be_nl
+ << "get_all_publishers (void);";
+
+ os_ << be_nl << be_nl
<< "virtual ::Components::EmitterDescriptions *"
<< be_nl
<< "get_all_emitters (void);";
diff --git a/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp b/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp
index 41799436651..4d124e43566 100644
--- a/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp
@@ -729,70 +729,70 @@ be_visitor_servant_svs::gen_provides_top (void)
void
be_visitor_servant_svs::gen_publishes_top (void)
{
- if (this->node_->n_publishes () == 0UL)
+ ACE_CDR::ULong npubs = this->node_->n_publishes ();
+
+ if (npubs > 0UL)
{
- return;
- }
+ os_ << be_nl << be_nl
+ << "::Components::Cookie *" << be_nl
+ << node_->local_name () << "_Servant::subscribe ("
+ << be_idt_nl
+ << "const char * publisher_name," << be_nl
+ << "::Components::EventConsumerBase_ptr subscribe)"
+ << be_uidt_nl
+ << "{" << be_idt_nl;
- os_ << be_nl << be_nl
- << "::Components::Cookie *" << be_nl
- << node_->local_name () << "_Servant::subscribe ("
- << be_idt_nl
- << "const char * publisher_name," << be_nl
- << "::Components::EventConsumerBase_ptr subscribe)"
- << be_uidt_nl
- << "{" << be_idt_nl;
+ os_ << "if (publisher_name == 0)" << be_idt_nl
+ << "{" << be_idt_nl
+ << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl
+ << "}" << be_uidt;
- os_ << "if (publisher_name == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl
- << "}" << be_uidt;
+ be_visitor_subscribe_block sb_visitor (this->ctx_);
- be_visitor_subscribe_block sb_visitor (this->ctx_);
+ if (sb_visitor.visit_component_scope (node_) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "be_visitor_component_svs::"
+ "gen_publishes_top - "
+ "subscribe block visitor failed\n"));
- if (sb_visitor.visit_component_scope (node_) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "be_visitor_component_svs::"
- "gen_publishes_top - "
- "subscribe block visitor failed\n"));
+ return;
+ }
- return;
- }
+ os_ << be_nl << be_nl
+ << "throw ::Components::InvalidName ();" << be_uidt_nl
+ << "}";
- os_ << be_nl << be_nl
- << "throw ::Components::InvalidName ();" << be_uidt_nl
- << "}";
+ os_ << be_nl << be_nl
+ << "::Components::EventConsumerBase_ptr" << be_nl
+ << node_->local_name () << "_Servant::unsubscribe ("
+ << be_idt_nl
+ << "const char * publisher_name," << be_nl
+ << "::Components::Cookie * ck)" << be_uidt_nl
+ << "{" << be_idt_nl;
- os_ << be_nl << be_nl
- << "::Components::EventConsumerBase_ptr" << be_nl
- << node_->local_name () << "_Servant::unsubscribe ("
- << be_idt_nl
- << "const char * publisher_name," << be_nl
- << "::Components::Cookie * ck)" << be_uidt_nl
- << "{" << be_idt_nl;
+ os_ << "if (publisher_name == 0)" << be_idt_nl
+ << "{" << be_idt_nl
+ << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl
+ << "}" << be_uidt;
- os_ << "if (publisher_name == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl
- << "}" << be_uidt;
+ be_visitor_unsubscribe_block ub_visitor (this->ctx_);
- be_visitor_unsubscribe_block ub_visitor (this->ctx_);
+ if (ub_visitor.visit_component_scope (node_) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "be_visitor_component_svs::"
+ "gen_publishes_top - "
+ "unsubscribe block visitor failed\n"));
- if (ub_visitor.visit_component_scope (node_) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "be_visitor_component_svs::"
- "gen_publishes_top - "
- "unsubscribe block visitor failed\n"));
+ return;
+ }
- return;
+ os_ << be_nl << be_nl
+ << "throw ::Components::InvalidName ();" << be_uidt_nl
+ << "}";
}
-
- os_ << be_nl << be_nl
- << "throw ::Components::InvalidName ();" << be_uidt_nl
- << "}";
-
+
if (!be_global->gen_lwccm ())
{
os_ << be_nl << be_nl
@@ -811,16 +811,20 @@ be_visitor_servant_svs::gen_publishes_top (void)
<< "safe_retval->length (" << this->node_->n_publishes ()
<< "UL);";
- be_visitor_event_source_desc esd_visitor (this->ctx_);
-
- if (esd_visitor.visit_component_scope (node_) == -1)
+ if (npubs > 0UL)
{
- ACE_ERROR ((LM_ERROR,
- "be_visitor_component_svs::"
- "gen_publishes_top - "
- "event source description visitor failed\n"));
-
- return;
+ be_visitor_event_source_desc esd_visitor (this->ctx_);
+
+ if (esd_visitor.visit_component_scope (node_) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("be_visitor_component_svs::")
+ ACE_TEXT ("gen_publishes_top - ")
+ ACE_TEXT ("event source description ")
+ ACE_TEXT ("visitor failed\n")));
+
+ return;
+ }
}
os_ << be_nl << be_nl
@@ -832,68 +836,69 @@ be_visitor_servant_svs::gen_publishes_top (void)
void
be_visitor_servant_svs::gen_uses_top (void)
{
- if (this->node_->n_uses () == 0UL)
- {
- return;
- }
-
- os_ << be_nl << be_nl
- << "::Components::Cookie *" << be_nl
- << node_->local_name () << "_Servant::connect (" << be_idt_nl
- << "const char * name," << be_nl
- << "::CORBA::Object_ptr connection)" << be_uidt_nl
- << "{" << be_idt_nl;
+ ACE_CDR::ULong nuses = this->node_->n_uses ();
+
+ if (nuses > 0UL)
+ {
+ os_ << be_nl << be_nl
+ << "::Components::Cookie *" << be_nl
+ << node_->local_name () << "_Servant::connect ("
+ << be_idt_nl
+ << "const char * name," << be_nl
+ << "::CORBA::Object_ptr connection)" << be_uidt_nl
+ << "{" << be_idt_nl;
- os_ << "if (name == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl
- << "}" << be_uidt;
+ os_ << "if (name == 0)" << be_idt_nl
+ << "{" << be_idt_nl
+ << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl
+ << "}" << be_uidt;
- be_visitor_connect_block cb_visitor (this->ctx_);
+ be_visitor_connect_block cb_visitor (this->ctx_);
- if (cb_visitor.visit_component_scope (node_) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "be_visitor_component_svs::"
- "gen_uses_top - "
- "connect block visitor failed\n"));
+ if (cb_visitor.visit_component_scope (node_) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("be_visitor_component_svs::")
+ ACE_TEXT ("gen_uses_top - ")
+ ACE_TEXT ("connect block visitor failed\n")));
- return;
- }
+ return;
+ }
- os_ << be_nl << be_nl
- << "throw ::Components::InvalidName ();" << be_uidt_nl
- << "}";
+ os_ << be_nl << be_nl
+ << "throw ::Components::InvalidName ();" << be_uidt_nl
+ << "}";
- os_ << be_nl << be_nl
- << "::CORBA::Object_ptr" << be_nl
- << node_->local_name () << "_Servant::disconnect ("
- << be_idt_nl
- << "const char * name," << be_nl
- << "::Components::Cookie * "
- << (this->node_->has_uses_multiple () ? "ck" : "/* ck */")
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (name == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl
- << "}" << be_uidt;
+ os_ << be_nl << be_nl
+ << "::CORBA::Object_ptr" << be_nl
+ << node_->local_name () << "_Servant::disconnect ("
+ << be_idt_nl
+ << "const char * name," << be_nl
+ << "::Components::Cookie * "
+ << (this->node_->has_uses_multiple () ? "ck" : "/* ck */")
+ << ")" << be_uidt_nl
+ << "{" << be_idt_nl
+ << "if (name == 0)" << be_idt_nl
+ << "{" << be_idt_nl
+ << "throw ::CORBA::BAD_PARAM ();" << be_uidt_nl
+ << "}" << be_uidt;
- be_visitor_disconnect_block db_visitor (this->ctx_);
+ be_visitor_disconnect_block db_visitor (this->ctx_);
- if (db_visitor.visit_component_scope (node_) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "be_visitor_component_svs::"
- "gen_uses_top - "
- "disconnect block visitor failed\n"));
+ if (db_visitor.visit_component_scope (node_) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "be_visitor_component_svs::"
+ "gen_uses_top - "
+ "disconnect block visitor failed\n"));
- return;
- }
+ return;
+ }
- os_ << be_nl << be_nl
- << "throw ::Components::InvalidName ();" << be_uidt_nl
- << "}";
+ os_ << be_nl << be_nl
+ << "throw ::Components::InvalidName ();" << be_uidt_nl
+ << "}";
+ } // nuses > 0UL
if (!be_global->gen_lwccm ())
{
@@ -910,19 +915,23 @@ be_visitor_servant_svs::gen_uses_top (void)
<< " 0);" << be_nl
<< "::Components::ReceptacleDescriptions_var "
<< "safe_retval = retval;" << be_nl
- << "safe_retval->length (" << this->node_->n_uses ()
+ << "safe_retval->length (" << nuses
<< "UL);";
- be_visitor_receptacle_desc rd_visitor (this->ctx_);
-
- if (rd_visitor.visit_component_scope (node_) == -1)
+ if (nuses > 0UL)
{
- ACE_ERROR ((LM_ERROR,
- "be_visitor_component_svs::"
- "gen_uses_top - "
- "receptacle description visitor failed\n"));
-
- return;
+ be_visitor_receptacle_desc rd_visitor (this->ctx_);
+
+ if (rd_visitor.visit_component_scope (node_) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("be_visitor_component_svs::")
+ ACE_TEXT ("gen_uses_top - ")
+ ACE_TEXT ("receptacle description ")
+ ACE_TEXT ("visitor failed\n")));
+
+ return;
+ }
}
os_ << be_nl << be_nl