summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp225
-rw-r--r--TAO/TAO_IDL/be/be_interface_strategy.cpp533
-rw-r--r--TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp33
-rw-r--r--TAO/TAO_IDL/be/be_visitor_factory.cpp90
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface.cpp17
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp7
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp15
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp62
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp93
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp88
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface.cpp218
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp116
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp36
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp141
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp66
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp249
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp72
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp69
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp72
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp88
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp95
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp86
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp17
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp27
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp99
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp8
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/inv_arglist.cpp103
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp931
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp99
-rw-r--r--TAO/TAO_IDL/be_include/be_codegen.h67
-rw-r--r--TAO/TAO_IDL/be_include/be_interface.h76
-rw-r--r--TAO/TAO_IDL/be_include/be_interface_strategy.h199
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface.h18
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_broker_ch.h41
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_impl_ch.h41
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_sh.h41
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/proxy_brokers_ch.h41
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/proxy_impls_ch.h41
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_ch.h41
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_ch.h41
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_sh.h41
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_sh.h41
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation.h6
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation/base_proxy_impl_ch.h46
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation/inv_arglist.h55
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation/operation_cs.h38
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation/proxy_impl_xh.h46
49 files changed, 3412 insertions, 1271 deletions
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index b2c7e000e98..e6be7cb2f83 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -584,6 +584,8 @@ TAO_CodeGen::start_server_header (const char *fname)
<< "#include \"tao/PortableServer/PortableServer.h\"\n"
<< "#include \"tao/PortableServer/Servant_Base.h\"\n"
<< "#include \"tao/PortableServer/Collocated_Object.h\"\n"
+ << "#include \"tao/PortableServer/ThruPOA_Object_Proxy_Impl.h\"\n"
+ << "#include \"tao/PortableServer/Direct_Object_Proxy_Impl.h\"\n"
<< "#include \"tao/PortableServer/ServerRequestInfo.h\"\n"
<< "\n";
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index 74103051f87..983c84d0aad 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -50,19 +50,19 @@ be_interface::be_interface (UTL_ScopedName *n,
UTL_StrList *p,
idl_bool local,
idl_bool abstract)
- : AST_Interface (n,
- ih,
- nih,
- ih_flat,
- nih_flat,
- p,
- local,
+ : AST_Interface (n,
+ ih,
+ nih,
+ ih_flat,
+ nih_flat,
+ p,
+ local,
abstract),
- AST_Decl (AST_Decl::NT_interface,
- n,
+ AST_Decl (AST_Decl::NT_interface,
+ n,
p),
UTL_Scope (AST_Decl::NT_interface),
- COMMON_Base (local,
+ COMMON_Base (local,
abstract),
skel_count_ (0),
in_mult_inheritance_ (-1),
@@ -207,7 +207,7 @@ be_interface::compute_full_skel_name (const char *prefix,
delete i;
- ACE_NEW (skelname,
+ ACE_NEW (skelname,
char [namelen+1]);
skelname[0] = '\0';
first = I_TRUE;
@@ -280,14 +280,14 @@ be_interface::relative_name (const char *localname,
char *use_curr = use_name;
char *use_next;
- ACE_OS::memset (macro,
- '\0',
+ ACE_OS::memset (macro,
+ '\0',
NAMEBUFSIZE);
- ACE_OS::memset (def_name,
- '\0',
+ ACE_OS::memset (def_name,
+ '\0',
NAMEBUFSIZE);
- ACE_OS::memset (use_name,
- '\0',
+ ACE_OS::memset (use_name,
+ '\0',
NAMEBUFSIZE);
// Traverse every component of the def_scope and use_scope beginning at the
@@ -297,14 +297,14 @@ be_interface::relative_name (const char *localname,
// macro. Whenever there is no match, the remaining components of the
// def_scope form the second argument.
- ACE_OS::strcpy (def_name,
+ ACE_OS::strcpy (def_name,
localname);
- ACE_OS::strcpy (use_name,
+ ACE_OS::strcpy (use_name,
othername);
while (def_curr && use_curr)
{
- // Find the first occurrence of a ::
+ // Find the first occurrence of a ::
// and advance the next pointers accordingly.
def_next = ACE_OS::strstr (def_curr, "::");
use_next = ACE_OS::strstr (use_curr, "::");
@@ -351,7 +351,7 @@ be_interface::relative_name (const char *localname,
// Copy the remaining def_name (if any left)
if (def_curr)
{
- ACE_OS::strcat (macro,
+ ACE_OS::strcat (macro,
def_curr);
}
@@ -367,7 +367,7 @@ int be_interface::in_mult_inheritance (void)
// Compute once for all.
// Determine if we are in some form of a multiple inheritance.
if (this->traverse_inheritance_graph (
- be_interface::in_mult_inheritance_helper,
+ be_interface::in_mult_inheritance_helper,
0
) == -1)
{
@@ -402,8 +402,8 @@ be_interface::gen_copy_ctors (TAO_OutStream *os)
}
int
-be_interface::gen_copy_ctors_helper (be_interface *node,
- be_interface *base,
+be_interface::gen_copy_ctors_helper (be_interface *node,
+ be_interface *base,
TAO_OutStream *os)
{
static int first = 0;
@@ -448,8 +448,8 @@ be_interface::gen_def_ctors (TAO_OutStream *os)
int
-be_interface::gen_def_ctors_helper (be_interface* node,
- be_interface* base,
+be_interface::gen_def_ctors_helper (be_interface* node,
+ be_interface* base,
TAO_OutStream *os)
{
@@ -520,11 +520,11 @@ be_interface::gen_var_defn (char *interface_name)
// Default constructor.
*ch << namebuf << " (void); // default constructor" << nl;
- *ch << namebuf << " (" << interface_name << "_ptr p)"
+ *ch << namebuf << " (" << interface_name << "_ptr p)"
<< " : ptr_ (p) {} " << nl;
// Copy constructor.
- *ch << namebuf << " (const " << namebuf
+ *ch << namebuf << " (const " << namebuf
<< " &); // copy constructor" << nl;
// Destructor.
@@ -554,7 +554,7 @@ be_interface::gen_var_defn (char *interface_name)
*ch << interface_name << "_ptr &out (void);" << nl;
*ch << interface_name << "_ptr _retn (void);" << nl;
- // Generate an additional member function that returns
+ // Generate an additional member function that returns
// the underlying pointer.
*ch << interface_name << "_ptr ptr (void) const;\n";
*ch << "\n";
@@ -799,7 +799,7 @@ be_interface::gen_out_defn (char *interface_name)
// Generate the out definition (always in the client header)
// start with whatever was our current indent level.
- ch->indent ();
+ ch->indent ();
*ch << "class " << be_global->stub_export_macro ()
<< " " << namebuf << nl;
@@ -882,7 +882,7 @@ be_interface::gen_out_impl (char *interface_local_name,
// for over here.
// Start with whatever was our current indent level.
- ci->indent ();
+ ci->indent ();
*ci << "// *************************************************************"
<< nl;
@@ -1113,7 +1113,7 @@ be_interface::gen_operation_table (void)
// Open the temp file.
if (os->open (temp_file,
- TAO_OutStream::TAO_GPERF_INPUT)
+ TAO_OutStream::TAO_GPERF_INPUT)
== -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -1129,7 +1129,7 @@ be_interface::gen_operation_table (void)
// Traverse the graph.
if (this->traverse_inheritance_graph (
- be_interface::gen_optable_helper,
+ be_interface::gen_optable_helper,
os
) == -1)
{
@@ -1215,7 +1215,7 @@ be_interface::gen_optable_entries (be_interface *derived)
// or one of its ancestors.
ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (this,
+ UTL_ScopeActiveIterator (this,
UTL_Scope::IK_decls),
-1);
// Instantiate a scope iterator.
@@ -1293,7 +1293,7 @@ be_interface::gen_optable_entries (be_interface *derived)
// or one of its ancestors.
ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (this,
+ UTL_ScopeActiveIterator (this,
UTL_Scope::IK_decls),
-1);
// Instantiate a scope iterator.
@@ -1381,14 +1381,14 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
TAO_OutStream *os)
{
// Loop index.
- long i;
+ long i;
// Queue data structure needed for breadth-first traversal of
// inheritance tree.
- ACE_Unbounded_Queue <be_interface*> queue;
+ ACE_Unbounded_Queue <be_interface*> queue;
// For a special case of a deeply nested inheritance graph and one specific
- // way of inheritance in which a node that was already visited,
+ // way of inheritance in which a node that was already visited,
// but is not present in
// the queue, gets inserted at the tail. This situation arises when a node
// multiply inherits from two or more interfaces in which the first parent is
@@ -1396,14 +1396,14 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
// parent turns out to be a child of the first .
// Queue of dequeued nodes to be searched for the above case.
- ACE_Unbounded_Queue <be_interface*> del_queue;
+ ACE_Unbounded_Queue <be_interface*> del_queue;
// Insert ourselves in the queue.
if (queue.enqueue_tail (this) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_interface::traverse_inheritance_graph - "
- "error generating entries\n"),
+ "error generating entries\n"),
-1);
}
@@ -1423,7 +1423,7 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
{
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_interface::traverse_graph - "
- "dequeue_head failed\n"),
+ "dequeue_head failed\n"),
-1);
}
@@ -1432,7 +1432,7 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
{
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_interface::traverse_graph - "
- "enqueue_head failed\n"),
+ "enqueue_head failed\n"),
-1);
}
@@ -1443,7 +1443,7 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
{
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_interface::traverse_graph - "
- "helper code gen failed\n"),
+ "helper code gen failed\n"),
-1);
}
@@ -1452,7 +1452,7 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
for (i=0; i < bi->n_inherits (); i++)
{
// Parent of the dequeued element.
- be_interface *parent;
+ be_interface *parent;
// Initialize an iterator to search the queue for duplicates.
ACE_Unbounded_Queue_Iterator<be_interface*> q_iter (queue);
@@ -1464,7 +1464,7 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
{
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_interface::gen_server_skeletons -"
- " bad inherited interface\n"),
+ " bad inherited interface\n"),
-1);
}
@@ -1475,10 +1475,10 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
while (!q_iter.done ())
{
// Queue element.
- be_interface **temp;
+ be_interface **temp;
(void) q_iter.next (temp);
- if (!ACE_OS::strcmp (parent->full_name (),
+ if (!ACE_OS::strcmp (parent->full_name (),
(*temp)->full_name ()))
{
// We exist in this queue and cannot be inserted.
@@ -1490,7 +1490,7 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
}
(void) q_iter.advance ();
- }
+ }
// Initialize an iterator to search the del_queue for duplicates.
ACE_Unbounded_Queue_Iterator<be_interface*> del_q_iter (del_queue);
@@ -1498,11 +1498,11 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
while (!found && !del_q_iter.done ())
{
// Queue element.
- be_interface **temp;
+ be_interface **temp;
(void) del_q_iter.next (temp);
- if (!ACE_OS::strcmp (parent->full_name (),
+ if (!ACE_OS::strcmp (parent->full_name (),
(*temp)->full_name ()))
{
// We exist in this del_queue and cannot be inserted.
@@ -1524,7 +1524,7 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
{
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_interface::gen_server_skeletons - "
- "enqueue op failed\n"),
+ "enqueue op failed\n"),
-1);
}
}
@@ -1549,7 +1549,7 @@ be_interface::gen_optable_helper (be_interface *derived,
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_interface::gen_operation_table - "
"error generating entries for inherited"
- "interfaces\n"),
+ "interfaces\n"),
-1);
}
@@ -1955,7 +1955,7 @@ be_interface::queryinterface_helper (be_interface *derived,
// If the ancestor is in the root scope, we can use the local name.
if (scope->node_type () == AST_Decl::NT_root)
{
- *os << "&" << ancestor->local_name () << "::_narrow" << be_uidt
+ *os << "&" << ancestor->local_name () << "::_narrow" << be_uidt
<< "))" << be_nl;
}
// Or, if it's defined in a scope different than the child's, the
@@ -1968,8 +1968,8 @@ be_interface::queryinterface_helper (be_interface *derived,
// The ACE_NESTED_CLASS macro is necessary in this case.
else
{
- *os << "&ACE_NESTED_CLASS (::" << scope->name () << ", "
- << ancestor->local_name () << ")" << "::_narrow" << be_uidt
+ *os << "&ACE_NESTED_CLASS (::" << scope->name () << ", "
+ << ancestor->local_name () << ")" << "::_narrow" << be_uidt
<< "))" << be_nl;
}
@@ -2036,7 +2036,7 @@ be_interface::gen_skel_helper (be_interface *derived,
// proper casting.
ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (ancestor,
+ UTL_ScopeActiveIterator (ancestor,
UTL_Scope::IK_decls),
-1);
// Instantiate a scope iterator.
@@ -2283,7 +2283,7 @@ TAO_CodeGen::CG_STATE
be_interface::next_state (TAO_CodeGen::CG_STATE current_state,
int is_extra_state)
{
- return this->strategy_->next_state (current_state,
+ return this->strategy_->next_state (current_state,
is_extra_state);
}
@@ -2308,10 +2308,117 @@ be_interface::original_interface ()
be_interface *
be_interface::replacement (void)
{
- // Return a node, which can be used as a replacement.
- return this->strategy_->replacement ();
+ return this->strategy_->replacement ();
+}
+
+const char *
+be_interface::base_proxy_impl_name (void)
+{
+ return this->strategy_->base_proxy_impl_name ();
+}
+
+const char *
+be_interface::full_base_proxy_impl_name (void)
+{
+ return this->strategy_->full_base_proxy_impl_name ();
+}
+
+const char *
+be_interface::remote_proxy_impl_name (void)
+{
+ return this->strategy_->remote_proxy_impl_name ();
+}
+
+const char *
+be_interface::full_remote_proxy_impl_name (void)
+{
+ return this->strategy_->full_remote_proxy_impl_name ();
+}
+
+const char *
+be_interface::thru_poa_proxy_impl_name (void)
+{
+ return this->strategy_->thru_poa_proxy_impl_name ();
+}
+
+
+const char *
+be_interface::full_thru_poa_proxy_impl_name (void)
+{
+ return this->strategy_->full_thru_poa_proxy_impl_name ();
}
+
+const char *
+be_interface::direct_proxy_impl_name (void)
+{
+ return this->strategy_->direct_proxy_impl_name ();
+}
+
+const char *
+be_interface::full_direct_proxy_impl_name (void)
+{
+ return this->strategy_->full_direct_proxy_impl_name ();
+}
+
+
+const char *
+be_interface::base_proxy_broker_name (void)
+{
+ return this->strategy_->base_proxy_broker_name ();
+}
+
+const char *
+be_interface::full_base_proxy_broker_name (void)
+{
+ return this->strategy_->full_base_proxy_broker_name ();
+}
+
+
+const char *
+be_interface::remote_proxy_broker_name (void)
+{
+ return this->strategy_->remote_proxy_broker_name ();
+}
+
+const char *
+be_interface::full_remote_proxy_broker_name (void)
+{
+ return this->strategy_->full_remote_proxy_broker_name ();
+}
+
+
+const char *
+be_interface::strategized_proxy_broker_name (void)
+{
+ return this->strategy_->strategized_proxy_broker_name ();
+}
+
+const char *
+be_interface::full_strategized_proxy_broker_name (void)
+{
+ return this->strategy_->full_strategized_proxy_broker_name ();
+}
+
+const char *
+be_interface::client_enclosing_scope (void)
+{
+ return this->strategy_->client_scope ();
+}
+
+const char *
+be_interface::flat_client_enclosing_scope (void)
+{
+ return this->strategy_->flat_client_scope ();
+}
+
+const char *
+be_interface::server_enclosing_scope (void)
+{
+ return this->strategy_->server_scope ();
+}
+
+
// Narrowing
IMPL_NARROW_METHODS3 (be_interface, AST_Interface, be_scope, be_type)
IMPL_NARROW_FROM_DECL (be_interface)
diff --git a/TAO/TAO_IDL/be/be_interface_strategy.cpp b/TAO/TAO_IDL/be/be_interface_strategy.cpp
index 6f8cc94f0e8..3f16874d193 100644
--- a/TAO/TAO_IDL/be/be_interface_strategy.cpp
+++ b/TAO/TAO_IDL/be/be_interface_strategy.cpp
@@ -24,19 +24,19 @@
ACE_RCSID(be, be_interface_strategy, "$Id$")
-be_interface_strategy::be_interface_strategy (be_interface *node,
- Strategy_Kind strategy_type)
- : local_name_(0),
- full_name_(0),
- flat_name_(0),
- repoID_(0),
- full_skel_name_(0),
- full_coll_name_(0),
- local_coll_name_(0),
- relative_skel_name_(0),
- node_ (node),
- cached_type_ (-1),
- strategy_type_ (strategy_type)
+ be_interface_strategy::be_interface_strategy (be_interface *node,
+ Strategy_Kind strategy_type)
+ : local_name_(0),
+ full_name_(0),
+ flat_name_(0),
+ repoID_(0),
+ full_skel_name_(0),
+ full_coll_name_(0),
+ local_coll_name_(0),
+ relative_skel_name_(0),
+ node_ (node),
+ cached_type_ (-1),
+ strategy_type_ (strategy_type)
{
}
@@ -97,8 +97,8 @@ be_interface_strategy::compute_coll_names (int type,
const char *collocated = collocated_names[type];
int name_len = ACE_OS::strlen (collocated)
- + sizeof (poa)
- + 1;
+ + sizeof (poa)
+ + 1;
if (prefix)
{
@@ -111,7 +111,7 @@ be_interface_strategy::compute_coll_names (int type,
}
UTL_IdListActiveIterator *i = 0;
- ACE_NEW (i,
+ ACE_NEW (i,
UTL_IdListActiveIterator (node_->name ()));
while (!i->is_done ())
@@ -130,7 +130,7 @@ be_interface_strategy::compute_coll_names (int type,
this->full_coll_name_[0] = 0;
// Iterate again.
- ACE_NEW (i,
+ ACE_NEW (i,
UTL_IdListActiveIterator (node_->name ()));
// Only the first component get the "POA_" preffix.
@@ -184,8 +184,8 @@ be_interface_strategy::compute_coll_names (int type,
// Compute the local name for the collocated class.
int local_len = ACE_OS::strlen (collocated)
- + ACE_OS::strlen (node_->AST_Interface::local_name ()->get_string ())
- + 1;
+ + ACE_OS::strlen (node_->AST_Interface::local_name ()->get_string ())
+ + 1;
if (prefix)
{
local_len += ACE_OS::strlen (prefix);
@@ -196,15 +196,15 @@ be_interface_strategy::compute_coll_names (int type,
local_len += ACE_OS::strlen (suffix);
}
- ACE_NEW (this->local_coll_name_,
+ ACE_NEW (this->local_coll_name_,
char[local_len]);
- ACE_OS::strcpy (this->local_coll_name_,
+ ACE_OS::strcpy (this->local_coll_name_,
collocated);
if (prefix)
{
- ACE_OS::strcat (this->local_coll_name_,
+ ACE_OS::strcat (this->local_coll_name_,
prefix);
}
@@ -230,8 +230,8 @@ be_interface_strategy::compute_names (const char *name,
}
int name_length = ACE_OS::strlen (name) +
- ACE_OS::strlen (prefix) +
- ACE_OS::strlen (suffix);
+ ACE_OS::strlen (prefix) +
+ ACE_OS::strlen (suffix);
ACE_NEW (new_name,
char[name_length + 1]);
@@ -260,7 +260,7 @@ be_interface_strategy::compute_names (const char *name,
break;
}
}
- }
+ }
if (interface_name == 0)
{
@@ -268,18 +268,18 @@ be_interface_strategy::compute_names (const char *name,
}
ACE_OS::strcpy (&new_name[name_length
- - ACE_OS::strlen (prefix)
- - ACE_OS::strlen (interface_name)
- - ACE_OS::strlen (suffix)],
+ - ACE_OS::strlen (prefix)
+ - ACE_OS::strlen (interface_name)
+ - ACE_OS::strlen (suffix)],
prefix);
ACE_OS::strcpy (&new_name[name_length
- - ACE_OS::strlen (interface_name)
- - ACE_OS::strlen (suffix)],
+ - ACE_OS::strlen (interface_name)
+ - ACE_OS::strlen (suffix)],
interface_name);
ACE_OS::strcpy (&new_name[name_length
- - ACE_OS::strlen(suffix)],
+ - ACE_OS::strlen(suffix)],
suffix);
}
@@ -310,10 +310,10 @@ be_interface_strategy::next_state (TAO_CodeGen::CG_STATE current_state,
return current_state;
}
-int
+int
be_interface_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE /* current_state */
- )
+ TAO_CodeGen::CG_STATE /* current_state */
+ )
{
return 0;
}
@@ -329,9 +329,9 @@ be_interface_strategy::replacement (void)
// AMI Hander Strategy
be_interface_ami_handler_strategy::be_interface_ami_handler_strategy (
- be_interface *node
- )
- : be_interface_default_strategy (node,
+ be_interface *node
+ )
+ : be_interface_default_strategy (node,
AMI_HANDLER)
{
}
@@ -343,9 +343,9 @@ be_interface_ami_handler_strategy::~be_interface_ami_handler_strategy (void)
TAO_CodeGen::CG_STATE
be_interface_ami_handler_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int /*is_extra_state */
- )
+ TAO_CodeGen::CG_STATE current_state,
+ int /*is_extra_state */
+ )
{
return current_state;
}
@@ -356,7 +356,7 @@ be_interface_ami_handler_strategy::next_state (
be_interface_ami_exception_holder_strategy
::be_interface_ami_exception_holder_strategy (be_interface *node)
- : be_interface_default_strategy (node,
+ : be_interface_default_strategy (node,
AMI_EXCEPTION_HOLDER)
{
@@ -370,21 +370,21 @@ be_interface_ami_exception_holder_strategy
TAO_CodeGen::CG_STATE
be_interface_ami_exception_holder_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state
- )
+ TAO_CodeGen::CG_STATE current_state,
+ int is_extra_state
+ )
{
if (is_extra_state)
- {
+ {
switch (current_state)
- {
+ {
case TAO_CodeGen::TAO_VALUETYPE_OBV_CH:
return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH;
case TAO_CodeGen::TAO_VALUETYPE_OBV_CS:
return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CS;
default:
return current_state;
- }
+ }
}
else
{
@@ -393,10 +393,10 @@ be_interface_ami_exception_holder_strategy::next_state (
}
-int
+int
be_interface_ami_exception_holder_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- )
+ TAO_CodeGen::CG_STATE current_state
+ )
{
if (current_state == TAO_CodeGen::TAO_VALUETYPE_OBV_CH
|| current_state == TAO_CodeGen::TAO_VALUETYPE_OBV_CS)
@@ -415,9 +415,9 @@ be_interface_ami_exception_holder_strategy::has_extra_code_generation (
be_interface_ami_strategy::be_interface_ami_strategy (be_interface *node,
be_interface *handler)
- : be_interface_default_strategy (node,
+ : be_interface_default_strategy (node,
AMI_INTERFACE),
- handler_ (handler)
+ handler_ (handler)
{
}
@@ -431,32 +431,32 @@ be_interface_ami_strategy::next_state (TAO_CodeGen::CG_STATE current_state,
int is_extra_state)
{
if (is_extra_state)
- {
+ {
switch (current_state)
- {
+ {
case TAO_CodeGen::TAO_AMI_INTERFACE_CH:
return TAO_CodeGen::TAO_INTERFACE_CH;
default:
return current_state;
- }
+ }
}
else
- {
+ {
switch (current_state)
- {
+ {
case TAO_CodeGen::TAO_INTERFACE_CH:
return TAO_CodeGen::TAO_AMI_INTERFACE_CH;
default:
return current_state;
- }
+ }
}
}
-int
+int
be_interface_ami_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- )
+ TAO_CodeGen::CG_STATE current_state
+ )
{
if (current_state == TAO_CodeGen::TAO_AMI_INTERFACE_CH)
{
@@ -477,12 +477,46 @@ be_interface_ami_strategy::replacement (void)
// ****************************************************************
// Default Strategy
+const char *be_interface_default_strategy::suffix_table_[] =
+{
+ "_Proxy_Impl",
+ "_Proxy_Broker"
+};
+
+const char *be_interface_default_strategy::tag_table_[] =
+{
+ "_Remote",
+ "_ThruPOA",
+ "_Direct",
+ "_Strategized",
+ "_TAO_"
+};
+
+
be_interface_default_strategy::be_interface_default_strategy (
- be_interface *node,
- Strategy_Kind strategy_kind
- )
- : be_interface_strategy (node,
- strategy_kind)
+ be_interface *node,
+ Strategy_Kind strategy_kind
+ )
+ : be_interface_strategy (node,
+ strategy_kind),
+ base_proxy_impl_name_ (0),
+ remote_proxy_impl_name_ (0),
+ thruPOA_proxy_impl_name_ (0),
+ direct_proxy_impl_name_ (0),
+ full_base_proxy_impl_name_ (0),
+ full_remote_proxy_impl_name_ (0),
+ full_thruPOA_proxy_impl_name_ (0),
+ full_direct_proxy_impl_name_ (0),
+ base_proxy_broker_ (0),
+ remote_proxy_broker_ (0),
+ strategized_proxy_broker_ (0),
+ full_base_proxy_broker_name_ (0),
+ full_remote_proxy_broker_name_ (0),
+ full_strategized_proxy_broker_name_(0),
+ client_scope_ (0),
+ flat_client_scope_ (0),
+ server_scope_ (0),
+ flat_server_scope_ (0)
{
}
@@ -514,8 +548,8 @@ be_interface_default_strategy::local_name (void)
if (!this->local_name_)
{
int len = ACE_OS::strlen (
- node_->AST_Interface::local_name ()->get_string ()
- );
+ node_->AST_Interface::local_name ()->get_string ()
+ );
ACE_NEW_RETURN (this->local_name_,
char[len + 1],
@@ -523,7 +557,7 @@ be_interface_default_strategy::local_name (void)
ACE_OS::strcpy (this->local_name_,
node_->AST_Interface::local_name ()->get_string ());
- }
+ }
return this->local_name_;
}
@@ -532,16 +566,16 @@ const char *
be_interface_default_strategy::flat_name (void)
{
if (!this->flat_name_)
- {
- int len = ACE_OS::strlen (node_->be_decl::flat_name ());
+ {
+ int len = ACE_OS::strlen (node_->be_decl::flat_name ());
- ACE_NEW_RETURN (this->flat_name_,
- char[len + 1],
- 0);
+ ACE_NEW_RETURN (this->flat_name_,
+ char[len + 1],
+ 0);
- ACE_OS::strcpy (this->flat_name_,
- node_->be_decl::flat_name ());
- }
+ ACE_OS::strcpy (this->flat_name_,
+ node_->be_decl::flat_name ());
+ }
return this->flat_name_;
}
@@ -550,16 +584,16 @@ const char *
be_interface_default_strategy::repoID (void)
{
if (this->repoID_ == 0)
- {
- int len = ACE_OS::strlen (node_->be_decl::repoID ());
+ {
+ int len = ACE_OS::strlen (node_->be_decl::repoID ());
- ACE_NEW_RETURN (this->repoID_,
- char[len + 1],
- 0);
+ ACE_NEW_RETURN (this->repoID_,
+ char[len + 1],
+ 0);
- ACE_OS::strcpy (this->repoID_,
- node_->be_decl::repoID ());
- }
+ ACE_OS::strcpy (this->repoID_,
+ node_->be_decl::repoID ());
+ }
return this->repoID_;
}
@@ -571,7 +605,7 @@ be_interface_default_strategy::full_skel_name (void)
{
// the following method is inherited from the base class
node_->compute_full_skel_name ("POA_",
- this->full_skel_name_);
+ this->full_skel_name_);
}
return this->full_skel_name_;
@@ -598,5 +632,332 @@ be_interface_default_strategy::local_coll_name (int type)
return this->local_coll_name_;
}
+char *
+be_interface_default_strategy::create_with_prefix_suffix (const char *prefix,
+ const char *str,
+ const char *suffix,
+ const char *separator)
+{
+ char *cat_string = 0;
+ unsigned int length =
+ ACE_OS::strlen (str) +
+ ACE_OS::strlen (prefix) +
+ ACE_OS::strlen (suffix) +
+ ACE_OS::strlen (separator) +
+ 1; // The '/0'
+ ACE_NEW_RETURN (cat_string, char[length], 0);
+ ACE_OS::strcpy (cat_string, prefix);
+ ACE_OS::strcat (cat_string, str);
+ ACE_OS::strcat (cat_string, separator);
+ ACE_OS::strcat (cat_string, suffix);
+
+ return cat_string;
+}
+
+const char *
+be_interface_default_strategy::base_proxy_impl_name (void)
+{
+ if (this->base_proxy_impl_name_ != 0)
+ return this->base_proxy_impl_name_;
+
+ this->base_proxy_impl_name_ =
+ this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
+ this->node_->local_name (),
+ this->suffix_table_[PROXY_IMPL]);
+
+ return this->base_proxy_impl_name_;
+}
+
+
+const char *
+be_interface_default_strategy::client_scope (void)
+{
+ if (this->client_scope_ != 0)
+ return this->client_scope_;
+
+ const char *full_name = this->full_name ();
+ const char *name = this->local_name ();
+
+ int offset = ACE_OS::strlen (name);
+ int length = ACE_OS::strlen (full_name) - offset;
+ this->client_scope_ = new char[length+1];
+
+ ACE_OS::strncpy (this->client_scope_, full_name, length);
+ this->client_scope_[length] = '\0';
+
+ return this->client_scope_;
+}
+const char *
+be_interface_default_strategy::flat_client_scope (void)
+{
+ if (this->flat_client_scope_ != 0)
+ return this->flat_client_scope_;
+
+ const char *full_name = this->flat_name ();
+ const char *name = this->local_name ();
+
+ int offset = ACE_OS::strlen (name);
+ int length = ACE_OS::strlen (full_name) - offset;
+ this->flat_client_scope_ = new char[length+1];
+
+ ACE_OS::strncpy (this->flat_client_scope_, full_name, length);
+ this->flat_client_scope_[length] = '\0';
+
+ return this->flat_client_scope_;
+}
+
+
+const char *
+be_interface_default_strategy::server_scope (void)
+{
+ if (this->server_scope_ != 0)
+ return this->server_scope_;
+
+ const char *full_name =
+ this->node_->full_coll_name (be_interface::DIRECT);
+
+ const char *name = this->node_->local_coll_name (be_interface::DIRECT);
+
+ int offset = ACE_OS::strlen (name);
+ int length = ACE_OS::strlen (full_name) - offset;
+ this->server_scope_ = new char[length+1];
+
+ ACE_OS::strncpy (this->server_scope_, full_name, length);
+ this->server_scope_[length] = '\0';
+
+ return this->server_scope_;
+}
+
+const char *
+be_interface_default_strategy::flat_server_scope (void)
+{
+ if (this->flat_server_scope_ != 0)
+ return this->flat_server_scope_;
+
+ const char *full_name = this->flat_name ();
+ const char *name = this->local_name ();
+
+ int offset = ACE_OS::strlen (name);
+ int length = ACE_OS::strlen (full_name) - offset;
+ this->flat_client_scope_ = new char[length+1];
+
+ ACE_OS::strncpy (this->flat_server_scope_, full_name, length);
+ this->flat_server_scope_[length] = '\0';
+
+ return this->flat_server_scope_;
+}
+
+
+
+const char *
+be_interface_default_strategy::full_base_proxy_impl_name (void)
+{
+ if (this->full_base_proxy_impl_name_ != 0)
+ return this->full_base_proxy_impl_name_;
+
+ const char *scope = this->client_scope ();
+ const char *base_name = this->base_proxy_impl_name ();
+ int length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+ this->full_base_proxy_impl_name_ = new char[length+1];
+ ACE_OS::strcpy (this->full_base_proxy_impl_name_, scope);
+ ACE_OS::strcat (this->full_base_proxy_impl_name_, base_name);
+
+ return this->full_base_proxy_impl_name_;
+}
+
+
+
+const char *
+be_interface_default_strategy::remote_proxy_impl_name (void)
+{
+ if (this->remote_proxy_impl_name_ != 0)
+ return this->remote_proxy_impl_name_;
+
+
+ this->remote_proxy_impl_name_ =
+ this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
+ this->node_->local_name (),
+ this->suffix_table_[PROXY_IMPL],
+ this->tag_table_[REMOTE]);
+
+ return this->remote_proxy_impl_name_;
+}
+
+const char *
+be_interface_default_strategy::full_remote_proxy_impl_name (void)
+{
+ if (this->full_remote_proxy_impl_name_ != 0)
+ return this->full_remote_proxy_impl_name_;
+
+ const char *scope = this->client_scope ();
+ const char *base_name = this->remote_proxy_impl_name ();
+ int length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+ this->full_remote_proxy_impl_name_ = new char[length+1];
+ ACE_OS::strcpy (this->full_remote_proxy_impl_name_, scope);
+ ACE_OS::strcat (this->full_remote_proxy_impl_name_, base_name);
+
+ return this->full_remote_proxy_impl_name_;
+}
+
+const char *
+be_interface_default_strategy::thru_poa_proxy_impl_name (void)
+{
+ if (this->thruPOA_proxy_impl_name_ != 0)
+ return this->thruPOA_proxy_impl_name_;
+
+ this->thruPOA_proxy_impl_name_ =
+ this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
+ this->node_->local_name (),
+ this->suffix_table_[PROXY_IMPL],
+ this->tag_table_[THRU_POA]);
+
+ return this->thruPOA_proxy_impl_name_;
+}
+
+const char *
+be_interface_default_strategy::full_thru_poa_proxy_impl_name (void)
+{
+ if (this->full_thruPOA_proxy_impl_name_ != 0)
+ return this->full_thruPOA_proxy_impl_name_;
+
+ const char *scope = this->server_scope ();
+ const char *base_name = this->thru_poa_proxy_impl_name ();
+ int length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+ this->full_thruPOA_proxy_impl_name_ = new char[length+1];
+ ACE_OS::strcpy (this->full_thruPOA_proxy_impl_name_, scope);
+ ACE_OS::strcat (this->full_thruPOA_proxy_impl_name_, base_name);
+
+ return this->full_thruPOA_proxy_impl_name_;
+}
+
+
+const char *
+be_interface_default_strategy::direct_proxy_impl_name (void)
+{
+ if (this->direct_proxy_impl_name_ != 0)
+ return this->direct_proxy_impl_name_;
+
+ this->direct_proxy_impl_name_ =
+ this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
+ this->node_->local_name (),
+ this->suffix_table_[PROXY_IMPL],
+ this->tag_table_[DIRECT]);
+
+ return this->direct_proxy_impl_name_;
+}
+
+
+const char *
+be_interface_default_strategy::full_direct_proxy_impl_name (void)
+{
+ if (this->full_direct_proxy_impl_name_ != 0)
+ return this->full_direct_proxy_impl_name_;
+
+ const char *scope = this->server_scope ();
+ const char *base_name = this->direct_proxy_impl_name ();
+
+ int length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+ this->full_direct_proxy_impl_name_ = new char[length+1];
+ ACE_OS::strcpy (this->full_direct_proxy_impl_name_, scope);
+ ACE_OS::strcat (this->full_direct_proxy_impl_name_, base_name);
+
+ return this->full_direct_proxy_impl_name_;
+}
+
+
+const char *
+be_interface_default_strategy::base_proxy_broker_name (void)
+{
+ if (this->base_proxy_broker_ != 0)
+ return this->base_proxy_broker_;
+
+ this->base_proxy_broker_ =
+ this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
+ this->node_->local_name (),
+ this->suffix_table_[PROXY_BROKER]);
+
+ return this->base_proxy_broker_;
+}
+
+
+const char *
+be_interface_default_strategy::full_base_proxy_broker_name (void)
+{
+ if (this->full_base_proxy_broker_name_ != 0)
+ return this->full_base_proxy_broker_name_;
+
+ const char *scope = this->client_scope ();
+ const char *base_name = this->base_proxy_broker_name ();
+ int length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+ this->full_base_proxy_broker_name_ = new char[length+1];
+ ACE_OS::strcpy (this->full_base_proxy_broker_name_, scope);
+ ACE_OS::strcat (this->full_base_proxy_broker_name_, base_name);
+
+ return this->full_base_proxy_broker_name_;
+}
+
+const char *
+be_interface_default_strategy::remote_proxy_broker_name (void)
+{
+ if (this->remote_proxy_broker_ != 0)
+ return this->remote_proxy_broker_;
+
+ this->remote_proxy_broker_ =
+ this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
+ this->node_->local_name (),
+ this->suffix_table_[PROXY_BROKER],
+ this->tag_table_[REMOTE]);
+
+ return this->remote_proxy_broker_;
+}
+
+
+const char *
+be_interface_default_strategy::full_remote_proxy_broker_name (void)
+{
+ if (this->full_remote_proxy_broker_name_ != 0)
+ return this->full_remote_proxy_broker_name_;
+
+ const char *scope = this->client_scope ();
+ const char *base_name = this->remote_proxy_broker_name ();
+ int length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+ this->full_remote_proxy_broker_name_ = new char[length+1];
+ ACE_OS::strcpy (this->full_remote_proxy_broker_name_, scope);
+ ACE_OS::strcat (this->full_remote_proxy_broker_name_, base_name);
+
+ return this->full_remote_proxy_broker_name_;
+}
+
+
+const char *
+be_interface_default_strategy::strategized_proxy_broker_name (void)
+{
+ if (this->strategized_proxy_broker_ != 0)
+ return this->strategized_proxy_broker_;
+
+ this->strategized_proxy_broker_ =
+ this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
+ this->node_->local_name (),
+ this->suffix_table_[PROXY_BROKER],
+ this->tag_table_[STRATEGIZED]);
+
+ return this->strategized_proxy_broker_;
+}
+
+const char *
+be_interface_default_strategy::full_strategized_proxy_broker_name (void)
+{
+ if (this->full_strategized_proxy_broker_name_ != 0)
+ return this->full_strategized_proxy_broker_name_;
+
+ const char *scope = this->server_scope ();
+ const char *base_name = this->strategized_proxy_broker_name ();
+ int length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+ this->full_strategized_proxy_broker_name_ = new char[length+1];
+ ACE_OS::strcpy (this->full_strategized_proxy_broker_name_, scope);
+ ACE_OS::strcat (this->full_strategized_proxy_broker_name_, base_name);
+
+ return this->full_strategized_proxy_broker_name_;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
index bb10447fe2d..7471325c568 100644
--- a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
@@ -119,6 +119,23 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS:
ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS);
break;
+
+ case TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH);
+ break;
+ case TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH);
+ break;
+ case TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS);
+ break;
+ case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS);
+ break;
+ case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS);
+ break;
+
case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CH:
ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH);
break;
@@ -262,6 +279,22 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS:
ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS);
break;
+
+ case TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH);
+ break;
+ case TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH);
+ break;
+ case TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS);
+ break;
+ case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS);
+ break;
+ case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS);
+ break;
case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH:
ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH);
break;
diff --git a/TAO/TAO_IDL/be/be_visitor_factory.cpp b/TAO/TAO_IDL/be/be_visitor_factory.cpp
index f67fcb563a7..e047b3d8f74 100644
--- a/TAO/TAO_IDL/be/be_visitor_factory.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_factory.cpp
@@ -166,6 +166,50 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_INTERFACE_IS:
return new be_visitor_interface_is (new_ctx);
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH:
+ return new be_visitor_interface_proxy_brokers_ch (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH:
+ return new be_visitor_interface_base_proxy_broker_ch (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH:
+ return new be_visitor_interface_remote_proxy_broker_ch (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS:
+ return new be_visitor_interface_remote_proxy_broker_cs (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH:
+ return new be_visitor_interface_strategized_proxy_broker_sh (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS:
+ return new be_visitor_interface_strategized_proxy_broker_ss (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH:
+ return new be_visitor_interface_proxy_impls_ch (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH:
+ return new be_visitor_interface_base_proxy_impl_ch (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH:
+ return new be_visitor_interface_remote_proxy_impl_ch (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS:
+ return new be_visitor_interface_remote_proxy_impl_cs (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH:
+ return new be_visitor_interface_thru_poa_proxy_impl_sh (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS:
+ return new be_visitor_interface_thru_poa_proxy_impl_ss (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
+ return new be_visitor_interface_direct_proxy_impl_sh (new_ctx);
+
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
+ return new be_visitor_interface_direct_proxy_impl_ss (new_ctx);
+
+ // Old Collocation Stuff.
+
case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH:
return new be_visitor_interface_thru_poa_collocated_sh (new_ctx);
@@ -196,7 +240,7 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx)
return new be_visitor_interface_smart_proxy_ch (new_ctx);
case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS:
return new be_visitor_interface_smart_proxy_cs (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH:
return new be_visitor_interface_interceptors_ch (new_ctx);
case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS:
return new be_visitor_interface_interceptors_cs (new_ctx);
@@ -438,6 +482,12 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS:
case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SH:
case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SS:
+
+ case TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH:
+ case TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS:
+ case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS:
return new be_visitor_attribute (new_ctx);
case TAO_CodeGen::TAO_EXCEPTION_CH:
@@ -544,12 +594,26 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS:
return new be_visitor_operation_interceptors_ss (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_RETTYPE_CH:
+ case TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH:
+ return new be_visitor_operation_base_proxy_impl_ch (new_ctx);
+ case TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH:
+ return new be_visitor_operation_proxy_impl_xh (new_ctx);
+
+ case TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS:
+ return new be_visitor_operation_remote_proxy_impl_cs (new_ctx);
+
+ case TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS:
+ return new be_visitor_operation_thru_poa_proxy_impl_ss (new_ctx);
+
+ case TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS:
+ return new be_visitor_operation_direct_proxy_impl_ss (new_ctx);
+
+ case TAO_CodeGen::TAO_OPERATION_RETTYPE_CH:
case TAO_CodeGen::TAO_OPERATION_RETTYPE_SH:
case TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS:
return new be_visitor_operation_rettype (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_RETTYPE_CH:
+ case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_RETTYPE_CH:
return new be_visitor_operation_interceptors_info_rettype (new_ctx);
case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS:
@@ -579,28 +643,35 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS:
return new be_visitor_operation_rettype_assign_ss (new_ctx);
+ case TAO_CodeGen::TAO_OPERATION_INVOKE_ARG_LIST:
+ return new be_visitor_operation_inv_arglist (new_ctx);
+
case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS:
+
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS:
return new be_visitor_operation_arglist (new_ctx);
-
+
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CH:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CS:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CH:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CS:
- case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_CS:
- case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_PARAMLIST:
+ case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_CS:
+ case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_PARAMLIST:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SH:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SS:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_SH:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_SS:
- case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_SS:
+ case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_SS:
return new be_visitor_operation_interceptors_arglist (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT:
+ case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT:
return new be_visitor_operation_interceptors_result (new_ctx);
case TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS:
@@ -628,6 +699,7 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_SH:
case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_OTHERS:
return new be_visitor_args_arglist (new_ctx);
+
case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_CH:
return new be_visitor_args_request_info_ch (new_ctx);
case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_CH:
@@ -637,7 +709,7 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx)
return new be_visitor_args_request_info_cs (new_ctx);
case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_PARAMLIST:
return new be_visitor_args_paramlist (new_ctx);
- case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_RESULT:
+ case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_RESULT:
return new be_visitor_args_request_info_result (new_ctx);
case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_SH:
return new be_visitor_args_request_info_sh (new_ctx);
diff --git a/TAO/TAO_IDL/be/be_visitor_interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface.cpp
index 4720cbc0c0e..830bcea703d 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface.cpp
@@ -51,5 +51,22 @@
#include "be_visitor_interface/interceptors_sh.cpp"
#include "be_visitor_interface/interceptors_ss.cpp"
+// Proxy Brokers
+#include "be_visitor_interface/base_proxy_broker_ch.cpp"
+#include "be_visitor_interface/proxy_brokers_ch.cpp"
+#include "be_visitor_interface/remote_proxy_broker_ch.cpp"
+#include "be_visitor_interface/remote_proxy_broker_cs.cpp"
+#include "be_visitor_interface/strategized_proxy_broker_sh.cpp"
+#include "be_visitor_interface/strategized_proxy_broker_ss.cpp"
+
+// Proxy Impls
+#include "be_visitor_interface/proxy_impls_ch.cpp"
+#include "be_visitor_interface/base_proxy_impl_ch.cpp"
+#include "be_visitor_interface/remote_proxy_impl_ch.cpp"
+#include "be_visitor_interface/remote_proxy_impl_cs.cpp"
+#include "be_visitor_interface/thru_poa_proxy_impl_sh.cpp"
+#include "be_visitor_interface/thru_poa_proxy_impl_ss.cpp"
+#include "be_visitor_interface/direct_proxy_impl_sh.cpp"
+#include "be_visitor_interface/direct_proxy_impl_ss.cpp"
ACE_RCSID(be, be_visitor_interface, "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp
index 0bc218af559..b6eb6218ac1 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp
@@ -53,11 +53,12 @@ be_visitor_interface_any_op_ch::visit_interface (be_interface *node)
TAO_OutStream *os = this->ctx_->stream ();
os->indent ();
- // Generate the stub factory function pointer declaration the interface is
+ // Generate the proxy broker factory function pointer declaration the interface is
// not locality constraint.
*os << "extern " << be_global->stub_export_macro () << " "
- << node->full_name () << "_ptr (*_TAO_collocation_"
- << node->flat_name () << "_Stub_Factory_function_pointer) ("
+ << node->full_base_proxy_broker_name () << " * (*"
+ << node->flat_client_enclosing_scope () << node->base_proxy_broker_name ()
+ << "_Factory_function_pointer) ("
<< be_idt << be_idt_nl
<< "CORBA::Object_ptr obj" << be_uidt_nl
<< ");" << be_uidt_nl;
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
index 7625b99bc44..ae62af1e664 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
@@ -53,15 +53,16 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node)
os->indent ();
if (!node->is_local ())
{
- // Generate the stub factory function pointer definition.
- *os << node->full_name () << "_ptr (*";
+ // Generate the proxy broker factory function pointer definition.
+ *os << node->full_base_proxy_broker_name () << " * (*";
- *os << "_TAO_collocation_"
- << node->flat_name () << "_Stub_Factory_function_pointer) ("
- << be_idt << be_idt_nl
+ *os << node->flat_client_enclosing_scope ()
+ << node->base_proxy_broker_name ()
+ << "_Factory_function_pointer) ("
+ << be_idt << be_idt_nl
<< "CORBA::Object_ptr obj" << be_uidt_nl
- << ") = 0;" << be_uidt_nl;
-
+ << ") = 0;" << be_uidt_nl << be_nl;
+
os->indent ();
// generate the Any <<= and >>= operator declarations
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp
new file mode 100644
index 00000000000..4e565e50a4c
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp
@@ -0,0 +1,62 @@
+//$Id$
+
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_interface.h"
+
+ACE_RCSID (be_visitor_interface, base_proxy_broker_ch, "$Id$")
+
+be_visitor_interface_base_proxy_broker_ch::be_visitor_interface_base_proxy_broker_ch (be_visitor_context *ctx)
+ : be_visitor_interface (ctx)
+{
+ // No-Op.
+}
+
+
+be_visitor_interface_base_proxy_broker_ch::~be_visitor_interface_base_proxy_broker_ch (void)
+{
+ // No-Op.
+}
+
+int
+be_visitor_interface_base_proxy_broker_ch::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+
+ *os << be_nl
+ << "///////////////////////////////////////////////////////////////////////" << be_nl
+ << "// Base Proxy Broker Declaration " << be_nl
+ << "//" << be_nl << be_nl;
+
+ // Generate the class declaration.
+ os->indent ();
+ *os << "class " << be_global->stub_export_macro () << " "
+ << node->base_proxy_broker_name () << be_nl << "{" << be_nl
+ << "public:"
+ << be_idt_nl; // idt = 1
+
+ // Destructor
+ *os << "virtual ~" << node->base_proxy_broker_name () << " (void);\n" << be_nl;
+
+ // Accessor Method
+ *os << "virtual " << node->base_proxy_impl_name () << " &"
+ << "select_proxy ("
+ << be_idt_nl; // idt = 2
+
+ *os << node->local_name () << " *object," << be_nl
+ << "CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()" << be_uidt_nl
+ << ") = 0;"
+ << be_uidt_nl // idt = 1
+ << be_uidt_nl; // idt = 0
+
+ *os << "};" << be_nl << be_nl;
+
+ *os << be_nl
+ << "//" << be_nl
+ << "// End Base Proxy Broker Declaration " << be_nl
+ << "///////////////////////////////////////////////////////////////////////"
+ << be_nl << be_nl;
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp
new file mode 100644
index 00000000000..f71b1cb1b34
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp
@@ -0,0 +1,93 @@
+//$Id$
+
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_interface.h"
+
+ACE_RCSID (be_visitor_interface, base_proxy_impl_ch, "$Id$")
+
+be_visitor_interface_base_proxy_impl_ch::be_visitor_interface_base_proxy_impl_ch (be_visitor_context *ctx)
+ : be_visitor_interface (ctx)
+{
+ // No-Op.
+}
+
+
+be_visitor_interface_base_proxy_impl_ch::~be_visitor_interface_base_proxy_impl_ch (void)
+{
+ // No-Op.
+}
+
+int
+be_visitor_interface_base_proxy_impl_ch::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+
+ os->indent ();
+
+ *os << be_nl
+ << "///////////////////////////////////////////////////////////////////////" << be_nl
+ << "// Base Impl. Declaration" << be_nl
+ << "//" << be_nl << be_nl;
+
+ // Generate Class Declaration.
+ *os << "class " << be_global->stub_export_macro ()
+ << " " << node->base_proxy_impl_name ();
+
+ if (node->n_inherits () > 0)
+ {
+ *os << " : " << be_idt_nl; // idt = 1
+ for (int i = 0; i < node->n_inherits (); i++)
+ {
+ be_interface *inherited =
+ be_interface::narrow_from_decl (node->inherits ()[i]);
+ be_decl *scope = 0;
+ if (inherited->is_nested ())
+ {
+ // inherited node is used in the scope of "node" node
+ scope =
+ be_scope::narrow_from_scope (node->defined_in ())->decl ();
+ }
+
+ *os << "public virtual ";
+ *os << inherited->full_base_proxy_impl_name ();
+ if (i < node->n_inherits () - 1) // node is the case of multiple
+ // inheritance, so put a comma
+ {
+ *os << ", " << be_nl;
+ }
+ } // end of for loop
+ *os << be_uidt_nl; // idt = 0
+ }
+ else
+ {
+ *os << " : public virtual TAO_Object_Proxy_Impl" << be_nl;
+ }
+ *os << "{" << be_nl << "public:"
+ << be_idt_nl; // idt = 1
+
+ // Destructor Declaration.
+ *os << "virtual ~" << node->base_proxy_impl_name () << " (void);"
+ << be_nl << be_nl;
+
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interface_base_proxy_impl_ch::"
+ "visit_interface - "
+ "codegen for scope failed\n"), -1);
+ }
+
+ *os << be_uidt // idt = 0
+ << "};" << be_nl;
+ *os << be_nl
+ << "//" << be_nl
+ << "// Base Proxy Impl. Declaration" << be_nl
+ << "///////////////////////////////////////////////////////////////////////"
+ << be_nl << be_nl;
+ return 0;
+}
+
+
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp
new file mode 100644
index 00000000000..fb983d94848
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp
@@ -0,0 +1,88 @@
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_interface.h"
+
+ACE_RCSID (be_visitor_interface, direct_proxy_broker_impl_sh, "$Id$")
+
+be_visitor_interface_direct_proxy_impl_sh::be_visitor_interface_direct_proxy_impl_sh (be_visitor_context *ctx)
+ : be_visitor_interface (ctx)
+{
+ // No-Op.
+}
+
+
+be_visitor_interface_direct_proxy_impl_sh::~be_visitor_interface_direct_proxy_impl_sh (void)
+{
+ // No-Op.
+}
+
+int
+be_visitor_interface_direct_proxy_impl_sh::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+
+ // os->gen_ifdef_macro (node->flat_name (), "DIRECT_PROXY_IMPL_");
+ os->decr_indent (0);
+
+ *os << be_nl
+ << "///////////////////////////////////////////////////////////////////////" << be_nl
+ << "// Direct Impl. Declaration" << be_nl
+ << "//" << be_nl << be_nl;
+ // Generate Class Declaration.
+ *os << "class " << be_global->skel_export_macro ()
+ << " " << node->direct_proxy_impl_name ();
+ *os << " : " << be_idt_nl << "public virtual " << node->full_base_proxy_impl_name ()
+ << "," << be_nl << "public virtual " << "TAO_Direct_Object_Proxy_Impl";
+
+ if (node->n_inherits () > 0)
+ {
+ *os << "," << be_nl;
+ for (int i = 0; i < node->n_inherits (); i++)
+ {
+ be_interface *inherited =
+ be_interface::narrow_from_decl (node->inherits ()[i]);
+ be_decl *scope = 0;
+ if (inherited->is_nested ())
+ {
+ // inherited node is used in the scope of "node" node
+ scope =
+ be_scope::narrow_from_scope (node->defined_in ())->decl ();
+ }
+
+ *os << "public virtual ";
+ *os << inherited->full_direct_proxy_impl_name ();
+ if (i < node->n_inherits () - 1) // node is the case of multiple
+ // inheritance, so put a comma
+ {
+ *os << ", ";
+ }
+ *os << be_nl;
+ } // end of for loop
+ }
+
+ *os << be_uidt_nl;
+ *os << "{" << be_nl << "public:" << be_idt_nl;
+
+ // Dtor
+ *os << "~" << node->direct_proxy_impl_name () << " (void);" << be_nl << be_nl;
+
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) direct_proxy_impl_sh::"
+ "visit_interface - "
+ "codegen for scope failed\n"), -1);
+ }
+
+ *os << "};" << be_uidt << be_nl << be_nl;
+ *os << be_nl
+ << "//" << be_nl
+ << "// Direct Proxy Impl. Declaration" << be_nl
+ << "///////////////////////////////////////////////////////////////////////"
+ << be_nl << be_nl;
+ // os->gen_endif ();
+ return 0;
+
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
index 743d7815c95..5da2c0b859f 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
@@ -118,6 +118,47 @@ be_visitor_interface::visit_attribute (be_attribute *node)
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI);
break;
+
+
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH:
+ ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH);
+ break;
+
+
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
+ ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH);
+ break;
+
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS:
+ ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS);
+ break;
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS:
+ ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS);
+ break;
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
+ ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS);
+ break;
+
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS:
+
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS:
+
+
case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
@@ -203,6 +244,30 @@ be_visitor_interface::visit_constant (be_constant *node)
case TAO_CodeGen::TAO_INTERFACE_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
+
return 0; // nothing to be done
default:
{
@@ -273,6 +338,7 @@ be_visitor_interface::visit_enum (be_enum *node)
case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS:
ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS);
break;
+
case TAO_CodeGen::TAO_INTERFACE_CI:
case TAO_CodeGen::TAO_INTERFACE_SH:
case TAO_CodeGen::TAO_INTERFACE_IH:
@@ -291,6 +357,29 @@ be_visitor_interface::visit_enum (be_enum *node)
case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
return 0; // nothing to be done
default:
{
@@ -381,6 +470,29 @@ be_visitor_interface::visit_exception (be_exception *node)
case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
return 0; // nothing to be done
default:
{
@@ -485,6 +597,27 @@ be_visitor_interface::visit_operation (be_operation *node)
case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS:
ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS);
break;
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH);
+ break;
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH);
+ break;
+
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS);
+ break;
+
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS);
+ break;
+
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
+ ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS);
+ break;
+
case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
@@ -621,6 +754,30 @@ be_visitor_interface::visit_structure (be_structure *node)
case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
+
return 0; // nothing to be done
default:
{
@@ -711,6 +868,30 @@ be_visitor_interface::visit_union (be_union *node)
case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
+
return 0; // nothing to be done
default:
{
@@ -801,6 +982,30 @@ be_visitor_interface::visit_typedef (be_typedef *node)
case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH:
+ case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH:
+ case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
+ case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
+
return 0; // nothing to be done
default:
{
@@ -834,3 +1039,16 @@ be_visitor_interface::visit_typedef (be_typedef *node)
delete visitor;
return 0;
}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
index f098c5ce27d..194435f80d5 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
@@ -56,8 +56,8 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
// generate the ifdefined macro for the _ptr type
os->gen_ifdef_macro (node->flat_name (), "_ptr");
-
-
+
+
// the following two are required to be under the ifdef macro to avoid
// multiple declarations
@@ -99,7 +99,17 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
// now the interface definition itself
os->gen_ifdef_macro (node->flat_name ());
-
+
+ if (!node->is_local ())
+ {
+ // Forward class declaration
+ *os << "// Forward Classes Declaration" << be_nl
+ << "class " << node->base_proxy_impl_name () << ";" << be_nl
+ << "class " << node->remote_proxy_impl_name () << ";" << be_nl
+ << "class " << node->base_proxy_broker_name () << ";" << be_nl
+ << "class " << node->remote_proxy_broker_name () << ";" << be_nl
+ << be_nl;
+ }
// now generate the class definition
*os << "class " << be_global->stub_export_macro ()
<< " " << node->local_name ();
@@ -217,21 +227,48 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
// the _interface_repository_id method
*os << "virtual const char* _interface_repository_id (void) const;\n"
<< be_uidt_nl;
-
- // generate the "protected" constructor so that users cannot instantiate
- // us
- *os << "protected:" << be_idt_nl
- << node->local_name () << " (void);" << be_nl;
-
+
+ if (!node->is_local ())
+ {
+ // Add the Proxy Broker member variable.
+ *os << "private:" << be_idt_nl
+ << node->base_proxy_broker_name () << " *" << "the" << node->base_proxy_broker_name ()
+ << "_;" << be_nl << be_uidt_nl;
+ }
+ *os << "protected:" << be_idt_nl;
+ if (!node->is_local ())
+ {
+ // generate the "protected" constructor so that users cannot instantiate
+ // us
+
+ *os << node->local_name () << " (int collocated = 0);" << be_nl << be_nl;
+
+ *os << "protected:" << be_idt_nl
+ << "// This methods travese the inheritance tree and set the" << be_nl
+ << "// parents piece of the given class in the right mode" << be_nl
+ << "virtual void setup_collocation (int collocated);" << be_nl << be_nl;
+ }
+ else
+ *os << node->local_name () << " ();" << be_nl << be_nl;
+
// Local interfaces don't support stub objects.
- if (! node->is_local ())
- *os << node->local_name ()
- << " (TAO_Stub *objref, " << be_idt << be_idt_nl
- << "CORBA::Boolean _tao_collocated = 0" << be_uidt_nl
- << ");" << be_uidt_nl;
-
+ if (! node->is_local ())
+ {
+ *os << node->local_name ()
+ << " (" << be_idt << be_nl << "TAO_Stub *objref, " << be_nl
+ << "CORBA::Boolean _tao_collocated = 0," << be_nl
+ << "TAO_Abstract_ServantBase *servant = 0" << be_nl
+ << ");" << be_uidt_nl << be_nl;
+
+ // Friends declarations
+ *os << "friend class " << node->remote_proxy_impl_name () << ";" << be_nl
+ << "friend class " << node->thru_poa_proxy_impl_name () << ";" << be_nl
+ << "friend class " << node->direct_proxy_impl_name () << ";" << be_uidt_nl << be_nl;
+ }
// Protected destructor.
- *os << "virtual ~" << node->local_name () << " (void);" << be_uidt_nl;
+ *os << "virtual ~" << node->local_name () << " (void);" << be_nl;
+
+
// private copy constructor and assignment operator. These are not
// allowed, hence they are private.
@@ -242,8 +279,9 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
// Generate the embedded RequestInfo classes per operation.
// This is to be used by interceptors.
- be_visitor_context ctx (*this->ctx_);
be_visitor *visitor = 0;
+ be_visitor_context ctx (*this->ctx_);
+
// Interceptor related classes.
ctx.state (TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH);
visitor = tao_cg->make_visitor (&ctx);
@@ -282,7 +320,46 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
delete visitor;
visitor = 0;
}
-
+ if (!node->is_local ())
+ {
+ // Proxy Implementation Declaration
+ visitor = 0;
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_ch::"
+ "visit_interface - "
+ "codegen for Proxy Broker classes failed\n"),
+ -1);
+ }
+ delete visitor;
+ }
+
+ if (!node->is_local ())
+ {
+ // Proxy Broker Declaration
+ visitor = 0;
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_ch::"
+ "visit_interface - "
+ "codegen for Proxy Broker classes failed\n"),
+ -1);
+ }
+ delete visitor;
+ }
+
os->gen_endif ();
if (! node->is_local ())
@@ -304,9 +381,10 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
}
}
-
+
node->cli_hdr_gen (I_TRUE);
} // if !cli_hdr_gen
return 0;
}
+
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
index 0b9997e3de5..b7fbe477843 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
@@ -71,11 +71,37 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
os->gen_ifdef_macro (node->flat_name (), "");
*os << "ACE_INLINE" << be_nl;
*os << node->name () << "::" << node->local_name () <<
- " (TAO_Stub *objref, "
- << "CORBA::Boolean _tao_collocated) // constructor" << be_nl;
- *os << " : CORBA_Object (objref, _tao_collocated)"
- << be_nl;
- *os << "{}" << be_nl;
+ " (" << be_idt_nl << "TAO_Stub *objref," << be_nl
+ << "CORBA::Boolean _tao_collocated," << be_nl
+ << "TAO_Abstract_ServantBase *servant" << be_nl
+ << ")" // constructor
+ << be_nl;
+ *os << " : CORBA_Object (objref, _tao_collocated, servant)" << be_nl;
+ *os << "{" << be_idt_nl
+ << be_idt_nl // idt = 1
+ << "this->setup_collocation (_tao_collocated);";
+ /*
+ if (node->n_inherits () > 0)
+ {
+ for (int i = 0; i < node->n_inherits (); i++)
+ {
+ be_interface *inherited =
+ be_interface::narrow_from_decl (node->inherits ()[i]);
+ be_decl *scope = 0;
+ if (inherited->is_nested ())
+ {
+ // inherited node is used in the scope of "node" node
+ scope =
+ be_scope::narrow_from_scope (node->defined_in ())->decl ();
+ }
+
+ *os << "this->" << inherited->local_name ()<< "::setup_collocation" << " (_tao_collocated);" << be_nl;
+ }
+
+ }
+ */
+ *os << be_uidt_nl // idt = 0
+ <<"}" << be_nl;
os->gen_endif ();
}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
index 0dfafe4c232..7647598be2f 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
@@ -60,18 +60,107 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
os->indent (); // start with whatever indentation level we are at
- // Generate the destructor and default constructor.
+ be_visitor *visitor = 0;
+ be_visitor_context ctx;
+ if (!node->is_local ())
+ {
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_cs::"
+ "visit_interface - "
+ "codegen for Base Proxy Broker class failed\n"),
+ -1);
+ }
+ delete visitor;
+
+
+ visitor = 0;
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_cs::"
+ "visit_interface - "
+ "codegen for Base Proxy Broker class failed\n"),
+ -1);
+ }
+ delete visitor;
+ }
+
+ // Generate the destructor and default constructor.
*os << be_nl;
*os << "// default constructor" << be_nl;
- *os << node->name () << "::" << node->local_name ()
- << " (void)" << be_nl;
- *os << "{}" << be_nl << be_nl;
+ *os << node->name () << "::" << node->local_name ();
+ if (!node->is_local ())
+ {
+ *os << " (int collocated)" << be_nl
+ << "{" << be_idt_nl
+ << "this->setup_collocation (collocated);" << be_uidt_nl;
+ }
+ else
+ {
+ *os << " ()" << be_nl
+ << "{" << be_idt_nl;
+ }
+
+ *os << be_uidt << "}" << be_nl << be_nl;
*os << "// destructor" << be_nl;
*os << node->name () << "::~" << node->local_name ()
<< " (void)" << be_nl;
*os << "{}" << be_nl << be_nl;
+ if (!node->is_local ())
+ {
+ // Collocation setup method.
+ *os << "void" << be_nl
+ << node->name () << "::setup_collocation (int collocated)" << be_nl
+ << "{"
+ << be_idt_nl // idt = 1
+ << "if (collocated)" << be_idt_nl //idt = 2
+ << "this->the" << node->base_proxy_broker_name ()
+ << "_ =" << be_idt_nl // idt = 3
+ << node->flat_client_enclosing_scope () << node->base_proxy_broker_name ()
+ << "_Factory_function_pointer (this);"
+ << be_uidt << be_uidt_nl // idt = 1
+ << "else" << be_idt_nl // idt = 2
+ << "this->the" << node->base_proxy_broker_name ()
+ << "_ =" << be_idt_nl // idt = 3
+ << "::" << node->client_enclosing_scope () << "the" << node->remote_proxy_broker_name ()
+ << " ();" << be_uidt << be_uidt << be_nl << be_nl; // idt = 1
+
+ // Now we setup the immediate parents.
+ if (node->n_inherits () > 0)
+ {
+ for (int i = 0; i < node->n_inherits (); i++)
+ {
+ be_interface *inherited =
+ be_interface::narrow_from_decl (node->inherits ()[i]);
+ be_decl *scope = 0;
+ if (inherited->is_nested ())
+ {
+ // inherited node is used in the scope of "node" node
+ scope =
+ be_scope::narrow_from_scope (node->defined_in ())->decl ();
+ }
+
+ *os << "this->" << inherited->local_name ()<< "::setup_collocation" << " (collocated);" << be_nl;
+ }
+ }
+
+ *os << be_uidt_nl << "}" << be_nl << be_nl;
+ }
+
// Then generate the code for the static methods
// Local interfaces don't have any operators.
if (! node->is_local ())
@@ -145,18 +234,33 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
// If the policy didtates that the proxy be collocated, use the
// function to create one.
os->indent ();
- *os << "if (obj->_is_collocated () && _TAO_collocation_"
- << node->flat_name () << "_Stub_Factory_function_pointer != 0)"
- << be_idt_nl << "{"<<be_idt_nl
- << "default_proxy = _TAO_collocation_"<< node->flat_name ()
- << "_Stub_Factory_function_pointer (obj);"
- << be_uidt_nl<<"}"<<be_uidt_nl;
+ *os << "if (" << be_idt << be_idt_nl // 2 idt
+ << "!CORBA::is_nil (stub->servant_orb_var ().ptr ()) &&" << be_nl
+ << "stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects () &&"
+ << be_nl
+ << "obj->_is_collocated () &&"
+ << node->flat_client_enclosing_scope () << node->base_proxy_broker_name ()
+ << "_Factory_function_pointer != 0" << be_uidt_nl << ")" // 1 idt
+ << be_uidt_nl << "{" // 0 idt
+ << be_idt_nl // 1 idt
+ << "ACE_NEW_RETURN (" << be_idt_nl // 2 idt
+ << "default_proxy," << be_nl
+ << "::" << bt->name () << " (" << be_idt_nl // 3 idt
+ << "stub," << be_nl
+ << "1," << be_nl
+ << "obj->_servant ())," << be_nl
+ << be_uidt_nl // 2 idt
+ << bt->nested_type_name (this->ctx_->scope ())
+ << "::_nil ());"
+ << be_uidt_nl // 1 idt
+ << "}" << be_uidt_nl; // 0 idt
+
// The default proxy will either be returned else be transformed to
// a smart one!
*os << "if (CORBA::is_nil (default_proxy))" << be_idt_nl
<< "ACE_NEW_RETURN (default_proxy, ::" << bt->name ()
- << " (stub), " << bt->nested_type_name (this->ctx_->scope ())
+ << " (stub, 0, obj->_servant ()), " << bt->nested_type_name (this->ctx_->scope ())
<< "::_nil ());"<< be_uidt_nl;
if (be_global->gen_smart_proxies ())
{
@@ -260,6 +364,17 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
<< "return \"" << node->repoID () << "\";" << be_uidt_nl
<< "}\n\n";
+ os->decr_indent (0);
+
+ /*
+ *os << node->full_base_proxy_impl_name () << " &"
+ << node->full_name () << "::_proxy_impl (CORBA::Environment &ACE_TRY_ENV)" << be_nl
+ << "{" << be_idt << be_nl
+ << "return this->the" << node->base_proxy_broker_name () << "_->select_proxy (this, ACE_TRY_ENV);"
+ << be_uidt_nl
+ << "}" << be_nl << be_nl;
+ */
+
// generate code for the elements of the interface
if (this->visit_scope (node) == -1)
{
@@ -271,8 +386,8 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
// Interceptor classes
- be_visitor_context ctx (*this->ctx_);
- be_visitor *visitor = 0;
+ ctx = (*this->ctx_);
+ visitor = 0;
ctx.state (TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS);
visitor = tao_cg->make_visitor (&ctx);
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
index 6b6248d5d79..669f86cf5d7 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
@@ -27,12 +27,12 @@
ACE_RCSID(be_visitor_interface, interface_sh, "$Id$")
-// ************************************************************
-// Interface visitor for server header
-// ************************************************************
+ // ************************************************************
+ // Interface visitor for server header
+ // ************************************************************
-be_visitor_interface_sh::be_visitor_interface_sh (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
+ be_visitor_interface_sh::be_visitor_interface_sh (be_visitor_context *ctx)
+ : be_visitor_interface (ctx)
{
}
@@ -74,6 +74,20 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
// generate the _ptr declaration
*os << "typedef " << namebuf << " *" << namebuf
<< "_ptr;" << be_nl;
+
+ // Forward class declaration
+ *os << "// Forward Classes Declaration" << be_nl;
+
+ if (be_global->gen_thru_poa_collocation ())
+ *os << "class " << node->thru_poa_proxy_impl_name () << ";" << be_nl;
+ if (be_global->gen_direct_collocation ())
+ *os << "class " << node->direct_proxy_impl_name () << ";" << be_nl;
+
+ if (be_global->gen_thru_poa_collocation () ||
+ be_global->gen_direct_collocation ())
+ *os << "class " << node->strategized_proxy_broker_name () << ";" << be_nl;
+
+ *os << be_nl;
// now generate the class definition
*os << "class " << be_global->skel_export_macro ()
@@ -129,7 +143,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
<< be_uidt << be_uidt_nl
<< ");\n" << be_uidt_nl;
- // add a skeleton for our _non_existent method
+ // add a skeleton for our _non_existent method
*os << "static void _non_existent_skel (" << be_idt << be_idt_nl
<< "TAO_ServerRequest &req," << be_nl
<< "void *obj," << be_nl
@@ -139,7 +153,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
<< be_uidt << be_uidt_nl
<< ");\n" << be_uidt_nl;
- // add the dispatch method
+ // add the dispatch method
*os << "virtual void _dispatch (" << be_idt << be_idt_nl
<< "TAO_ServerRequest &_tao_req," << be_nl
<< "void *_tao_context," << be_nl
@@ -180,7 +194,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
"inheritance graph traversal failed\n"),
-1);
}
-// Generate the embedded RequestInfo classes per operation.
+ // Generate the embedded RequestInfo classes per operation.
// This is to be used by interceptors.
be_visitor_context ctx (*this->ctx_);
be_visitor *visitor = 0;
@@ -200,13 +214,34 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
visitor = 0;
*os << be_uidt_nl << "};\n\n";
+
+ if (be_global->gen_thru_poa_collocation () ||
+ be_global->gen_direct_collocation ())
+ {
+ ctx = *this->ctx_;
+ // Generate Strategized Proxy Broker
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH);
+ visitor = tao_cg->make_visitor (&ctx);
+ if (node->accept (visitor) == -1)
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_sh::"
+ "visit_interface - "
+ "codegen for thru_poa_collocated class failed\n"),
+ -1);
+ }
+ delete visitor;
+ }
ctx = *this->ctx_;
// generate the collocated class
if (be_global->gen_thru_poa_collocation ())
{
- ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH);
+ visitor = 0;
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH);
visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
+ if (visitor == 0 || node->accept (visitor) == -1)
{
delete visitor;
ACE_ERROR_RETURN ((LM_ERROR,
@@ -216,25 +251,24 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
-1);
}
delete visitor;
- visitor = 0;
}
-
+ ctx = *this->ctx_;
if (be_global->gen_direct_collocation ())
{
+ visitor = 0;
ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH);
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH);
visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
+ if (visitor == 0 || node->accept (visitor) == -1)
{
delete visitor;
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_interface_sh::"
"visit_interface - "
- "codegen for direct_collocated class failed\n"),
+ "codegen for thru_poa_collocated class failed\n"),
-1);
}
delete visitor;
- visitor = 0;
}
if (be_global->gen_tie_classes ())
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
index e5c5dd04d87..93bcd99f225 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
@@ -63,86 +63,106 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
-1);
}
- // Collocation factory function pointer initializer.
- *os << node->full_name () << "_ptr _TAO_collocation_POA_"
- << node->flat_name () << "_Stub_Factory (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj" << be_uidt_nl
- << ")" << be_uidt_nl;
+ // Strategized Proxy Broker Implementation
+ be_visitor *visitor = 0;
+ be_visitor_context ctx;
- *os << "{" << be_idt_nl
- << "TAO_Stub *stub = obj->_stubobj ();" << be_nl << be_nl
- << "switch (stub->servant_orb_var ()->orb_core"
- << " ()->get_collocation_strategy ())" << be_idt_nl
- << "{" << be_nl << "case TAO_ORB_Core::THRU_POA:" << be_idt_nl;
+ if (be_global->gen_thru_poa_collocation () ||
+ be_global->gen_direct_collocation ())
+ {
+ ctx = (*this->ctx_);
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_cs::"
+ "visit_interface - "
+ "codegen for Base Proxy Broker class failed\n"),
+ -1);
+ }
+ delete visitor;
+
+ // Proxy Broker Factory Function.
+ *os << be_nl
+ << node->full_base_proxy_broker_name () << " *" << be_nl
+ << node->flat_client_enclosing_scope () << node->base_proxy_broker_name ()
+ << "_Factory_function (CORBA::Object_ptr obj)" << be_nl
+ << "{" << be_idt_nl // idt = 1
+ << "ACE_UNUSED_ARG (obj);" << be_nl
+ << "return "
+ << node->server_enclosing_scope () << "the"
+ << node->strategized_proxy_broker_name ()
+ << "();" << be_uidt_nl // idt = 0
+ << "}" << be_nl << be_nl;
+
+ // Proxy Broker Function Pointer Initializer.
+ *os << "int" << be_nl
+ << node->flat_client_enclosing_scope () << node->base_proxy_broker_name ()
+ << "_Factory_Initializer (long _dummy_)" << be_nl
+ << "{" << be_idt_nl // idt = 1
+ << "ACE_UNUSED_ARG (_dummy_);" << be_nl << be_nl
+ << node->flat_client_enclosing_scope () << node->base_proxy_broker_name ()
+ << "_Factory_function_pointer = "
+ << be_idt_nl // idt = 2
+ << node->flat_client_enclosing_scope () << node->base_proxy_broker_name ()
+ << "_Factory_function;"
+ << be_uidt_nl // idt = 1
+ << be_nl
+ << "return 0;" << be_uidt_nl // idt = 0
+ << "}" << be_nl << be_nl;
+
+
+ *os << "static int " << node->flat_client_enclosing_scope ()
+ << node->base_proxy_broker_name ()
+ << "_Stub_Factory_Initializer_Scarecrow = " << be_idt_nl
+ << node->flat_client_enclosing_scope () << node->base_proxy_broker_name ()
+ << "_Factory_Initializer (ACE_reinterpret_cast (long, "
+ << node->flat_client_enclosing_scope () << node->base_proxy_broker_name ()
+ << "_Factory_Initializer));"
+ << be_uidt_nl << be_nl;
+ }
+
+ // Proxy Impl Implementations.
if (be_global->gen_thru_poa_collocation ())
- *os << "{" << be_nl
- << node->full_name () << "_ptr retval = 0;" << be_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "retval," << be_nl
- << node->full_coll_name (be_interface::THRU_POA)
- << " (stub)," << be_nl
- << "0" << be_uidt_nl
- << ");" << be_uidt_nl
- << "return retval;" << be_nl
- << "}" << be_uidt_nl;
- else
- *os << "break;" << be_uidt_nl;
-
- *os << "case TAO_ORB_Core::DIRECT:" << be_idt_nl;
-
+ {
+ visitor = 0;
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_cs::"
+ "visit_interface - "
+ "codegen for Base Proxy Broker class failed\n"),
+ -1);
+ }
+ delete visitor;
+ }
if (be_global->gen_direct_collocation ())
- *os << "if (obj->_is_local () != 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "TAO_Collocated_Object *local_object =" << be_nl
- << " TAO_Collocated_Object::_narrow (obj);" << be_nl
- << "if (local_object == 0)" << be_nl
- << " return 0;" << be_nl
- << node->full_skel_name () << " *servant =" << be_idt_nl
- << "ACE_reinterpret_cast (" << be_idt_nl
- << node->full_skel_name () << "*," << be_nl
- << "local_object->_servant ()->_downcast (\""
- << node->repoID () << "\")" << be_uidt_nl
- << ");" << be_uidt_nl
- << "local_object->_remove_ref ();" << be_nl
- << "if (servant != 0)" << be_idt_nl
- << "{" << be_idt_nl
- << node->full_name () << " *retval = 0;" << be_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "retval," << be_nl
- << node->full_coll_name (be_interface::DIRECT)
- << " (servant, stub)," << be_nl
- << "0" << be_uidt_nl
- << ");" << be_uidt_nl
- << "return retval;" << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl
- << "}" << be_uidt_nl;
-
- *os << "break;" << be_uidt_nl
- << "default:" << be_idt_nl
- << "break;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "return 0;" << be_uidt_nl
- << "}\n\n";
-
- *os << "int _TAO_collocation_POA_" << node->flat_name ()
- << "_Stub_Factory_Initializer"
- << " (long dummy)" << be_nl
- << "{" << be_idt_nl
- << "ACE_UNUSED_ARG (dummy);" << be_nl << be_nl
- << "_TAO_collocation_" << node->flat_name ()
- << "_Stub_Factory_function_pointer = " << be_idt_nl
- << "_TAO_collocation_POA_" << node->flat_name ()
- << "_Stub_Factory;" << be_uidt_nl << be_nl
- << "return 0;" << be_uidt_nl << "}" << be_nl << be_nl;
-
- *os << "static int _TAO_collocation_POA_" << node->flat_name ()
- << "_Stub_Factory_Initializer_Scarecrow = " << be_idt_nl
- << "_TAO_collocation_POA_" << node->flat_name ()
- << "_Stub_Factory_Initializer ("
- << "ACE_reinterpret_cast (long, _TAO_collocation_POA_"
- << node->flat_name () << "_Stub_Factory_Initializer));"
- << be_uidt_nl << be_nl;
+ {
+ visitor = 0;
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_cs::"
+ "visit_interface - "
+ "codegen for Base Proxy Broker class failed\n"),
+ -1);
+ }
+ delete visitor;
+ }
// constructor
*os << "// skeleton constructor" << be_nl;
@@ -360,62 +380,31 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
*os << node->full_name () << "*" << be_nl
<< node->full_skel_name ()
<< "::_this (CORBA_Environment &ACE_TRY_ENV)" << be_nl
- << "{" << be_idt_nl
+ << "{" << be_idt_nl // idt = 1
<< "TAO_Stub *stub = this->_create_stub (ACE_TRY_ENV);" << be_nl
- << "ACE_CHECK_RETURN (0);" << be_nl;
-
- *os << "if (stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ())" << be_idt_nl
- << "switch (stub->servant_orb_var ()->orb_core ()->get_collocation_strategy ())" << be_idt_nl
- << "{" << be_nl
- << "case TAO_ORB_Core::THRU_POA:" << be_idt_nl;
-
- // Thru POA stub
- if (be_global->gen_thru_poa_collocation ())
- *os << "{" << be_idt_nl
- << "::" << node->full_name () << "_ptr retval = 0;" << be_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "retval," << be_nl
- << node->full_coll_name (be_interface::THRU_POA) << " (stub)," << be_nl
- << "0" << be_uidt_nl
- << ");" << be_uidt_nl
- << "return retval;" << be_uidt_nl
- << "}" << be_uidt_nl;
- else
- *os << "ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);" << be_uidt_nl;
-
- // Direct stub
- *os << "case TAO_ORB_Core::DIRECT:" << be_idt_nl;
- if (be_global->gen_direct_collocation ())
- *os << "{" << be_idt_nl
- << "::" << node->full_name () << "_ptr retval = 0;" << be_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "retval," << be_nl
- << node->full_coll_name (be_interface::DIRECT) << " (this, stub)," << be_nl
- << "0" << be_uidt_nl
- << ");" << be_uidt_nl
- << "return retval;" << be_uidt_nl
- << "}" << be_uidt_nl;
- else
- *os << "ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);" << be_uidt_nl;
-
- *os << "default:" << be_idt_nl
- << "ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);" << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "// stub->_incr_refcnt ();" << be_nl
- << "CORBA::Object_ptr tmp = CORBA::Object::_nil ();" << be_nl
- << "ACE_NEW_RETURN (tmp, CORBA::Object (stub), 0);" << be_nl
+ << "ACE_CHECK_RETURN (0);" << be_nl << be_nl;
+
+ *os << "CORBA::Object_ptr tmp = CORBA::Object::_nil ();" << be_nl
+ << be_nl
+ << "if (stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ())"
+ << be_idt_nl // idt = 2
+ << "ACE_NEW_RETURN (tmp, CORBA::Object (stub, 1, this), 0);"
+ << be_uidt_nl // idt = 1
+ << "else"
+ << be_idt_nl // idt = 2
+ << "ACE_NEW_RETURN (tmp, CORBA::Object (stub, 0, this), 0);"
+ << be_uidt_nl << be_nl // idt = 1
<< "CORBA::Object_var obj = tmp;" << be_nl
- << "return " << "::" << node->full_name ()
- << "::_unchecked_narrow (obj.in ());" << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl
- << "}\n\n";
-
+ << "return " << "::" << node->full_name () << "::_unchecked_narrow (obj.in ());"
+ << be_uidt_nl // idt = 0
+ << "}" << be_nl;
+
// the _create_collocated_objref method. If the idl compiler does
// not generate the type of collocated stub but the orb is asking
// for it, simply return null so a remote stub will be used.
// generate the collocated class impl
+
+ /*
if (be_global->gen_thru_poa_collocation ())
{
be_visitor_context ctx (*this->ctx_);
@@ -440,7 +429,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
}
delete visitor;
}
-
+
if (be_global->gen_direct_collocation ())
{
be_visitor_context ctx (*this->ctx_);
@@ -465,13 +454,13 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
}
delete visitor;
}
-
+ */
*os << "\n\n";
// Interceptor classes
- be_visitor_context ctx (*this->ctx_);
- be_visitor *visitor = 0;
+ ctx = *this->ctx_;
+ visitor = 0;
ctx.state (TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS);
visitor = tao_cg->make_visitor (&ctx);
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp
new file mode 100644
index 00000000000..7cd93dadf21
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp
@@ -0,0 +1,72 @@
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_interface.h"
+
+ACE_RCSID (be_visitor_interface, proxy_brokers_ch, "$Id$")
+
+ be_visitor_interface_proxy_brokers_ch::be_visitor_interface_proxy_brokers_ch (be_visitor_context *ctx)
+ : be_visitor_interface (ctx)
+{
+ // No-Op.
+}
+
+
+be_visitor_interface_proxy_brokers_ch::~be_visitor_interface_proxy_brokers_ch (void)
+{
+ // No-Op.
+}
+
+int
+be_visitor_interface_proxy_brokers_ch::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+
+ // Generate Guards.
+ // os->gen_ifdef_macro (node->local_name (), "PROXY_BROKERS");
+
+ // Generate the class declaration.
+ os->indent ();
+ *os << "\n// The Proxy Brokers are used by each interface to get\n"
+ << "// the right proxy for performing a call. In the new \n"
+ << "// collocation scheme, the proxy to be used can vary on\n"
+ << "// a call by call basis. \n\n\n";
+
+ // Code Generation for the proxy brokers base class.
+ be_visitor *visitor = 0;
+ be_visitor_context ctx (*this->ctx_);
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_ch::"
+ "visit_interface - "
+ "codegen for Base Proxy Broker class failed\n"),
+ -1);
+ }
+ delete visitor;
+
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_ch::"
+ "visit_interface - "
+ "codegen for Remote Proxy Broker class failed\n"),
+ -1);
+ }
+ delete visitor;
+
+ // Close #ifdef Guard.
+ // os->gen_endif ();
+
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp
new file mode 100644
index 00000000000..125340e615f
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp
@@ -0,0 +1,69 @@
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_interface.h"
+
+ACE_RCSID (be_visitor_interface, base_proxy_broker_impl_ch, "$Id$")
+
+be_visitor_interface_proxy_impls_ch::be_visitor_interface_proxy_impls_ch (be_visitor_context *ctx)
+ : be_visitor_interface (ctx)
+{
+ // No-Op.
+}
+
+
+be_visitor_interface_proxy_impls_ch::~be_visitor_interface_proxy_impls_ch (void)
+{
+ // No-Op.
+}
+
+int
+be_visitor_interface_proxy_impls_ch::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+ os->indent ();
+ // Generate Guards.
+ // os->gen_ifdef_macro (node->local_name (), "PROXY_IMPLS");
+
+ *os << "\n// The Proxy Implementations are used by each interface to\n"
+ << "// perform a call. Each different implementation encapsulate\n"
+ << "// an invocation logics.\n\n";
+
+ // Code Generation for the proxy imlpementations base class.
+ be_visitor *visitor = 0;
+ be_visitor_context ctx (*this->ctx_);
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_ch::"
+ "visit_interface - "
+ "codegen for Base Proxy Impl. class failed\n"),
+ -1);
+ }
+ delete visitor;
+
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_ch::"
+ "visit_interface - "
+ "codegen for Remote Proxy Broker class failed\n"),
+ -1);
+ }
+ delete visitor;
+
+ // Close #ifdef Guard.
+ // os->gen_endif ();
+
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp
new file mode 100644
index 00000000000..21ce175a72e
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp
@@ -0,0 +1,72 @@
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_interface.h"
+
+ACE_RCSID (be_visitor_interface, be_visitor_interface_remote_proxy_broker_ch, "$Id$")
+
+be_visitor_interface_remote_proxy_broker_ch::be_visitor_interface_remote_proxy_broker_ch (be_visitor_context *ctx)
+ : be_visitor_interface (ctx)
+{
+ // No-Op.
+}
+
+
+be_visitor_interface_remote_proxy_broker_ch::~be_visitor_interface_remote_proxy_broker_ch (void)
+{
+ // No-Op.
+}
+
+int
+be_visitor_interface_remote_proxy_broker_ch::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+
+ // Generate the class declaration.
+ os->indent ();
+
+ *os << be_nl
+ << "///////////////////////////////////////////////////////////////////////" << be_nl
+ << "// Remote Proxy Broker Declaration " << be_nl
+ << "//" << be_nl << be_nl;
+
+ *os << "class " << be_global->stub_export_macro () << " "
+ << node->remote_proxy_broker_name () << " : public virtual "
+ << node->base_proxy_broker_name () << be_nl << "{" << be_nl
+ << "public: " << be_idt_nl;
+
+ // Destructor
+ *os << "virtual ~" << node->remote_proxy_broker_name () << " (void);\n" << be_nl;
+
+ // Accessor Method
+ *os << "virtual " << node->base_proxy_impl_name () << " &" << "select_proxy (" << be_idt_nl;
+
+ *os << node->local_name () << " *object," << be_nl
+ << "CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()" << be_uidt_nl
+ << ");" << be_uidt_nl << be_nl;
+
+ *os << "private:" << be_idt_nl
+ << node->remote_proxy_impl_name () << " remote_proxy_impl_;"
+ << be_uidt_nl;
+
+ *os << "};" << be_nl << be_nl;
+
+ // Factory Function declaration.
+ *os << "// This funxtion is used to get an handle to the unique instance" << be_nl
+ << "// of the Remote Proxy Broker that is available for a given" << be_nl
+ << "// interface."
+ << be_nl << be_nl;
+
+ *os << node->remote_proxy_broker_name () << " *the"
+ << node->remote_proxy_broker_name ()
+ << " (void);" << be_nl;
+
+ *os << be_nl
+ << "//" << be_nl
+ << "// End Remote Proxy Broker Declaration " << be_nl
+ << "///////////////////////////////////////////////////////////////////////"
+ << be_nl << be_nl;
+
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp
new file mode 100644
index 00000000000..0f7d8f87d77
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp
@@ -0,0 +1,88 @@
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_interface.h"
+
+ACE_RCSID (be_visitor_interface, remote_proxy_broker_impl_ch, "$Id$")
+
+be_visitor_interface_remote_proxy_impl_ch::be_visitor_interface_remote_proxy_impl_ch (be_visitor_context *ctx)
+ : be_visitor_interface (ctx)
+{
+ // No-Op.
+}
+
+
+be_visitor_interface_remote_proxy_impl_ch::~be_visitor_interface_remote_proxy_impl_ch (void)
+{
+ // No-Op.
+}
+
+int
+be_visitor_interface_remote_proxy_impl_ch::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+
+ os->decr_indent (0);
+
+ *os << be_nl
+ << "///////////////////////////////////////////////////////////////////////" << be_nl
+ << "// Remote Impl. Declaration" << be_nl
+ << "//" << be_nl << be_nl;
+ // Generate Class Declaration.
+ *os << "class " << be_global->stub_export_macro ()
+ << " " << node->remote_proxy_impl_name ();
+ *os << " : " << be_idt_nl << "public virtual " << node->base_proxy_impl_name ()
+ << "," << be_nl << "public virtual " << "TAO_Remote_Object_Proxy_Impl";
+
+ if (node->n_inherits () > 0)
+ {
+ *os << "," << be_nl;
+ for (int i = 0; i < node->n_inherits (); i++)
+ {
+ be_interface *inherited =
+ be_interface::narrow_from_decl (node->inherits ()[i]);
+ be_decl *scope = 0;
+ if (inherited->is_nested ())
+ {
+ // inherited node is used in the scope of "node" node
+ scope =
+ be_scope::narrow_from_scope (node->defined_in ())->decl ();
+ }
+
+ *os << "public virtual ";
+ *os << inherited->full_remote_proxy_impl_name ();
+ if (i < node->n_inherits () - 1) // node is the case of multiple
+ // inheritance, so put a comma
+ {
+ *os << ", ";
+ }
+ *os << be_nl;
+ } // end of for loop
+ }
+
+ *os << be_uidt_nl;
+ *os << "{" << be_nl << "public:" << be_idt_nl;
+
+ // Destructor Declaration.
+ *os << "virtual ~" << node->remote_proxy_impl_name () << " (void);"
+ << be_nl << be_nl;
+
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interface_ch::"
+ "visit_interface - "
+ "codegen for scope failed\n"), -1);
+ }
+
+ *os << "};" << be_uidt << be_nl;
+ *os << be_nl
+ << "//" << be_nl
+ << "// Base Proxy Impl. Declaration" << be_nl
+ << "///////////////////////////////////////////////////////////////////////"
+ << be_nl << be_nl;
+
+ return 0;
+
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp
new file mode 100644
index 00000000000..9d63e3d629d
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp
@@ -0,0 +1,95 @@
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_interface.h"
+
+ACE_RCSID (be_visitor_interface, base_proxy_broker_sh, "$Id$")
+
+be_visitor_interface_strategized_proxy_broker_sh::be_visitor_interface_strategized_proxy_broker_sh (be_visitor_context *ctx)
+ : be_visitor_interface (ctx)
+{
+ // No-Op.
+}
+
+
+be_visitor_interface_strategized_proxy_broker_sh::~be_visitor_interface_strategized_proxy_broker_sh (void)
+{
+ // No-Op.
+}
+
+int
+be_visitor_interface_strategized_proxy_broker_sh::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+
+
+ // os->gen_ifdef_macro (node->local_name (), "STRATEGIZED_PROXY_BROKER_");
+ // Generate the class declaration.
+ os->indent ();
+
+ *os << be_nl
+ << "///////////////////////////////////////////////////////////////////////" << be_nl
+ << "// Strategized Proxy Broker Declaration " << be_nl
+ << "//" << be_nl << be_nl;
+
+ *os << "class " << be_global->skel_export_macro () << " "
+ << node->strategized_proxy_broker_name () << " : public virtual "
+ << "::" << node->full_base_proxy_broker_name () << be_nl << "{" << be_nl
+ << "public: " << be_idt_nl;
+
+ // Constructor
+ *os << node->strategized_proxy_broker_name () << " (void);\n" << be_nl;
+
+ // Destructor
+ *os << "virtual ~" << node->strategized_proxy_broker_name () << " (void);\n" << be_nl;
+
+ // Accessor Method
+ *os << "virtual " << "::" << node->full_base_proxy_impl_name () << " &" << "select_proxy (" << be_idt_nl;
+
+ *os << "::" << node->full_name () << " *object," << be_nl
+ << "CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()" << be_uidt_nl
+ << ");" << be_uidt_nl << be_nl;
+
+
+ *os << "private:" << be_nl << be_nl
+ << "// Helper methods that takes care to create the proxy" << be_nl
+ << "// as soon as their use is necessary."
+ << be_idt_nl
+ << "void create_proxy (" << be_idt_nl << "TAO_ORB_Core::TAO_Collocation_Strategies strategy,"
+ << be_nl << "CORBA::Environment &ACE_TRY_ENV"
+ << be_uidt_nl << ");"
+ << be_uidt_nl << be_nl
+ << "private:" << be_idt_nl << be_nl
+ << "// Caches the proxy implementations. The proxy implementation" << be_nl
+ << "// are totally stateless, and those can be shared by all the" << be_nl
+ << "// instances of a given IDL interface type." << be_nl
+ << "::" << node->full_base_proxy_impl_name () << be_nl
+ <<" *proxy_cache_[TAO_ORB_Core::COLLOCATION_STRATEGIES_NUM];"
+ << be_nl << be_nl
+ << "ACE_SYNCH_MUTEX mutex_;"
+ << be_uidt_nl;
+
+ *os << "};" << be_nl << be_nl;
+
+ // Factory Function declaration.
+ *os << "// This funxtion is used to get an handle to the unique instance" << be_nl
+ << "// of the Strategized Proxy Broker that is available for a given" << be_nl
+ << "// interface."
+ << be_nl << be_nl;
+
+ *os << node->strategized_proxy_broker_name () << " *the" << node->strategized_proxy_broker_name ()
+ << " (void);" << be_nl;
+
+
+ *os << be_nl
+ << "//" << be_nl
+ << "// End Strategized Proxy Broker Declaration " << be_nl
+ << "///////////////////////////////////////////////////////////////////////"
+ << be_nl << be_nl;
+
+ // Close #ifdef Guard.
+ // os->gen_endif ();
+
+ 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
new file mode 100644
index 00000000000..d8ca01c6c4a
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp
@@ -0,0 +1,86 @@
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_interface.h"
+
+ACE_RCSID (be_visitor_interface, thru_poa_proxy_broker_impl_sh, "$Id$")
+
+be_visitor_interface_thru_poa_proxy_impl_sh::be_visitor_interface_thru_poa_proxy_impl_sh (be_visitor_context *ctx)
+ : be_visitor_interface (ctx)
+{
+ // No-Op.
+}
+
+
+be_visitor_interface_thru_poa_proxy_impl_sh::~be_visitor_interface_thru_poa_proxy_impl_sh (void)
+{
+ // No-Op.
+}
+
+int
+be_visitor_interface_thru_poa_proxy_impl_sh::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+
+ // os->gen_ifdef_macro (node->flat_name (), "THRU_POA_PROXY_IMPL_");
+ os->decr_indent (0);
+ *os << be_nl
+ << "///////////////////////////////////////////////////////////////////////" << be_nl
+ << "// ThruPOA Impl. Declaration" << be_nl
+ << "//" << be_nl << be_nl;
+ // Generate Class Declaration.
+ *os << "class " << be_global->skel_export_macro ()
+ << " " << node->thru_poa_proxy_impl_name ();
+ *os << " : " << be_idt_nl << "public virtual " << "::" << node->full_base_proxy_impl_name ()
+ << "," << be_nl << "public virtual " << "TAO_ThruPOA_Object_Proxy_Impl";
+
+ if (node->n_inherits () > 0)
+ {
+ *os << "," << be_nl;
+ for (int i = 0; i < node->n_inherits (); i++)
+ {
+ be_interface *inherited =
+ be_interface::narrow_from_decl (node->inherits ()[i]);
+ be_decl *scope = 0;
+ if (inherited->is_nested ())
+ {
+ // inherited node is used in the scope of "node" node
+ scope =
+ be_scope::narrow_from_scope (node->defined_in ())->decl ();
+ }
+
+ *os << "public virtual ";
+ *os << "::" << inherited->full_thru_poa_proxy_impl_name ();
+ if (i < node->n_inherits () - 1) // node is the case of multiple
+ // inheritance, so put a comma
+ {
+ *os << ", ";
+ }
+ *os << be_nl;
+ } // end of for loop
+ }
+
+ *os << be_uidt_nl;
+ *os << "{" << be_nl << "public:" << be_idt_nl;
+
+ // Dtor
+ *os << "~" << node->thru_poa_proxy_impl_name () << " (void);" << be_nl << be_nl;
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) thru_poa_proxy_impl_sh::"
+ "visit_interface - "
+ "codegen for scope failed\n"), -1);
+ }
+
+ *os << "};" << be_uidt << be_nl << be_nl;
+ *os << be_nl
+ << "//" << be_nl
+ << "// ThruPOA Proxy Impl. Declaration" << be_nl
+ << "///////////////////////////////////////////////////////////////////////"
+ << be_nl << be_nl;
+ // os->gen_endif ();
+ return 0;
+
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp
index 7fc7da14af3..2be649d4cf4 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp
@@ -55,13 +55,20 @@ be_visitor_interface_fwd_ci::visit_interface_fwd (be_interface_fwd *node)
if (! node->is_local ())
{
os->gen_ifdef_macro (node->flat_name (), "");
+
*os << "ACE_INLINE" << be_nl;
*os << node->name () << "::" << node->local_name () <<
- " (TAO_Stub *objref, "
- << "CORBA::Boolean _tao_collocated) // constructor" << be_nl;
- *os << " : CORBA_Object (objref, _tao_collocated)"
- << be_nl;
- *os << "{}" << be_nl;
+ " (" << be_idt_nl << "TAO_Stub *objref," << be_nl
+ << "CORBA::Boolean _tao_collocated," << be_nl
+ << "TAO_Abstract_ServantBase *servant" << be_nl
+ << ")" // constructor
+ << be_nl;
+ *os << " : CORBA_Object (objref, _tao_collocated, servant)" << be_nl;
+ *os << "{" << be_idt_nl
+ << be_idt_nl // idt = 1
+ << "this->setup_collocation (_tao_collocated);" << be_uidt_nl;
+ *os << "}" << be_nl << be_nl;
+
os->gen_endif ();
}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp
index 550874d4c86..652ab9c141e 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp
@@ -68,5 +68,11 @@
#include "be_visitor_operation/interceptors_exceptlist.cpp"
#include "be_visitor_operation/interceptors_info_rettype.cpp"
#include "be_visitor_operation/interceptors_result.cpp"
+#include "be_visitor_operation/base_proxy_impl_ch.cpp"
+#include "be_visitor_operation/proxy_impl_xh.cpp"
+#include "be_visitor_operation/inv_arglist.cpp"
+#include "be_visitor_operation/remote_proxy_impl_cs.cpp"
+#include "be_visitor_operation/thru_poa_proxy_impl_ss.cpp"
+#include "be_visitor_operation/direct_proxy_impl_ss.cpp"
ACE_RCSID(be, be_visitor_operation, "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
index 043389e8cdc..4c1eb7566e7 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
@@ -50,6 +50,22 @@ be_visitor_operation_arglist::visit_operation (be_operation *node)
*os << " (" << be_idt << be_idt_nl;
+ switch (this->ctx_->state ())
+ {
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS:
+
+ os->indent ();
+ *os << "CORBA_Object *_collocated_tao_target_ " << be_nl;
+ if (node->argument_count () > 0 || !be_global->exception_support () )
+ *os << ",\n";
+ break;
+
+ default:
+ break;
+ }
+
// all we do is hand over code generation to our scope
if (this->visit_scope (node) == -1)
{
@@ -81,6 +97,8 @@ be_visitor_operation_arglist::visit_operation (be_operation *node)
break;
case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH:
// last argument - is always CORBA::Environment
*os << "CORBA::Environment &ACE_TRY_ENV";
break;
@@ -111,11 +129,17 @@ be_visitor_operation_arglist::visit_operation (be_operation *node)
else
*os << ";\n\n";
break;
+
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH:
+ *os << ";\n\n";
+ break;
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
// each method is pure virtual in the server header
*os << " = 0;\n\n";
break;
case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS:
default:
*os << "\n";
}
@@ -171,6 +195,9 @@ be_visitor_operation_arglist::visit_argument (be_argument *node)
case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH:
ctx.state (TAO_CodeGen::TAO_ARGUMENT_ARGLIST_OTHERS);
break;
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp
new file mode 100644
index 00000000000..a2cc2e08023
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp
@@ -0,0 +1,99 @@
+// $Id$
+
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_operation.h"
+
+ACE_RCSID(be_visitor_operation, x_proxy_impl_xh, "$Id$")
+
+
+be_visitor_operation_base_proxy_impl_ch::be_visitor_operation_base_proxy_impl_ch (be_visitor_context *ctx)
+ : be_visitor_scope (ctx)
+{
+}
+
+be_visitor_operation_base_proxy_impl_ch::~be_visitor_operation_base_proxy_impl_ch (void)
+{
+}
+
+int be_visitor_operation_base_proxy_impl_ch::visit_operation (be_operation *node)
+{
+ TAO_OutStream *os; // output stream
+ be_type *bt; // type node representing the return type
+
+ os = this->ctx_->stream ();
+ this->ctx_->node (node); // save the node
+
+ os->indent (); // start with the current indentation level
+
+ // every operation is declared virtual in the client code
+ *os << "virtual ";
+
+ // STEP I: generate the return type
+ bt = be_type::narrow_from_decl (node->return_type ());
+ if (!bt)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_operation_sh::"
+ "visit_operation - "
+ "Bad return type\n"),
+ -1);
+ }
+
+ // grab the right visitor to generate the return type
+ be_visitor_context ctx (*this->ctx_);
+ ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
+ be_visitor *visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_operation_sh::"
+ "visit_operation - "
+ "Bad visitor to return type\n"),
+ -1);
+ }
+
+ if (bt->accept (visitor) == -1)
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_operation_sh::"
+ "visit_operation - "
+ "codegen for return type failed\n"),
+ -1);
+ }
+ delete visitor;
+
+ // STEP 2: generate the operation name
+ *os << " " << node->local_name ();
+
+ // STEP 3: generate the argument list with the appropriate mapping. For these
+ // we grab a visitor that generates the parameter listing
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH);
+ visitor = tao_cg->make_visitor (&ctx);
+ if (!visitor)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_operation_sh::"
+ "visit_operation - "
+ "Bad visitor to return type\n"),
+ -1);
+ }
+
+ if (node->accept (visitor) == -1)
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_operation_sh::"
+ "visit_operation - "
+ "codegen for argument list failed\n"),
+ -1);
+ }
+ delete visitor;
+
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp
index a3616be4db9..70b3a8954bd 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp
@@ -104,6 +104,14 @@ be_visitor_operation_interceptors_ch::visit_operation (be_operation *node)
*os << parent->full_name () << ";" << be_nl << be_nl;
+ // The Proxy Implementation actually perform calls to
+ // the ClientRequestInfo class, so these class need
+ // to be friend as well.
+ be_interface *iface = be_interface::narrow_from_scope (node->defined_in ());
+ *os << "friend class " << iface->remote_proxy_impl_name () << ";" << be_nl
+ << "friend class " << iface->thru_poa_proxy_impl_name () << ";" << be_nl
+ << "friend class " << iface->direct_proxy_impl_name () << ";" << be_uidt_nl << be_nl;
+
*os << "TAO_ClientRequestInfo_" << node->flat_name ();
// We need the interface node in which this operation was defined. However,
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/inv_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/inv_arglist.cpp
new file mode 100644
index 00000000000..5ce6a0f2ec7
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_operation/inv_arglist.cpp
@@ -0,0 +1,103 @@
+// $Id$
+
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_operation.h"
+
+ACE_RCSID(be_visitor_operation, inv_arglist, "$Id$")
+
+
+be_visitor_operation_inv_arglist::
+be_visitor_operation_inv_arglist (be_visitor_context *ctx)
+ : be_visitor_operation (ctx)
+{
+}
+
+be_visitor_operation_inv_arglist::~be_visitor_operation_inv_arglist (void)
+{
+}
+
+int
+be_visitor_operation_inv_arglist::visit_operation (be_operation *node)
+{
+ // all we do is hand over code generation to our scope
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_operation_inv_arglist::"
+ "visit_operation - "
+ "codegen for scope failed\n"),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+be_visitor_operation_inv_arglist::visit_argument (be_argument *node)
+{
+ // get the visitor that will dump the argument's mapping in the operation
+ // signature.
+ be_visitor_context ctx (*this->ctx_);
+
+ // first grab the interface definition inside which this operation is
+ // defined. We need this since argument types may very well be declared
+ // inside the scope of the interface node. In such cases, we would like to
+ // generate the appropriate relative scoped names.
+ be_operation *op = this->ctx_->be_scope_as_operation ();
+ if (!op)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_inv_arglist::"
+ "visit_argument - "
+ "Bad operation\n"),
+ -1);
+ }
+
+ // We need the interface node in which this operation was defined. However,
+ // if this operation node was an attribute node in disguise, we get this
+ // information from the context
+ be_interface *intf;
+ intf = this->ctx_->attribute ()
+ ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
+ : be_interface::narrow_from_scope (op->defined_in ());
+
+ if (!intf)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_inv_arglist::"
+ "visit_argument - "
+ "Bad interface\n"),
+ -1);
+ }
+ ctx.scope (intf); // set new scope
+
+ ctx.state (TAO_CodeGen::TAO_ARGUMENT_INVOKE_ARG_LIST);
+
+ // grab a visitor
+ be_visitor *visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_inv_arglist::"
+ "visit_argument - "
+ "Bad visitor\n"),
+ -1);
+ }
+ if (node->accept (visitor) == -1)
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_inv_arglist::"
+ "visit_argument - "
+ "codegen for inv_arglist failed\n"),
+ -1);
+ }
+ delete visitor;
+ return 0;
+}
+
+
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
index 2ff451a6357..f1935e8e7ff 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
@@ -14,7 +14,7 @@
// Visitor generating code for Operation in the stubs file.
//
// = AUTHOR
-// Aniruddha Gokhale
+// Aniruddha Gokhale & Angelo Corsaro
//
// ============================================================================
@@ -32,14 +32,14 @@ ACE_RCSID(be_visitor_operation, operation_cs, "$Id$")
// ************************************************************
be_visitor_operation_cs::be_visitor_operation_cs (be_visitor_context *ctx)
- : be_visitor_operation (ctx),
- operation_name_ (0)
+ : be_visitor_operation (ctx)
+ // operation_name_ (0)
{
}
be_visitor_operation_cs::~be_visitor_operation_cs (void)
{
- delete[] operation_name_;
+ // delete[] operation_name_;
}
// processing to be done after every element in the scope is processed
@@ -56,6 +56,20 @@ be_visitor_operation_cs::post_process (be_decl *bd)
int
be_visitor_operation_cs::visit_operation (be_operation *node)
{
+ be_interface *intf;
+ intf = this->ctx_->attribute ()
+ ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
+ : be_interface::narrow_from_scope (node->defined_in ());
+
+ if (!intf)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_operation_thru_poa_collocated_ss::"
+ "visit_operation - "
+ "bad interface scope\n"),
+ -1);
+ }
+
TAO_OutStream *os; // output stream
be_type *bt; // type node
be_visitor_context ctx; // visitor context
@@ -115,143 +129,55 @@ be_visitor_operation_cs::visit_operation (be_operation *node)
}
delete visitor;
- // Generate the actual code for the stub. However, if any of the argument
- // types is "native", we flag a MARSHAL exception.
- // last argument - is always CORBA::Environment
*os << "{" << be_idt_nl;
-
- // Deal with differences between IDL mapping for true C++ exceptions and
- // alternate mapping. Since our code uses the ACE_TRY_ENV variable in a
- // number of places, for the true exception case, we will have to explicitly
- // declare the ACE_TRY_ENV variable.
- *os << this->gen_environment_var () << "\n";
-
- // Generate any pre stub info if and only if none of our parameters is of the
- // native type.
- if (!node->has_native ())
- {
- // native type does not exist.
-
- // Generate any "pre" stub information such as tables or declarations
- // This is a template method and the actual work will be done by the
- // derived class
- if (this->gen_pre_stub_info (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "gen_pre_stub_info failed\n"),
- -1);
- }
- }
-
- // Declare return type.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for return var decl failed\n"),
- -1);
- }
-
- if (node->has_native ()) // native exists => no stub
- {
- if (this->gen_raise_exception (bt, "CORBA::MARSHAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for return var failed\n"),
- -1);
- }
- }
- else
- {
- // Generate code that retrieves the underlying stub object and then
- // invokes do_static_call on it.
- *os << be_nl
- << "TAO_Stub *istub = this->_stubobj ();" << be_nl
- << "if (istub == 0)" << be_idt_nl;
-
- // if the stub object was bad, then we raise a system exception
- if (this->gen_raise_exception (bt, "CORBA::INTERNAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
- *os << be_uidt_nl << "\n";
-
- // do any pre marshal and invoke processing with return type. This
- // includes allocating memory, initialization.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for retval pre invoke failed\n"),
- -1);
- }
-
- // do any pre marshal and invoke stuff with arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for argument pre invoke failed\n"),
- -1);
- }
-
- // generate the code for marshaling in the parameters and transmitting
- // them
- if (this->gen_marshal_and_invoke (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for marshal and invoke failed\n"),
- -1);
-
- }
-
- if (!this->void_return_type (bt))
- {
- // now generate the normal successful return statement
- os->indent ();
- if (bt->size_type () == be_decl::VARIABLE
- || bt->base_node_type () == AST_Decl::NT_array)
- {
- *os << "return _tao_safe_retval._retn ();";
- }
- else
+ *os << this->gen_environment_var () << be_nl;
+
+ // Generate code that retrieves the proper proxy implementation
+ // using the proxy broker available, and perform the call
+ // using the proxy implementation provided by the broker.
+
+ if (!this->void_return_type (bt))
+ *os << "return ";
+
+ *os << "this->the" << intf->base_proxy_broker_name () << "_->select_proxy (this, ACE_TRY_ENV)."
+ << node->local_name ()
+ << " (" << be_idt << be_idt_nl << "this";
+
+ if (node->nmembers () > 0)
+ {
+
+ // Initialize an iterator to iterate over our scope.
+ UTL_ScopeActiveIterator *si;
+ ACE_NEW_RETURN (si,
+ UTL_ScopeActiveIterator (node,
+ UTL_Scope::IK_decls),
+ -1);
+
+ while (!si->is_done ())
+ {
+ AST_Decl *d = si->item ();
+
+ if (d == 0)
{
- *os << "return _tao_retval;";
+ delete si;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_scope::visit_scope - "
+ "bad node in this scope\n"),
+ -1);
+
}
- }
- } // end of if (!native)
-
- *os << be_uidt_nl << "}\n\n";
-
- return 0;
+ *os << "," << be_nl;
+ be_decl *decl = be_decl::narrow_from_decl (d);
+
+ *os << decl->local_name();
+ si->next ();
+ }
+ }
+ if (!be_global->exception_support ())
+ *os << "," << be_nl << "ACE_TRY_ENV";
+ *os << be_uidt_nl << ");" << be_uidt << be_uidt_nl << "}\n\n";
+
+return 0;
}
int
@@ -292,734 +218,5 @@ be_visitor_operation_cs::visit_argument (be_argument *node)
return 0;
}
-int
-be_visitor_operation_cs::gen_pre_stub_info (be_operation *node)
-{
-
- // Check if this operation raises any exceptions. In that case, we must
- // generate a list of exception typecodes. This is not valid for
- // attributes
- if (!this->ctx_->attribute ())
- {
- be_visitor_context ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_compiled_visitor_operation_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_cs::gen_marshal_and_invoke (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
-
- // create the GIOP_Invocation and grab the outgoing CDR stream
- switch (node->flags ())
- {
- case AST_Operation::OP_oneway:
- *os << "TAO_GIOP_Oneway_Invocation _tao_call ";
- break;
- default:
- *os << "TAO_GIOP_Twoway_Invocation _tao_call ";
- }
-
- // Do we have "_set_" or "_get_" prepended?
- size_t ext = this->ctx_->attribute () ? 5 : 0;
-
- // Do we have any arguments in the operation that needs marshalling
- UTL_ScopeActiveIterator si (node,
- UTL_Scope::IK_decls);
- AST_Decl *d = 0;
- AST_Argument *arg = 0;
- int flag = 0;
-
- while (!si.is_done ())
- {
- d = si.item ();
- arg = AST_Argument::narrow_from_decl (d);
-
- if (arg->direction () == AST_Argument::dir_IN ||
- arg->direction () == AST_Argument::dir_INOUT)
- {
- // There is something that needs marshalling
- flag = 1;
- break;
- }
- si.next ();
- }
-
- *os << "(" << be_idt << be_idt_nl
- << "istub," << be_nl
- << this->compute_operation_name (node)
- << "," << be_nl
- << ACE_OS::strlen (node->original_local_name ()->get_string ()) + ext
- << "," << be_nl
- << flag
- << "," <<be_nl
- << "istub->orb_core ()" << be_uidt_nl
- << ");\n";
-
- // Fish out the interceptor from the ORB.
- *os << "\n#if (TAO_HAS_INTERCEPTORS == 1)" << be_uidt_nl;
- *os << "TAO_ClientRequestInterceptor_Adapter _tao_vfr ("
- << be_idt << be_idt_nl
- << "istub->orb_core ()->client_request_interceptors ()"
- << be_uidt_nl
- << ");" << be_uidt_nl;
- os->decr_indent ();
-
- *os << be_nl;
-
- // Obtain the scope.
- os->incr_indent ();
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- *os << parent->full_name () << "::";
- }
-
- *os << "TAO_ClientRequestInfo_" << node->flat_name ();
-
- // We need the interface node in which this operation was defined. However,
- // if this operation node was an attribute node in disguise, we get this
- // information from the context and add a "_get"/"_set" to the flat
- // name to get around the problem of overloaded methods which are
- // generated for attributes.
- if (this->ctx_->attribute ())
- {
- bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interceptors_ch::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- // Grab the right visitor to generate the return type if its not
- // void it means it is not the accessor.
- if (!this->void_return_type (bt))
- *os << "_get";
- else
- *os << "_set";
- }
-
- *os << " ri (" << be_idt << be_idt_nl
- << this->compute_operation_name (node) << "," << be_nl
- << "_tao_call.service_info ()," << be_nl
- << "this";
-
- // Generate the formal argument fields which are passed
- // to the RequestInfo object.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CS);
- visitor = tao_cg->make_visitor (&ctx);
-
- if ((!visitor) || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for arglist failed\n"),
- -1);
- }
-
- delete visitor;
-
- *os << be_uidt_nl << ");" << be_uidt_nl;
-
- os->decr_indent ();
-
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- *os << be_nl;
- os->incr_indent ();
-
- *os << "ACE_TRY" << be_idt_nl
- << "{\n"
- << "#endif /* TAO_HAS_INTERCEPTORS */" << be_idt_nl << be_nl;
-
- *os << "for (;;)" << be_nl
- << "{" << be_idt_nl;
- *os << "_tao_call.start (ACE_TRY_ENV);" << be_nl;
- // check if there is an exception
- if (this->gen_check_interceptor_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- // Invoke preinvoke interceptor
- *os << be_nl << "TAO_INTERCEPTOR (" << be_idt << be_idt_nl
- // Get the request_id field for the Request Info. In TAO, request id's
- // change with differnet profiles so this seems to be the appropriate
- // place to populate the Request Info with it.
- << "ri.request_id (_tao_call.request_id ()); " << be_nl
- << " _tao_vfr.send_request (" << be_idt << be_idt_nl
- << "&ri," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl;
-
- if (this->gen_check_interceptor_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- // Prepare the request header.
- *os << "CORBA::Short _tao_response_flag = ";
-
- switch (node->flags ())
- {
- case AST_Operation::OP_oneway:
- *os << "_tao_call.sync_scope ();";
- break;
- default:
- *os << "TAO_TWOWAY_RESPONSE_FLAG;" << be_nl;
- }
- *os << be_nl
- << "_tao_call.prepare_header (" << be_idt << be_idt_nl
- << "ACE_static_cast (CORBA::Octet, _tao_response_flag)," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- // Check if there is an exception.
- if (this->gen_check_interceptor_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- // Now make sure that we have some in and inout parameters. Otherwise, there
- // is nothing to be marshaled in.
- if (this->has_param_type (node, AST_Argument::dir_IN) ||
- this->has_param_type (node, AST_Argument::dir_INOUT))
- {
- *os << be_nl
- << "TAO_OutputCDR &_tao_out = _tao_call.out_stream ();"
- << be_nl
- << "if (!(\n" << be_idt << be_idt << be_idt;
-
- // Marshal each in and inout argument.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- *os << be_uidt << be_uidt_nl
- << "))" << be_uidt_nl;
-
- // If marshaling fails, raise exception.
- if (this->gen_raise_interceptor_exception (bt,
- "CORBA::MARSHAL",
- "")
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
-
- *os << be_idt_nl;
- }
-
- *os << "int _invoke_status =" << be_idt_nl;
- if (node->flags () == AST_Operation::OP_oneway)
- {
- // Oneway operation.
- *os << "_tao_call.invoke (ACE_TRY_ENV);";
- }
- else
- {
- if (node->exceptions ())
- {
- *os << "_tao_call.invoke (_tao_" << node->flat_name ()
- << "_exceptiondata, "
- << node->exceptions ()->length ()
- << ", ACE_TRY_ENV);";
- }
- else
- {
- *os << "_tao_call.invoke (0, 0, ACE_TRY_ENV);";
- }
- }
-
- *os << be_uidt_nl;
- // Check if there is an exception.
- if (this->gen_check_interceptor_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
- }
-
- *os << be_nl
- << "if (_invoke_status == TAO_INVOKE_RESTART)" << be_idt_nl
- << "{" << be_nl
- << " _tao_call.restart_flag (1);" << be_nl
- << " continue;" <<be_nl
- << "}"<< be_uidt_nl
- << "if (_invoke_status != TAO_INVOKE_OK)" << be_nl
- << "{" << be_idt_nl;
-
- if (this->gen_raise_interceptor_exception (bt,
- "CORBA::UNKNOWN",
- "TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
-
- *os << "}" << be_nl;
-
- // If we reach here, we are ready to proceed.
- // the code below this is for twoway operations only.
-
- if (!this->void_return_type (bt) ||
- this->has_param_type (node, AST_Argument::dir_INOUT) ||
- this->has_param_type (node, AST_Argument::dir_OUT))
-
- {
- // Do any post_invoke stuff that might be necessary.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for args in post do_static_call\n"),
- -1);
- }
-
-
- // Generate any temporary variables to demarshal the arguments
- ctx = *this->ctx_;
- be_visitor_compiled_args_decl vis1 (new be_visitor_context (ctx));
- if (node->accept (&vis1) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_pre_stub_info - "
- "codegen for pre args failed\n"),
- -1);
- }
-
- if (!this->void_return_type (bt))
- {
- // Generate any temporary variables to demarshal the return value
- ctx = *this->ctx_;
- be_visitor_context *new_ctx =
- new be_visitor_context (ctx);
- be_visitor_operation_rettype_post_invoke_cs vis2 (new_ctx);
- if (bt->accept (&vis2) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_pre_stub_info - "
- "codegen rettype [post invoke] failed\n"),
- -1);
- }
- }
-
- // check if there was a user exception, else demarshal the
- // return val (if any) and parameters (if any) that came with
- // the response message
- *os << "TAO_InputCDR &_tao_in = _tao_call.inp_stream ();" << be_nl
- << "if (!(\n" << be_idt << be_idt << be_idt;
-
- if (!this->void_return_type (bt))
- {
- // demarshal the return val
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- }
-
- if (this->has_param_type (node, AST_Argument::dir_INOUT) ||
- this->has_param_type (node, AST_Argument::dir_OUT))
- {
- if (!this->void_return_type (bt))
- *os << " &&\n";
-
- // demarshal each out and inout argument
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- }
-
- *os << be_uidt << be_uidt << be_nl
- << "))" << be_nl
- << "{" << be_idt_nl;
- // if marshaling fails, raise exception
- if (this->gen_raise_interceptor_exception
- (bt, "CORBA::MARSHAL",
- "TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
-
- *os << "}" << be_uidt_nl;
- }
-
-
- // Populate the Request Info with result if any of the invocation
- if (!this->void_return_type (bt))
- {
- // Here's what we are going to do to have a uniform way of getting the
- // return value updated for the Request Info:
- // declare a operation_retval type object and assign the
- // _tao_safe_retval._retn () to it.
- // We pass this to the result updation method (note: it hasnt
- // got destroyed)
- // We then put it back into the original _tao_safe_retval
- // object.
- // And finally the _retn () is returned from the operation w.o
- // causing any problems.
-
- *os << "TAO_INTERCEPTOR (" << be_idt << be_idt_nl;
- // Generate the return type mapping (same as in the header file)
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- visitor = tao_cg->make_visitor (&ctx);
- if ((!visitor) || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- if (bt->size_type () == be_decl::VARIABLE
- || bt->base_node_type () == AST_Decl::NT_array)
- {
- *os << " _tao_retval_info = _tao_safe_retval._retn ();" << be_nl
- << "ri.result (_tao_retval_info);" << be_nl
- << "_tao_safe_retval = _tao_retval_info;" << be_uidt_nl
- << ");" << be_uidt_nl;
- }
- else
- {
- *os << " _tao_retval_info = _tao_retval;" << be_nl
- << " ri.result (_tao_retval_info);" << be_uidt_nl
- << ");" << be_uidt_nl;
- }
- }
-
- // Oneway operations dont have receive reply since once the request
- // goes over the wire, its the end of the story!
- if (node->flags () != AST_Operation::OP_oneway)
- {
- // Invoke postinvoke interceptor
- *os << be_nl << "TAO_INTERCEPTOR (" << be_idt << be_idt_nl;
- *os << "_tao_vfr.receive_reply (" << be_idt << be_idt_nl
- << "&ri," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl;
-
- if (this->gen_check_interceptor_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
-
- }
- } // End of if its not a oneway operation
- *os << "break;" << be_uidt_nl
- << "}\n\n";
-
- // Generate exception occurred interceptor code
- *os << "#if (TAO_HAS_INTERCEPTORS == 1)" << be_uidt_nl
- << "}" << be_uidt_nl
- << "ACE_CATCHANY" << be_idt_nl
- << "{" << be_idt_nl;
-
- // Update the exception field of teh request info.
- *os << "ri.exception (&ACE_ANY_EXCEPTION);"<< be_nl;
-
- *os << "_tao_vfr.receive_exception (" << be_idt << be_idt_nl
- << "&ri," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- // Forward Request exception needs to be taken care off here.
- // For now we dont bother about it.
- if (be_global->use_raw_throw ())
- *os << "throw;" << be_uidt_nl;
- else
- *os << "ACE_RE_THROW;" << be_uidt_nl;
-
- *os << "}" << be_uidt_nl
- << "ACE_ENDTRY;\n";
-
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
- }
-
- *os << "#endif /* TAO_HAS_INTERCEPTORS */\n";
-
- return 0;
-}
-
-int
-be_visitor_operation_cs::gen_raise_exception (be_type *bt,
- const char *excep,
- const char *completion_status)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->void_return_type (bt))
- {
- if (be_global->use_raw_throw ())
- *os << "throw ";
- else
- *os << "ACE_THROW (";
-
- *os << excep << " (" << completion_status << ")";
-
- if (be_global->use_raw_throw ())
- *os << ";\n";
- else
- *os << ");\n";
- }
- else
- {
- if (bt->size_type () == be_decl::VARIABLE
- || bt->base_node_type () == AST_Decl::NT_array)
- {
- *os << "ACE_THROW_RETURN (" << excep
- << " (" << completion_status << "), 0);\n";
- }
- else
- {
- *os << "ACE_THROW_RETURN (" << excep
- << " (" << completion_status << "), _tao_retval);\n";
- }
- }
- return 0;
-}
-
-int
-be_visitor_operation_cs::gen_raise_interceptor_exception (be_type *bt,
- const char *excep,
- const char *completion_status)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->void_return_type (bt))
- {
- if (be_global->use_raw_throw ())
- {
- *os << "throw " << excep << "(" << completion_status << ");";
- }
- else
- {
- *os << "TAO_INTERCEPTOR_THROW (" << be_idt << be_idt_nl
- << excep << " (" << completion_status
- << ")" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
- }
- else
- {
- if (bt->size_type () == be_decl::VARIABLE
- || bt->base_node_type () == AST_Decl::NT_array)
- {
- *os << "TAO_INTERCEPTOR_THROW_RETURN (" << be_idt << be_idt_nl
- << excep << " (" << completion_status << ")," << be_nl
- << "0" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
- else
- {
- *os << "TAO_INTERCEPTOR_THROW_RETURN (" << be_idt << be_idt_nl
- << excep << " (" << completion_status << ")," << be_nl
- << "_tao_retval" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_cs::gen_check_exception (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- os->indent ();
- // check if there is an exception
- if (this->void_return_type (bt))
- {
- *os << "ACE_CHECK;\n";
- }
- else
- {
- if (bt->size_type () == be_decl::VARIABLE
- || bt->base_node_type () == AST_Decl::NT_array)
- {
- *os << "ACE_CHECK_RETURN (0);\n";
- }
- else
- {
- *os << "ACE_CHECK_RETURN (_tao_retval);\n";
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_cs::gen_check_interceptor_exception (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Check if there is an exception.
- if (this->void_return_type (bt))
- {
- *os << "TAO_INTERCEPTOR_CHECK;" << be_nl;
- }
- else
- {
- if (bt->size_type () == be_decl::VARIABLE
- || bt->base_node_type () == AST_Decl::NT_array)
- {
- *os << "TAO_INTERCEPTOR_CHECK_RETURN (0);" << be_nl;
- }
- else
- {
- *os << "TAO_INTERCEPTOR_CHECK_RETURN (_tao_retval);" << be_nl;
- }
- }
-
- return 0;
-}
-
-const char*
-be_visitor_operation_cs::compute_operation_name (be_operation *node)
-{
- if (this->operation_name_ == 0)
- {
- size_t len = 3; // length for two double quotes
- // and the null termination char.
- if (this->ctx_->attribute ())
- len += 5; // "Added length for "_set_" or "_get_".
-
- len += ACE_OS::strlen (node->original_local_name ()->get_string ());
-
- ACE_NEW_RETURN (this->operation_name_,
- char [len],
- 0);
-
- ACE_OS::strcpy (this->operation_name_, "\"");
- if (this->ctx_->attribute ())
- {
- // now check if we are a "get" or "set" operation
- if (node->nmembers () == 1) // set
- ACE_OS::strcat (this->operation_name_, "_set_");
- else
- ACE_OS::strcat (this->operation_name_, "_get_");
- }
- ACE_OS::strcat (this->operation_name_,
- node->original_local_name ()->get_string ());
- ACE_OS::strcat (this->operation_name_, "\"");
- }
- return this->operation_name_;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp
new file mode 100644
index 00000000000..6fe97853560
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp
@@ -0,0 +1,99 @@
+// $Id$
+
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_operation.h"
+
+ACE_RCSID(be_visitor_operation, proxy_impl_xh, "$Id$")
+
+
+be_visitor_operation_proxy_impl_xh::be_visitor_operation_proxy_impl_xh (be_visitor_context *ctx)
+ : be_visitor_scope (ctx)
+{
+}
+
+be_visitor_operation_proxy_impl_xh::~be_visitor_operation_proxy_impl_xh (void)
+{
+}
+
+int be_visitor_operation_proxy_impl_xh::visit_operation (be_operation *node)
+{
+ TAO_OutStream *os; // output stream
+ be_type *bt; // type node representing the return type
+
+ os = this->ctx_->stream ();
+ this->ctx_->node (node); // save the node
+
+ os->indent (); // start with the current indentation level
+
+ // every operation is declared virtual in the client code
+ *os << "virtual ";
+
+ // STEP I: generate the return type
+ bt = be_type::narrow_from_decl (node->return_type ());
+ if (!bt)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_operation_sh::"
+ "visit_operation - "
+ "Bad return type\n"),
+ -1);
+ }
+
+ // grab the right visitor to generate the return type
+ be_visitor_context ctx (*this->ctx_);
+ ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
+ be_visitor *visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_operation_sh::"
+ "visit_operation - "
+ "Bad visitor to return type\n"),
+ -1);
+ }
+
+ if (bt->accept (visitor) == -1)
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_operation_sh::"
+ "visit_operation - "
+ "codegen for return type failed\n"),
+ -1);
+ }
+ delete visitor;
+
+ // STEP 2: generate the operation name
+ *os << " " << node->local_name ();
+
+ // STEP 3: generate the argument list with the appropriate mapping. For these
+ // we grab a visitor that generates the parameter listing
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH);
+ visitor = tao_cg->make_visitor (&ctx);
+ if (!visitor)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_operation_sh::"
+ "visit_operation - "
+ "Bad visitor to return type\n"),
+ -1);
+ }
+
+ if (node->accept (visitor) == -1)
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_operation_sh::"
+ "visit_operation - "
+ "codegen for argument list failed\n"),
+ -1);
+ }
+ delete visitor;
+
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h
index 27e9523f7be..361db3f4fc1 100644
--- a/TAO/TAO_IDL/be_include/be_codegen.h
+++ b/TAO/TAO_IDL/be_include/be_codegen.h
@@ -38,7 +38,7 @@ class TAO_IDL_BE_Export TAO_CodeGen
// TAO_CodeGen
//
// = DESCRIPTION
- // Holds global parameters for the Back End and
+ // Holds global parameters for the Back End and
// generates the C++ mapping.
//
public:
@@ -63,6 +63,8 @@ public:
// ... client header
TAO_ARGUMENT_ARGLIST_SH, // argument in op signature of
// ... server header
+ TAO_ARGUMENT_INVOKE_ARG_LIST,
+
TAO_ARGUMENT_INTERCEPTORS_ARGLIST_CH, // ... client header
TAO_ARGUMENT_INTERCEPTORS_ARGLIST_CS, // ... client source
TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_CH, // ... client header
@@ -101,12 +103,21 @@ public:
TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH, // in server header for collocated
TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS, // in server skeletons for
// collocated
+
+ TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH, // Proxy Impl Related Attribute visitors.
+
+ TAO_ATTRIBUTE_PROXY_IMPL_XH,
+
+ TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS,
+ TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS,
+ TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS,
+
TAO_ATTRIBUTE_SMART_PROXY_CH, // in client header
TAO_ATTRIBUTE_SMART_PROXY_CS, // in client source
TAO_ATTRIBUTE_INTERCEPTORS_CH, // in client header
- TAO_ATTRIBUTE_INTERCEPTORS_CS, // in client source
+ TAO_ATTRIBUTE_INTERCEPTORS_CS, // in client source
TAO_ATTRIBUTE_INTERCEPTORS_SH, // in server header
- TAO_ATTRIBUTE_INTERCEPTORS_SS, // in server source
+ TAO_ATTRIBUTE_INTERCEPTORS_SS, // in server source
TAO_ATTRIBUTE_TIE_SH,
TAO_ATTRIBUTE_TIE_SI,
@@ -183,6 +194,30 @@ public:
TAO_INTERFACE_INTERCEPTORS_CS,
TAO_INTERFACE_INTERCEPTORS_SH,
TAO_INTERFACE_INTERCEPTORS_SS,
+ TAO_INTERFACE_PROXY_BROKERS_CH,
+ TAO_INTERFACE_PROXY_BROKERS_CS,
+ TAO_INTERFACE_PROXY_BROKERS_SH,
+ TAO_INTERFACE_PROXY_BROKERS_SS,
+ TAO_INTERFACE_BASE_PROXY_BROKER_CH,
+ TAO_INTERFACE_BASE_PROXY_BROKER_CS,
+ TAO_INTERFACE_REMOTE_PROXY_BROKER_CH,
+ TAO_INTERFACE_REMOTE_PROXY_BROKER_CS,
+ TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH,
+ TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS,
+ TAO_INTERFACE_PROXY_IMPLS_CH,
+ TAO_INTERFACE_PROXY_IMPLS_CS,
+
+ TAO_INTERFACE_PROXY_IMPLS_SH,
+
+ TAO_INTERFACE_PROXY_IMPLS_SS,
+ TAO_INTERFACE_BASE_PROXY_IMPL_CH,
+ TAO_INTERFACE_BASE_PROXY_IMPL_CS,
+ TAO_INTERFACE_REMOTE_PROXY_IMPL_CH,
+ TAO_INTERFACE_REMOTE_PROXY_IMPL_CS,
+ TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH,
+ TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS,
+ TAO_INTERFACE_DIRECT_PROXY_IMPL_SH,
+ TAO_INTERFACE_DIRECT_PROXY_IMPL_SS,
// Emitting code for the interface forward declaration.
TAO_INTERFACE_FWD_CH,
@@ -252,6 +287,13 @@ public:
TAO_OPERATION_DIRECT_COLLOCATED_SH, // in collocated server header
TAO_OPERATION_DIRECT_COLLOCATED_SS, // in collocated server skel
+ TAO_OPERATION_BASE_PROXY_IMPL_CH, // Proxy_Impl operation gen.
+ // in client header
+ TAO_OPERATION_PROXY_IMPL_XH,
+ TAO_OPERATION_REMOTE_PROXY_IMPL_CS,
+ TAO_OPERATION_THRU_POA_PROXY_IMPL_SS,
+ TAO_OPERATION_DIRECT_PROXY_IMPL_SS,
+
TAO_OPERATION_SMART_PROXY_CH, // in client header
TAO_OPERATION_SMART_PROXY_CS, // in client stubs
TAO_OPERATION_INTERCEPTORS_CH, // in client header
@@ -267,6 +309,12 @@ public:
// signature
TAO_OPERATION_RETTYPE_IS, // return type in client header op
TAO_OPERATION_RETTYPE_OTHERS, // ... in other cases
+
+ TAO_OPERATION_INVOKE_ARG_LIST, // Generate the signature needed to invoke
+ // the operation given. The signature generated
+ // consists of the name of the arguments, without
+ // any type
+
TAO_OPERATION_ARGLIST_CH, // parameter list in op signature
// ... for client header
TAO_OPERATION_ARGLIST_SH, // ... for server header
@@ -280,7 +328,16 @@ public:
TAO_OPERATION_INTERCEPTORS_ARGLIST_SH, // private member list list for request info
TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SH, // private member list list for request info
TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SS, // arglist for request info obj instantiation
- TAO_OPERATION_INTERCEPTORS_ARGLIST_SS, // private member list list for request info // ... for server source
+ TAO_OPERATION_INTERCEPTORS_ARGLIST_SS, // private member list list for request info // ... for server source
+
+ // TAO_OPERATION_ARGLIST_PROXY_IMPL_CH, // Proxy impl arg list generation
+ // in client header
+
+ TAO_OPERATION_ARGLIST_PROXY_IMPL_XH, // Proxy impl arg list generation
+ // in client/server header
+ TAO_OPERATION_ARGLIST_PROXY_IMPL_XS,
+
+ TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH,
TAO_OPERATION_ARGLIST_IH, // ... for implementation header
TAO_OPERATION_ARGLIST_IS, // ... for implementation header
@@ -683,7 +740,7 @@ private:
typedef ACE_Singleton<TAO_CodeGen, ACE_SYNCH_RECURSIVE_MUTEX> TAO_CODEGEN;
// Singleton instance of the BE code generator.
-extern TAO_IDL_BE_Export TAO_CodeGen *tao_cg;
+extern TAO_IDL_BE_Export TAO_CodeGen *tao_cg;
// Code generator instance which is used everywhere.
#endif /* if !defined */
diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h
index 685d2442421..57c2f1356c0 100644
--- a/TAO/TAO_IDL/be_include/be_interface.h
+++ b/TAO/TAO_IDL/be_include/be_interface.h
@@ -44,15 +44,15 @@ class be_interface : public virtual AST_Interface,
// = DESCRIPTION
//
public:
- enum
+ enum
{
THRU_POA = 0,
- DIRECT = 1
+ DIRECT = 1,
};
// Used to pass functions to the template method.
- typedef int (*tao_code_emitter) (be_interface *,
- be_interface *,
+ typedef int (*tao_code_emitter) (be_interface *,
+ be_interface *,
TAO_OutStream *);
be_interface (void);
@@ -98,6 +98,64 @@ public:
const char *local_coll_name (int) const;
// Retrieve the fully qualified collocated class name.
+ virtual const char *base_proxy_impl_name (void);
+ // retrieve the name of the base proxy implementation.
+
+ virtual const char *full_base_proxy_impl_name (void);
+ // retrieve the fully qualified name of the base proxy
+ // implementation.
+
+ virtual const char *remote_proxy_impl_name (void);
+ // retrieve the name of the remote proxy implementation.
+
+ virtual const char *full_remote_proxy_impl_name (void);
+ // retrieve the fully qualified name of the remote
+ // proxy implementation.
+
+ virtual const char *thru_poa_proxy_impl_name (void);
+ // retrieve the name of the ThruPOA proxy implementation.
+
+ virtual const char *full_thru_poa_proxy_impl_name (void);
+ // retrieve the fully qualified name of the ThruPOA proxy
+ // implementation.
+
+ virtual const char *direct_proxy_impl_name (void);
+ // retrieve the name of the Directx proxy implementation.
+
+ virtual const char *full_direct_proxy_impl_name (void);
+ // retrieve the fully qualified name of the Directx proxy
+ // implementation.
+
+ virtual const char *base_proxy_broker_name (void);
+ // retrieve the name of the base proxy broker.
+
+ virtual const char *full_base_proxy_broker_name (void);
+ // retrieve the fully qualified name of the base proxy broker.
+
+ virtual const char *remote_proxy_broker_name (void);
+ // retrieve the name of the remote proxy broker implementation.
+
+ virtual const char *full_remote_proxy_broker_name (void);
+ // retrieve the fully qualified name of the remote proxy broker
+ // implementation.
+
+ virtual const char *strategized_proxy_broker_name (void);
+ // retrieve the name of the strategized proxy broker implementation.
+
+ virtual const char *full_strategized_proxy_broker_name (void);
+ // retrieve the fully qualified name of the strategized proxy broker
+ // implementation.
+
+ virtual const char *client_enclosing_scope (void);
+ // Return the client scope that encloses the interface.
+
+ virtual const char *flat_client_enclosing_scope (void);
+ // Return the "flattened" scope that encloses
+ // the interface.
+
+ virtual const char *server_enclosing_scope (void);
+ // Return the server scope that encloses the interface.
+
const char *relative_skel_name (const char *skel_name);
// Retrieve skeleton name.
@@ -105,7 +163,7 @@ public:
char *&skel_name);
// Build up the skeleton name.
- static const char *relative_name (const char *localname,
+ static const char *relative_name (const char *localname,
const char *othername);
virtual void gen_def_ctors (TAO_OutStream* os);
@@ -171,8 +229,8 @@ public:
DEF_NARROW_FROM_DECL (be_interface);
DEF_NARROW_FROM_SCOPE (be_interface);
- static int is_a_helper (be_interface *,
- be_interface *,
+ static int is_a_helper (be_interface *,
+ be_interface *,
TAO_OutStream *os);
// Helper method passed to the template method that generates code for the
// is_a method.
@@ -223,14 +281,14 @@ public:
be_interface* base,
TAO_OutStream *os);
- // Helper method to generate a call to the default
+ // Helper method to generate a call to the default
// constructors of all the base classes.
static int gen_copy_ctors_helper (be_interface* node,
be_interface* base,
TAO_OutStream *os);
- // Helper method to generate a call to the copy
+ // Helper method to generate a call to the copy
// constructors of all the base classes.
diff --git a/TAO/TAO_IDL/be_include/be_interface_strategy.h b/TAO/TAO_IDL/be_include/be_interface_strategy.h
index 57d15a86692..609e741854b 100644
--- a/TAO/TAO_IDL/be_include/be_interface_strategy.h
+++ b/TAO/TAO_IDL/be_include/be_interface_strategy.h
@@ -64,6 +64,71 @@ public:
virtual const char *local_coll_name (int) = 0;
// retrieve the fully qualified collocated class name.
+ virtual const char *base_proxy_impl_name (void) = 0;
+ // retrieve the name of the base proxy implementation.
+
+ virtual const char *full_base_proxy_impl_name (void) = 0;
+ // retrieve the fully qualified name of the base proxy
+ // implementation.
+
+ virtual const char *remote_proxy_impl_name (void) = 0;
+ // retrieve the name of the remote proxy implementation.
+
+ virtual const char *full_remote_proxy_impl_name (void) = 0;
+ // retrieve the fully qualified name of the remote
+ // proxy implementation.
+
+ virtual const char *thru_poa_proxy_impl_name (void) = 0;
+ // retrieve the name of the ThruPOA proxy implementation.
+
+ virtual const char *full_thru_poa_proxy_impl_name (void) = 0;
+ // retrieve the fully qualified name of the ThruPOA proxy
+ // implementation.
+
+ virtual const char *direct_proxy_impl_name (void) =0;
+ // retrieve the name of the Directx proxy implementation.
+
+ virtual const char *full_direct_proxy_impl_name (void) =0;
+ // retrieve the fully qualified name of the Directx proxy
+ // implementation.
+
+ virtual const char *base_proxy_broker_name (void) = 0;
+ // retrieve the name of the base proxy broker.
+
+ virtual const char *full_base_proxy_broker_name (void) = 0;
+ // retrieve the fully qualified name of the base proxy broker.
+
+ virtual const char *remote_proxy_broker_name (void) = 0;
+ // retrieve the name of the remote proxy broker implementation.
+
+ virtual const char *full_remote_proxy_broker_name (void) = 0;
+ // retrieve the fully qualified name of the remote proxy broker
+ // implementation.
+
+ virtual const char *strategized_proxy_broker_name (void) = 0;
+ // retrieve the name of the strategized proxy broker implementation.
+
+ virtual const char *full_strategized_proxy_broker_name (void) = 0;
+ // retrieve the fully qualified name of the strategized proxy broker
+ // implementation.
+
+ virtual const char *client_scope (void) = 0;
+ // Return the scope that encloses the client related
+ // interface.
+
+ virtual const char *flat_client_scope (void) = 0;
+ // Return the "flat" version of the scope
+ //that encloses the interface.
+
+ virtual const char *server_scope (void) = 0;
+ // Return the scope that encloses the server related
+ // interface.
+
+ virtual const char *flat_server_scope (void) = 0;
+ // Return the "flat" version of the scope
+ //that encloses the interface.
+
+
const char *relative_skel_name (const char *skel_name);
// relative skeleton name
@@ -83,13 +148,13 @@ public:
virtual TAO_OutStream *get_out_stream ();
// return the out stream depending on the strategy
- // @@ Michael: Right now every strategy behaves
+ // @@ Michael: Right now every strategy behaves
// the same way, but it might be in the future that we
- // have to differentiate.
+ // have to differentiate.
virtual const char *get_out_stream_fname ();
// return the file name of the output stream.
- // @@ Michael: Right now every strategy behaves the
+ // @@ Michael: Right now every strategy behaves the
// same way.
int strategy_type ();
@@ -131,6 +196,8 @@ protected:
Strategy_Kind strategy_type_;
// The type of strategy
+
+
};
@@ -166,7 +233,133 @@ public:
virtual const char *local_coll_name (int);
// retrieve the fully qualified collocated class name.
+ virtual const char *base_proxy_impl_name (void);
+ // retrieve the name of the base proxy implementation.
+
+ virtual const char *full_base_proxy_impl_name (void);
+ // retrieve the fully qualified name of the base proxy
+ // implementation.
+
+ virtual const char *remote_proxy_impl_name (void);
+ // retrieve the name of the remote proxy implementation.
+
+ virtual const char *full_remote_proxy_impl_name (void);
+ // retrieve the fully qualified name of the remote
+ // proxy implementation.
+
+ virtual const char *thru_poa_proxy_impl_name (void);
+ // retrieve the name of the ThruPOA proxy implementation.
+
+ virtual const char *full_thru_poa_proxy_impl_name (void);
+ // retrieve the fully qualified name of the ThruPOA proxy
+ // implementation.
+
+ virtual const char *direct_proxy_impl_name (void);
+ // retrieve the name of the Directx proxy implementation.
+
+ virtual const char *full_direct_proxy_impl_name (void);
+ // retrieve the fully qualified name of the Directx proxy
+ // implementation.
+
+ virtual const char *base_proxy_broker_name (void);
+ // retrieve the name of the base proxy broker.
+
+ virtual const char *full_base_proxy_broker_name (void);
+ // retrieve the fully qualified name of the base proxy broker.
+
+ virtual const char *remote_proxy_broker_name (void);
+ // retrieve the name of the remote proxy broker implementation.
+
+ virtual const char *full_remote_proxy_broker_name (void);
+ // retrieve the fully qualified name of the remote proxy broker
+ // implementation.
+
+ virtual const char *strategized_proxy_broker_name (void);
+ // retrieve the name of the strategized proxy broker implementation.
+
+ virtual const char *full_strategized_proxy_broker_name (void);
+ // retrieve the fully qualified name of the strategized proxy broker
+ // implementation.
+
+ virtual const char *client_scope (void);
+ // Return the scope that encloses the client related
+ // interface.
+
+ virtual const char *flat_client_scope (void);
+ // Return the "flat" version of the scope
+ //that encloses the interface.
+
+ virtual const char *server_scope (void);
+ // Return the scope that encloses the server related
+ // interface.
+
+ virtual const char *flat_server_scope (void);
+ // Return the "flat" version of the scope
+ //that encloses the interface.
+
+
// end of overridden methods
+
+protected:
+
+ char *create_with_prefix_suffix (const char *prefix,
+ const char *str,
+ const char *suffix,
+ const char *separator = "");
+ // create a new string made by the concatenation of "str" and "suffix" and using the
+ // "separator" to concatenate the two.
+
+
+
+protected:
+
+ enum Suffix_Code
+ {
+ PROXY_IMPL = 0,
+ PROXY_BROKER = 1
+ };
+
+ enum Tag_Code
+ {
+ REMOTE = 0,
+ THRU_POA = 1,
+ DIRECT = 2,
+ STRATEGIZED = 3,
+ GC_PREFIX = 4 // Prefix used for the generated class
+ // This prefix is used to avoid name conflicts
+ // with the user classes.
+ };
+
+
+
+ static const char *suffix_table_[];
+ static const char *tag_table_[];
+
+ // Proxy Implementation names.
+ char *base_proxy_impl_name_;
+ char *remote_proxy_impl_name_;
+ char *thruPOA_proxy_impl_name_;
+ char *direct_proxy_impl_name_;
+
+ char *full_base_proxy_impl_name_;
+ char *full_remote_proxy_impl_name_;
+ char *full_thruPOA_proxy_impl_name_;
+ char *full_direct_proxy_impl_name_;
+
+ // Proxy Broker Names.
+ char *base_proxy_broker_;
+ char *remote_proxy_broker_;
+ char *strategized_proxy_broker_;
+
+ char *full_base_proxy_broker_name_;
+ char *full_remote_proxy_broker_name_;
+ char *full_strategized_proxy_broker_name_;
+
+ char *client_scope_;
+ char *flat_client_scope_;
+
+ char *server_scope_;
+ char *flat_server_scope_;
};
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface.h b/TAO/TAO_IDL/be_include/be_visitor_interface.h
index d792d10a861..e472055f52d 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_interface.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface.h
@@ -51,4 +51,22 @@
#include "be_visitor_interface/interceptors_sh.h"
#include "be_visitor_interface/interceptors_ss.h"
+// Proxy Brokers
+#include "be_visitor_interface/proxy_brokers_ch.h"
+#include "be_visitor_interface/base_proxy_broker_ch.h"
+#include "be_visitor_interface/remote_proxy_broker_ch.h"
+#include "be_visitor_interface/remote_proxy_broker_cs.h"
+#include "be_visitor_interface/strategized_proxy_broker_sh.h"
+#include "be_visitor_interface/strategized_proxy_broker_ss.h"
+
+// Proxy Impls
+#include "be_visitor_interface/proxy_impls_ch.h"
+#include "be_visitor_interface/base_proxy_impl_ch.h"
+#include "be_visitor_interface/remote_proxy_impl_ch.h"
+#include "be_visitor_interface/remote_proxy_impl_cs.h"
+#include "be_visitor_interface/thru_poa_proxy_impl_sh.h"
+#include "be_visitor_interface/thru_poa_proxy_impl_ss.h"
+#include "be_visitor_interface/direct_proxy_impl_sh.h"
+#include "be_visitor_interface/direct_proxy_impl_ss.h"
+
#endif /* _BE_VISITOR_INTERFACE_H */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_broker_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_broker_ch.h
new file mode 100644
index 00000000000..34b950be5a7
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_broker_ch.h
@@ -0,0 +1,41 @@
+//$Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// base_proxy_broker_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface node. This
+// visitor generates the declaration for the base
+// ProxyBroker class.
+//
+// = AUTHOR
+// Angelo Corsaro <corsaro@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef BE_BASE_PROXY_BROKER_CH_H_
+#define BE_BASE_PROXY_BROKER_CH_H_
+
+class be_visitor_interface_base_proxy_broker_ch : public be_visitor_interface
+{
+ // = TITLE
+ // Generates the declaration for the base proxy
+ // broker class.
+
+public:
+ // -- Ctor/Dtor Decl. --
+ be_visitor_interface_base_proxy_broker_ch (be_visitor_context *ctx);
+
+ virtual ~be_visitor_interface_base_proxy_broker_ch (void);
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+};
+
+#endif /* BE_BASE_PROXY_BROKER_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_impl_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_impl_ch.h
new file mode 100644
index 00000000000..1e00449cd4c
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_impl_ch.h
@@ -0,0 +1,41 @@
+//$Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// base_proxy_impl_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface node. This
+// visitor handle the generation of the proxy
+// implementations base clas.
+//
+// = AUTHOR
+// Angelo Corsaro <corsaro@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef BE_BASE_PROXY_IMPL_CH_H_
+#define BE_BASE_PROXY_IMPL_CH_H_
+
+class be_visitor_interface_base_proxy_impl_ch : public be_visitor_interface
+{
+ // = TITLE
+ // Generates the declaration for the base proxy
+ // implementation classes.
+
+public:
+ // -- Ctor/Dtor Decl. --
+ be_visitor_interface_base_proxy_impl_ch (be_visitor_context *ctx);
+
+ virtual ~be_visitor_interface_base_proxy_impl_ch (void);
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+};
+
+#endif /* BE_BASE_PROXY_IMPL_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_sh.h b/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_sh.h
new file mode 100644
index 00000000000..322c3ae3f09
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_sh.h
@@ -0,0 +1,41 @@
+//$Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// direct_proxy_impl_sh.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface node. This
+// visitor handle the generation of the proxy
+// implementations Direct clas.
+//
+// = AUTHOR
+// Angelo Corsaro <corsaro@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef BE_DIRECT_PROXY_IMPL_SH_H_
+#define BE_DIRECT_PROXY_IMPL_SH_H_
+
+class be_visitor_interface_direct_proxy_impl_sh : public be_visitor_interface
+{
+ // = TITLE
+ // Generates the declaration for the Direct proxy
+ // implementation classes.
+
+public:
+ // -- Ctor/Dtor Decl. --
+ be_visitor_interface_direct_proxy_impl_sh (be_visitor_context *ctx);
+
+ virtual ~be_visitor_interface_direct_proxy_impl_sh (void);
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+};
+
+#endif /* BE_DIRECT_PROXY_IMPL_SH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_brokers_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_brokers_ch.h
new file mode 100644
index 00000000000..9882a029980
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_brokers_ch.h
@@ -0,0 +1,41 @@
+//$Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// proxy_brokers_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface node. This
+// visitor handle the generation of the proxy brokers
+// for the given interface.
+//
+// = AUTHOR
+// Angelo Corsaro <corsaro@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef BE_PROXY_BROKERS_CH_H_
+#define BE_PROXY_BROKERS_CH_H_
+
+class be_visitor_interface_proxy_brokers_ch : public be_visitor_interface
+{
+ // = TITLE
+ // Generates the declaration for the base proxy
+ // broker class.
+
+public:
+ // -- Ctor/Dtor Decl. --
+ be_visitor_interface_proxy_brokers_ch (be_visitor_context *ctx);
+
+ virtual ~be_visitor_interface_proxy_brokers_ch (void);
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+};
+
+#endif /* BE_PROXY_BROKERS_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_impls_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_impls_ch.h
new file mode 100644
index 00000000000..d9fbdced972
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_impls_ch.h
@@ -0,0 +1,41 @@
+//$Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// proxy_impls_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface node. This
+// visitor handle the generation of the proxy
+// implementations class.
+//
+// = AUTHOR
+// Angelo Corsaro <corsaro@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef BE_PROXY_BROKER_IMPLS_CH_H_
+#define BE_PROXY_BROKER_IMPLS_CH_H_
+
+class be_visitor_interface_proxy_impls_ch : public be_visitor_interface
+{
+ // = TITLE
+ // Generates the declaration for the base proxy
+ // implementation classes.
+
+public:
+ // -- Ctor/Dtor Decl. --
+ be_visitor_interface_proxy_impls_ch (be_visitor_context *ctx);
+
+ virtual ~be_visitor_interface_proxy_impls_ch (void);
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+};
+
+#endif /* BE_PROXY_BROKER_IMPLS_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_ch.h
new file mode 100644
index 00000000000..62c24fa336d
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_ch.h
@@ -0,0 +1,41 @@
+//$Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// remote_proxy_broker_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface node. This
+// visitor generates the declaration for the remote
+// ProxyBroker class.
+//
+// = AUTHOR
+// Angelo Corsaro <corsaro@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef BE_REMOTE_PROXY_BROKER_CH_H_
+#define BE_REMOTE_PROXY_BROKER_CH_H_
+
+class be_visitor_interface_remote_proxy_broker_ch : public be_visitor_interface
+{
+ // = TITLE
+ // Generates the declaration for the base proxy
+ // broker class.
+
+public:
+ // -- Ctor/Dtor Decl. --
+ be_visitor_interface_remote_proxy_broker_ch (be_visitor_context *ctx);
+
+ virtual ~be_visitor_interface_remote_proxy_broker_ch (void);
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+};
+
+#endif /* BE_REMOTE_PROXY_BROKER_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_ch.h
new file mode 100644
index 00000000000..b02d729add6
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_ch.h
@@ -0,0 +1,41 @@
+//$Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// remote_proxy_impl_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface node. This
+// visitor handle the generation of the proxy
+// implementations remote clas.
+//
+// = AUTHOR
+// Angelo Corsaro <corsaro@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef BE_REMOTE_PROXY_IMPL_CH_H_
+#define BE_REMOTE_PROXY_IMPL_CH_H_
+
+class be_visitor_interface_remote_proxy_impl_ch : public be_visitor_interface
+{
+ // = TITLE
+ // Generates the declaration for the remote proxy
+ // implementation classes.
+
+public:
+ // -- Ctor/Dtor Decl. --
+ be_visitor_interface_remote_proxy_impl_ch (be_visitor_context *ctx);
+
+ virtual ~be_visitor_interface_remote_proxy_impl_ch (void);
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+};
+
+#endif /* BE_REMOTE_PROXY_IMPL_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_sh.h b/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_sh.h
new file mode 100644
index 00000000000..235b319c688
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_sh.h
@@ -0,0 +1,41 @@
+//$Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// strategized_proxy_broker_sh.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface node. This
+// visitor generates the declaration for the strategized
+// ProxyBroker class.
+//
+// = AUTHOR
+// Angelo Corsaro <corsaro@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef BE_STRATEGIZED_PROXY_BROKER_SH_H_
+#define BE_STRATEGIZED_PROXY_BROKER_SH_H_
+
+class be_visitor_interface_strategized_proxy_broker_sh : public be_visitor_interface
+{
+ // = TITLE
+ // Generates the declaration for the base proxy
+ // broker class.
+
+public:
+ // -- Ctor/Dtor Decl. --
+ be_visitor_interface_strategized_proxy_broker_sh (be_visitor_context *ctx);
+
+ virtual ~be_visitor_interface_strategized_proxy_broker_sh (void);
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+};
+
+#endif /* BE_STRATEGIZED_PROXY_BROKER_SH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_sh.h b/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_sh.h
new file mode 100644
index 00000000000..550b8b05268
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_sh.h
@@ -0,0 +1,41 @@
+//$Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// thru_poa_proxy_impl_sh.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface node. This
+// visitor handle the generation of the proxy
+// implementations ThruPOA clas.
+//
+// = AUTHOR
+// Angelo Corsaro <corsaro@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef BE_THRU_POA_PROXY_IMPL_SH_H_
+#define BE_THRU_POA_PROXY_IMPL_SH_H_
+
+class be_visitor_interface_thru_poa_proxy_impl_sh : public be_visitor_interface
+{
+ // = TITLE
+ // Generates the declaration for the ThruPOA proxy
+ // implementation classes.
+
+public:
+ // -- Ctor/Dtor Decl. --
+ be_visitor_interface_thru_poa_proxy_impl_sh (be_visitor_context *ctx);
+
+ virtual ~be_visitor_interface_thru_poa_proxy_impl_sh (void);
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+};
+
+#endif /* BE_THRU_POA_PROXY_IMPL_SH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation.h b/TAO/TAO_IDL/be_include/be_visitor_operation.h
index 98f08711322..6c9f1e0d406 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_operation.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_operation.h
@@ -67,5 +67,11 @@
#include "be_visitor_operation/interceptors_exceptlist.h"
#include "be_visitor_operation/interceptors_info_rettype.h"
#include "be_visitor_operation/interceptors_result.h"
+#include "be_visitor_operation/base_proxy_impl_ch.h"
+#include "be_visitor_operation/proxy_impl_xh.h"
+#include "be_visitor_operation/inv_arglist.h"
+#include "be_visitor_operation/remote_proxy_impl_cs.h"
+#include "be_visitor_operation/thru_poa_proxy_impl_ss.h"
+#include "be_visitor_operation/direct_proxy_impl_ss.h"
#endif // TAO_BE_VISITOR_OPERATION_H
diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/base_proxy_impl_ch.h b/TAO/TAO_IDL/be_include/be_visitor_operation/base_proxy_impl_ch.h
new file mode 100644
index 00000000000..a10a0f663c6
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_operation/base_proxy_impl_ch.h
@@ -0,0 +1,46 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// base_proxy_impl_ch.h
+//
+// = DESCRIPTION
+// Visitor for generating code for proxy implementations.
+//
+// = AUTHOR
+// Angelo Corsaro
+//
+// ============================================================================
+
+#ifndef _BE_VISITOR_OPERATION_BASE_PROXY_IMPL_CH_H_
+#define _BE_VISITOR_OPERATION_BASE_PROXY_IMPL_CH_H_
+
+
+class be_visitor_operation_base_proxy_impl_ch : public be_visitor_scope
+{
+ //
+ // = TITLE
+ // be_visitor_operation_base_proxy_impl_ch
+ //
+ // = DESCRIPTION
+ // Concrete visitor that generates the code for the base class
+ // of Proxy Impls.
+ //
+ //
+public:
+ be_visitor_operation_base_proxy_impl_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_operation_base_proxy_impl_ch (void);
+ // destructor
+
+ virtual int visit_operation (be_operation *node);
+ // visit operation.
+
+};
+
+#endif /* _BE_VISITOR_OPERATION_BASE_PROXY_IMPL_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/inv_arglist.h b/TAO/TAO_IDL/be_include/be_visitor_operation/inv_arglist.h
new file mode 100644
index 00000000000..fdc1fc6e3aa
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_operation/inv_arglist.h
@@ -0,0 +1,55 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// inv_arglist.h
+//
+// = DESCRIPTION
+// Visitor for generating signature needed to invoke a given
+// operation.
+//
+// = AUTHOR
+// Angelo Corsaro
+//
+// ============================================================================
+
+#ifndef _BE_VISITOR_OPERATION_INV_ARGLIST_H_
+#define _BE_VISITOR_OPERATION_INV_ARGLIST_H_
+
+// ******************************************************************************
+// Operation visitor for argument list - generates parameters in the signature
+// ******************************************************************************
+
+class be_visitor_operation_inv_arglist : public be_visitor_operation
+{
+ //
+ // = TITLE
+ // be_visitor_operaion_inv_arglist
+ //
+ // = DESCRIPTION
+ // This visitor generates the argument list needed to
+ // invoke a given operation. No parentesys are generated
+ // to give the caller code the abity to stick in other
+ // parameter that might be needed.
+ //
+ //
+public:
+ be_visitor_operation_inv_arglist (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_operation_inv_arglist (void);
+ // destructor
+
+ virtual int visit_operation (be_operation *node);
+ // visit the operation
+
+ virtual int visit_argument (be_argument *node);
+ // visit each argument
+
+};
+
+#endif /* _BE_VISITOR_OPERATION_INV_ARGLIST_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_cs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_cs.h
index 60c35235659..968738c6e2c 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_cs.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_cs.h
@@ -14,7 +14,7 @@
// Visitor for generating code for IDL operations in client stubs
//
// = AUTHOR
-// Aniruddha Gokhale
+// Aniruddha Gokhale & Angelo Corsaro
//
// ============================================================================
@@ -47,43 +47,11 @@ public:
virtual int visit_argument (be_argument *node);
// visit argument to generate ParamData entries
-
- // = template methods
- virtual int gen_pre_stub_info (be_operation *node);
- // generate any info before the actual code for the stub is generated
-
- virtual int gen_marshal_and_invoke (be_operation *node,
- be_type *bt);
- // generate code that marshals the arguments and transmits them
-
+
// =helper
virtual int post_process (be_decl *);
// stuff to output after every member of the scope is handled
-
- virtual int gen_raise_exception (be_type *,
- const char *excep,
- const char *status);
- // helper that generates code for raising an exception
-
- virtual int gen_check_exception (be_type *);
- // helper that generates code for checking for an exception
-
- virtual int gen_raise_interceptor_exception (be_type *,
- const char *excep,
- const char *status);
- // helper that generates code for raising an exception within
- // interceptor's try block
-
- virtual int gen_check_interceptor_exception (be_type *);
- // helper that generates code for checking for an exception within
- // interceptor's try block
-
- virtual const char *compute_operation_name (be_operation *node);
- // compute the operation name. Notice that this operation
- // _does_ include the double quote.
-
-private:
- char *operation_name_;
+
};
#endif /* _BE_VISITOR_OPERATION_OPERATION_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/proxy_impl_xh.h b/TAO/TAO_IDL/be_include/be_visitor_operation/proxy_impl_xh.h
new file mode 100644
index 00000000000..369d19c5a7f
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_operation/proxy_impl_xh.h
@@ -0,0 +1,46 @@
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// proxy_impl_xh.h
+//
+// = DESCRIPTION
+// Visitor for generating code for proxy implementations.
+//
+// = AUTHOR
+// Angelo Corsaro
+//
+// ============================================================================
+
+#ifndef _BE_VISITOR_OPERATION_PROXY_IMPL_XH_H_
+#define _BE_VISITOR_OPERATION_PROXY_IMPL_XH_H_
+
+
+class be_visitor_operation_proxy_impl_xh : public be_visitor_scope
+{
+ //
+ // = TITLE
+ // be_visitor_operation_proxy_impl_xh
+ //
+ // = DESCRIPTION
+ // Concrete visitor that generates the code for the base class
+ // of Proxy Impls.
+ //
+ //
+public:
+ be_visitor_operation_proxy_impl_xh (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_operation_proxy_impl_xh (void);
+ // destructor
+
+ virtual int visit_operation (be_operation *node);
+ // visit operation.
+
+};
+
+#endif /* _BE_VISITOR_OPERATION_PROXY_IMPL_XH_H_ */