summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp159
1 files changed, 80 insertions, 79 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp
index 659c0ca279f..2dc48dfd9e2 100644
--- a/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp
@@ -45,15 +45,15 @@ be_visitor_component_ex_idl::visit_component (be_component *node)
{
return 0;
}
-
+
node_ = node;
-
+
this->gen_facets ();
-
+
this->gen_component ();
-
+
this->gen_executor_derived ();
-
+
return 0;
}
@@ -67,9 +67,9 @@ be_visitor_component_ex_idl::visit_attribute (be_attribute *node)
// accepted by parser for attributes.
os_ << be_nl
<< (rd_only ? "readonly " : "") << "attribute ";
-
+
be_type *ft = be_type::narrow_from_decl (node->field_type ());
-
+
os_ << IdentifierHelper::type_name (ft, this);
os_ << " "
<< IdentifierHelper::try_escape (node->original_local_name ()).c_str ();
@@ -90,9 +90,9 @@ be_visitor_component_ex_idl::visit_sequence (be_sequence *node)
{
// Keep output statements separate because of side effects.
os_ << "sequence<";
-
+
be_type *bt = be_type::narrow_from_decl (node->base_type ());
-
+
os_ << IdentifierHelper::type_name (bt, this);
if (!node->unbounded ())
@@ -126,35 +126,35 @@ void
be_visitor_component_ex_idl::gen_nesting_open (AST_Decl *node)
{
os_ << be_nl;
-
+
for (UTL_IdListActiveIterator i (node->name ()); ! i.is_done () ;)
{
UTL_ScopedName tmp (i.item (), 0);
AST_Decl *scope =
node->defined_in ()->lookup_by_name (&tmp, true);
-
+
if (scope == 0)
{
i.next ();
continue;
}
-
+
ACE_CString module_name =
IdentifierHelper::try_escape (scope->original_local_name ());
-
+
if (module_name == "")
{
i.next ();
continue;
}
-
+
i.next ();
-
+
if (i.is_done ())
{
break;
}
-
+
os_ << be_nl
<< "module " << module_name.c_str () << be_nl
<< "{" << be_idt;
@@ -167,20 +167,20 @@ be_visitor_component_ex_idl::gen_nesting_close (AST_Decl *node)
for (UTL_IdListActiveIterator i (node->name ()); ! i.is_done () ;)
{
ACE_CString module_name (i.item ()->get_string ());
-
+
if (module_name == "")
{
i.next ();
continue;
}
-
+
i.next ();
-
+
if (i.is_done ())
{
break;
}
-
+
os_ << be_uidt_nl
<< "};";
}
@@ -194,15 +194,15 @@ be_visitor_component_ex_idl::gen_facets (void)
si.next ())
{
AST_Decl *d = si.item ();
-
+
if (d->node_type () != AST_Decl::NT_provides)
{
continue;
}
-
+
AST_Provides *p =
AST_Provides::narrow_from_decl (d);
-
+
be_type *impl =
be_type::narrow_from_decl (p->provides_type ());
@@ -210,16 +210,16 @@ be_visitor_component_ex_idl::gen_facets (void)
{
continue;
}
-
+
// Without the '-Glfa' option, generate facet executor IDL
- // only for facets whose interface type is in the main file.
+ // only for facets whose interface type is in the main file.
if (impl->imported () && !be_global->gen_lem_force_all ())
{
continue;
}
-
+
this->gen_nesting_open (impl);
-
+
os_ << be_nl
<< "local interface CCM_"
<< impl->original_local_name ()->get_string ()
@@ -227,12 +227,12 @@ be_visitor_component_ex_idl::gen_facets (void)
<< IdentifierHelper::orig_sn (impl->name ()).c_str ()
<< be_nl
<< "{" << be_idt;
-
+
os_ << be_uidt_nl
<< "};";
-
+
this->gen_nesting_close (impl);
-
+
impl->ex_idl_facet_gen (true);
}
}
@@ -241,9 +241,9 @@ void
be_visitor_component_ex_idl::gen_component (void)
{
this->gen_nesting_open (node_);
-
+
this->gen_executor_base ();
-
+
this->gen_context ();
this->gen_nesting_close (node_);
@@ -253,17 +253,17 @@ void
be_visitor_component_ex_idl::gen_executor_base (void)
{
AST_Component *base = node_->base_component ();
-
+
os_ << be_nl
<< "local interface CCM_"
<< node_->original_local_name ()->get_string ()
<< be_idt_nl
<< ": ";
-
+
if (base == 0)
{
os_ << "::Components::EnterpriseComponent";
-
+
this->gen_supported ();
}
else
@@ -271,19 +271,19 @@ be_visitor_component_ex_idl::gen_executor_base (void)
ACE_CString sname_str =
IdentifierHelper::orig_sn (
ScopeAsDecl (base->defined_in ())->name ());
-
+
const char *sname = sname_str.c_str ();
const char *global = (sname_str == "" ? "" : "::");
-
+
os_ << global << sname << "::CCM_"
<< base->original_local_name ()->get_string ();
}
-
+
os_ << be_uidt_nl
<< "{" << be_idt;
-
+
this->gen_executor_contents ();
-
+
os_ << be_uidt_nl
<< "};";
}
@@ -292,16 +292,16 @@ void
be_visitor_component_ex_idl::gen_supported (void)
{
os_ << be_idt;
-
+
AST_Interface **supported = node_->supports ();
-
+
for (long i = 0; i < node_->n_supports (); ++i)
{
os_ << "," << be_nl
<< "::"
<< IdentifierHelper::orig_sn (supported[i]->name ()).c_str ();
}
-
+
os_ << be_uidt;
}
@@ -310,7 +310,7 @@ be_visitor_component_ex_idl::gen_executor_contents (void)
{
this->gen_facet_ops ();
this->gen_consumer_ops ();
-
+
/// This picks up the attributes.
if (this->visit_scope (node_) == -1)
{
@@ -329,29 +329,29 @@ be_visitor_component_ex_idl::gen_facet_ops (void)
si.next ())
{
AST_Decl *d = si.item ();
-
+
if (d->node_type () != AST_Decl::NT_provides)
{
continue;
}
-
+
AST_Provides *p =
AST_Provides::narrow_from_decl (d);
be_type *impl =
be_type::narrow_from_decl (p->provides_type ());
-
+
AST_Decl *scope = ScopeAsDecl (impl->defined_in ());
-
+
ACE_CString sname_str =
IdentifierHelper::orig_sn (scope->name ());
const char *sname = sname_str.c_str ();
-
+
const char *lname =
impl->original_local_name ()->get_string ();
-
+
const char *global = (sname_str == "" ? "" : "::");
-
+
os_ << be_nl
<< global << sname << "::CCM_" << lname << " get_"
<< p->local_name ()->get_string () << " ();";
@@ -366,18 +366,18 @@ be_visitor_component_ex_idl::gen_consumer_ops (void)
si.next ())
{
AST_Decl *d = si.item ();
-
+
if (d->node_type () != AST_Decl::NT_consumes)
{
continue;
}
-
+
AST_Consumes *c =
AST_Consumes::narrow_from_decl (d);
be_type *impl =
be_type::narrow_from_decl (c->consumes_type ());
-
+
os_ << be_nl
<< "void push_" << c->local_name ()->get_string ()
<< " (in ::"
@@ -426,9 +426,9 @@ be_visitor_component_ex_idl::gen_context (void)
<< node_->original_local_name ()->get_string ()
<< "_Context" << be_idt_nl
<< ": ";
-
+
AST_Component *base = node_->base_component ();
-
+
if (base == 0)
{
os_ << "::Components::SessionContext";
@@ -436,26 +436,26 @@ be_visitor_component_ex_idl::gen_context (void)
else
{
AST_Decl *scope = ScopeAsDecl (base->defined_in ());
-
+
ACE_CString sname_str =
IdentifierHelper::orig_sn (scope->name ());
const char *sname = sname_str.c_str ();
-
+
const char *lname =
base->original_local_name ()->get_string ();
-
+
const char *global = (sname_str == "" ? "" : "::");
-
+
os_ << global << sname << "::CCM_" << lname << "_Context";
}
-
+
os_ << be_uidt_nl
<< "{" << be_idt;
-
+
this->gen_publisher_ops ();
this->gen_emitter_ops ();
this->gen_receptacle_ops ();
-
+
os_ << be_uidt_nl
<< "};";
}
@@ -468,18 +468,18 @@ be_visitor_component_ex_idl::gen_publisher_ops (void)
si.next ())
{
AST_Decl *d = si.item ();
-
+
if (d->node_type () != AST_Decl::NT_publishes)
{
continue;
}
-
+
AST_Publishes *p =
AST_Publishes::narrow_from_decl (d);
be_type *impl =
be_type::narrow_from_decl (p->publishes_type ());
-
+
os_ << be_nl
<< "void push_" << p->local_name ()->get_string () << " (in ::"
<< IdentifierHelper::orig_sn (impl->name ()).c_str ()
@@ -495,18 +495,18 @@ be_visitor_component_ex_idl::gen_emitter_ops (void)
si.next ())
{
AST_Decl *d = si.item ();
-
+
if (d->node_type () != AST_Decl::NT_emits)
{
continue;
}
-
+
AST_Emits *e =
AST_Emits::narrow_from_decl (d);
be_type *impl =
be_type::narrow_from_decl (e->emits_type ());
-
+
os_ << be_nl
<< "void push_" << e->local_name ()->get_string () << " (in ::"
<< IdentifierHelper::orig_sn (impl->name ()).c_str ()
@@ -522,21 +522,21 @@ be_visitor_component_ex_idl::gen_receptacle_ops (void)
si.next ())
{
AST_Decl *d = si.item ();
-
+
if (d->node_type () != AST_Decl::NT_uses)
{
continue;
}
-
+
AST_Uses *u =
AST_Uses::narrow_from_decl (d);
be_type *impl =
be_type::narrow_from_decl (u->uses_type ());
-
+
os_ << be_nl
<< "::";
-
+
// Note that we don't strip off the possible '_cxx_' when
// adding the 'Connections' suffix. The front end will
// create this implied IDL node with the '_cxx_' so lookup
@@ -562,14 +562,14 @@ void
be_visitor_component_ex_idl::gen_executor_derived (void)
{
AST_Decl *scope = ScopeAsDecl (node_->defined_in ());
-
+
ACE_CString sname_str =
IdentifierHelper::orig_sn (scope->name ());
const char *sname = sname_str.c_str ();
-
+
const char *lname =
node_->original_local_name ()->get_string ();
-
+
const char *global = (sname_str == "" ? "" : "::");
os_ << be_nl << be_nl
@@ -577,7 +577,7 @@ be_visitor_component_ex_idl::gen_executor_derived (void)
<< "{" << be_idt_nl
<< "typedef " << global << sname << "::CCM_" << lname
<< "_Context " << lname << "_Exec_Context;";
-
+
os_ << be_nl << be_nl
<< "local interface " << lname << "_Exec" << be_idt_nl
<< ": " << global << sname << "::CCM_" << lname
@@ -585,7 +585,8 @@ be_visitor_component_ex_idl::gen_executor_derived (void)
<< "::Components::SessionComponent" << be_uidt << be_uidt_nl
<< "{" << be_nl
<< "};";
-
+
os_ << be_uidt_nl
<< "};";
-} \ No newline at end of file
+}
+