本文整理汇总了C++中AST_Decl::full_name方法的典型用法代码示例。如果您正苦于以下问题:C++ AST_Decl::full_name方法的具体用法?C++ AST_Decl::full_name怎么用?C++ AST_Decl::full_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AST_Decl
的用法示例。
在下文中一共展示了AST_Decl::full_name方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prefix
int
be_visitor_executor_exh::visit_provides (be_provides *node)
{
ACE_CString prefix (this->ctx_->port_prefix ());
prefix += node->local_name ()->get_string ();
const char *port_name = prefix.c_str ();
be_type *impl = node->provides_type ();
AST_Decl *scope = ScopeAsDecl (impl->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *sname = sname_str.c_str ();
// No '_cxx_' prefix.
const char *lname =
impl->original_local_name ()->get_string ();
const char *global = (sname_str == "" ? "" : "::");
os_ << be_nl_2
<< "/// Factory method and getter for " << port_name << " facet" << be_nl
<< "/// @return existing instance of facet if one exists, else creates one" << be_nl
<< "virtual " << global << sname << "::CCM_"
<< lname << "_ptr" << be_nl
<< "get_" << port_name << " (void);";
return 0;
}
示例2: prefix
int
be_visitor_executor_exs::visit_provides (be_provides *node)
{
ACE_CString prefix (this->ctx_->port_prefix ());
prefix += node->local_name ()->get_string ();
const char *port_name = prefix.c_str ();
be_type *obj = node->provides_type ();
const char *iname =
obj->original_local_name ()->get_string ();
AST_Decl *scope = ScopeAsDecl (obj->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *sname = sname_str.c_str ();
const char *global = (sname_str == "" ? "" : "::");
ACE_CString lname_str (this->ctx_->port_prefix ());
lname_str += node->original_local_name ()->get_string ();
const char *lname = lname_str.c_str ();
os_ << be_nl_2
<< global << sname << "::CCM_"
<< iname << "_ptr" << be_nl
<< node_->local_name () << "_exec_i::get_"
<< port_name << " (void)" << be_nl
<< "{" << be_idt_nl
<< "if ( ::CORBA::is_nil (this->ciao_" << port_name
<< "_.in ()))" << be_idt_nl
<< "{" << be_idt_nl
<< lname << "_exec_i *tmp = 0;" << be_nl
<< "ACE_NEW_RETURN (" << be_idt_nl
<< "tmp," << be_nl
<< lname << "_exec_i (" << be_idt_nl
<< "this->ciao_context_.in ())," << be_nl
<< global << sname << "::CCM_" << iname << "::_nil ());"
<< be_uidt << be_nl_2
<< "this->ciao_" << port_name << "_ = tmp;" << be_uidt << be_uidt_nl
<< "}" << be_uidt << be_nl_2
<< "return" << be_idt_nl
<< global << sname << "::CCM_" << iname
<< "::_duplicate (" << be_idt_nl
<< "this->ciao_" << port_name << "_.in ());"
<< be_uidt << be_uidt << be_uidt_nl
<< "}";
return 0;
}
示例3: sname_str
int
be_visitor_home_svh::gen_servant_class (void)
{
AST_Decl *scope = ScopeAsDecl (node_->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *sname = sname_str.c_str ();
// No '_cxx_' prefix.
const char *lname =
node_->original_local_name ()->get_string ();
const char *clname = comp_->local_name ()->get_string ();
const char *global = (sname_str == "" ? "" : "::");
os_ << be_nl
<< "class " << export_macro_.c_str () << " " << lname
<< "_Servant" << be_idt_nl
<< ": public virtual" << be_idt << be_idt_nl
<< "::CIAO::"
<< "Home_Servant_Impl<" << be_idt_nl
<< "::" << node_->full_skel_name () << "," << be_nl
<< global << sname << "::CCM_" << lname << "," << be_nl
<< clname << "_Servant," << be_nl
<< "::CIAO::" << be_global->ciao_container_type () << "_Container>"
<< be_uidt << be_uidt << be_uidt << be_uidt_nl
<< "{" << be_nl
<< "public:" << be_idt_nl;
os_ << lname << "_Servant (" << be_idt_nl
<< global << sname << "::CCM_" << lname << "_ptr exe," << be_nl
<< "const char * ins_name," << be_nl
<< "::CIAO::" << be_global->ciao_container_type ()
<< "_Container_ptr c);" << be_uidt;
os_ << be_nl_2
<< "virtual ~" << lname << "_Servant (void);";
if (this->node_->has_rw_attributes ())
{
os_ << be_nl_2
<< "virtual void" << be_nl
<< "set_attributes (const "
<< "::Components::ConfigValues & descr);";
}
AST_Type *pk = node_->primary_key ();
if (pk != 0)
{
os_ << be_nl_2
<< "// Implicit home primary key operations - not supported.";
os_ << be_nl_2
<< "virtual ::" << comp_->name () << "_ptr" << be_nl
<< "create (" << be_idt_nl
<< "::" << pk->name () << " * key);" << be_uidt;
if (!be_global->gen_lwccm ())
{
os_ << be_nl_2
<< "virtual ::" << comp_->name () << "_ptr" << be_nl
<< "find_by_primary_key (" << be_idt_nl
<< "::" << pk->name () << " * key);" << be_uidt;
}
os_ << be_nl_2
<< "virtual void" << be_nl
<< "remove (" << be_idt_nl
<< "::" << pk->name () << " * key);" << be_uidt;
if (!be_global->gen_lwccm ())
{
os_ << be_nl_2
<< "virtual ::" << pk->name () << " *" << be_nl
<< "get_primary_key (" << be_idt_nl
<< "::" << comp_->name () << "_ptr comp);" << be_uidt;
}
}
be_home *h = node_;
while (h != 0)
{
if (this->visit_scope (h) != 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("be_visitor_home_svh::")
ACE_TEXT ("gen_servant_class - ")
ACE_TEXT ("visit_scope() failed\n")),
-1);
}
for (long i = 0; i < h->n_inherits (); ++i)
{
// A closure of all the supported interfaces is stored
// in the base class 'pd_inherits_flat' member.
be_interface *bi =
be_interface::narrow_from_decl (h->inherits ()[i]);
int status =
//.........这里部分代码省略.........
示例4: sname_str
int
be_visitor_servant_svh::visit_component (be_component *node)
{
// This visitor is spawned by be_visitor_component_svh,
// which already does a check for imported node, so none
// is needed here.
node_ = node;
AST_Decl *scope = ScopeAsDecl (node_->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *sname = sname_str.c_str ();
// No '_cxx_' prefix.
const char *lname =
node_->original_local_name ()->get_string ();
const char *global = (sname_str == "" ? "" : "::");
// ::CIAO::Session_Context_Impl<
// ::Inherited::CCM_Base_comp_Context,
// ::Inherited::Base_comp>
os_ << be_nl_2
<< "class " << export_macro_.c_str () << " " << lname
<< "_Servant" << be_idt_nl
<< ": public virtual" << be_idt << be_idt_nl
<< "::CIAO::" << be_global->ciao_container_type ()
<< "_Servant_Impl_T<" << be_idt_nl
<< "::" << node_->full_skel_name () << "," << be_nl
<< global << sname << "::CCM_" << lname << "," << be_nl
<< lname << "_Context_T< " << be_idt_nl
<< "::CIAO::" << be_global->ciao_container_type ()
<< "_Container, ::CIAO::" << be_global->ciao_container_type () << "_Context_Impl_T< "
<< be_idt_nl << global << sname << "::CCM_" << lname << "_Context, " << be_nl
<< global << sname << "::" << lname << "> > >"
<< be_uidt << be_uidt << be_uidt << be_uidt << be_uidt << be_uidt_nl
<< "{" << be_nl
<< "public:" << be_idt_nl;
os_ << "typedef " << global << sname << "::CCM_" << lname
<< " _exec_type;" << be_nl;
os_ << be_nl
<< lname << "_Servant (" << be_idt_nl
<< global << sname << "::CCM_"
<< lname << "_ptr executor," << be_nl
<< "::Components::CCMHome_ptr h," << be_nl
<< "const char * ins_name," << be_nl
<< "::CIAO::Home_Servant_Impl_Base *hs," << be_nl
<< "::CIAO::" << be_global->ciao_container_type ()
<< "_Container_ptr c);" << be_uidt_nl;
os_ << be_nl
<< "virtual ~" << lname << "_Servant"
<< " (void);" << be_nl;
if (this->node_->has_rw_attributes ())
{
os_ << be_nl
<< "virtual void" << be_nl
<< "set_attributes (const "
<< "::Components::ConfigValues & descr);"
<< be_nl;
}
os_ << be_nl
<< "/// Supported operations and attributes.";
int status =
node_->traverse_inheritance_graph (
be_interface::op_attr_decl_helper,
&os_,
false,
false);
if (status == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_servant_svh::"
"visit_component - "
"inheritance graph traversal failed\n"),
-1);
}
status = this->visit_component_scope (node);
if (status == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_servant_svh::"
"visit_component - "
"visit_component_scope() failed\n"),
-1);
}
this->gen_non_type_specific ();
os_ << be_uidt_nl
<< "};";
//.........这里部分代码省略.........
示例5: prefix
int
be_visitor_servant_svs::visit_provides (be_provides *node)
{
if (node->provides_type ()->is_local ()) // @TODO || be_global->gen_lwccm ())
{
return 0;
}
ACE_CString prefix (this->ctx_->port_prefix ());
prefix += node->local_name ()->get_string ();
const char *port_name = prefix.c_str ();
AST_Type *obj = node->provides_type ();
const char *obj_name = obj->full_name ();
AST_Decl *scope = ScopeAsDecl (obj->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *sname = sname_str.c_str ();
// Avoid '_cxx_' prefix.
const char *lname =
obj->original_local_name ()->get_string ();
const char *global = (sname_str == "" ? "" : "::");
const char *prefix_connector = (sname_str == "" ? "" : "_");
if (!be_global->gen_lwccm ())
{
os_ << be_nl_2
<< "::" << obj_name << "_ptr" << be_nl
<< node_->local_name () << "_Servant::provide_"
<< port_name << " (void)" << be_nl
<< "{" << be_idt_nl;
os_ << "return" << be_idt_nl
<< "::" << obj_name << "::_duplicate (this->provide_"
<< port_name << "_.in ());" << be_uidt << be_uidt_nl
<< "}";
}
os_ << be_nl_2
<< "void" << be_nl
<< node_->local_name () << "_Servant::setup_"
<< port_name << "_i (void)" << be_nl
<< "{" << be_idt_nl
<< "ACE_CString obj_id (this->ins_name_);" << be_nl
<< "obj_id += \"_" << port_name << "\";" << be_nl_2
<< "::CIAO::Container_var cnt_safe =" << be_idt_nl
<< "::CIAO::Container::_duplicate ("
<< "this->container_.in ());" << be_uidt_nl << be_nl
<< "if (::CORBA::is_nil (cnt_safe.in ()))" << be_idt_nl
<< "{" << be_idt_nl << "throw ::CORBA::INV_OBJREF ();" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl
<< "PortableServer::POA_var POA = cnt_safe->the_port_POA ();" << be_nl
<< "::CORBA::Object_var tmp =" << be_idt_nl
<< "this->get_facet_executor (\"" << port_name << "\");"<< be_uidt_nl << be_nl
<< global << sname << "::CCM_" << lname << "_var tmp_var = " << be_idt_nl
<< global << sname <<"::CCM_" << lname
<< "::_narrow (tmp.in());" << be_uidt_nl << be_nl
<< "typedef " << global << "CIAO_FACET" << prefix_connector
<< scope->flat_name () << "::" << obj->local_name () << "_Servant_T <" << be_idt_nl
<< "POA_" << sname << global << obj->local_name ()
<< "," << be_nl << global << sname <<"::CCM_" << lname << "," << be_nl
<< global << "Components::" << be_global->ciao_container_type ()
<< "Context>" << be_idt_nl << lname
<< "_type;" << be_uidt_nl << be_uidt_nl
<< lname << "_type *" << port_name << "_servant_impl = 0;" << be_nl
<< "ACE_NEW_THROW_EX (" << be_idt_nl
<< port_name << "_servant_impl," << be_nl
<< lname << "_type (" << be_idt_nl
<< "tmp_var.in(), " << be_nl
<< "this->context_)," << be_uidt_nl
<< "CORBA::NO_MEMORY ());" << be_uidt_nl << be_nl
<< "PortableServer::ServantBase_var safe_base_servant ("
<< port_name << "_servant_impl);" << be_nl << be_nl
<< "PortableServer::ObjectId_var " << port_name << "_servant_oid =" << be_idt_nl
<< "PortableServer::string_to_ObjectId (obj_id.c_str());" << be_uidt_nl << be_nl
<< "POA->activate_object_with_id(" << port_name << "_servant_oid.in(),"
<< port_name << "_servant_impl);" << be_nl
<< "::CORBA::Object_var " << port_name << "_servant_impl_obj = " << be_idt_nl
<< "cnt_safe->generate_reference ( " << be_idt_nl
<< "obj_id.c_str ()," << be_nl
<< "\"" << obj->repoID () << "\"," << be_nl
<< "::CIAO::Container_Types::FACET_CONSUMER_t);"
<< be_uidt_nl << be_uidt_nl
<< "this->add_facet (\"" << port_name << "\", " << port_name << "_servant_impl_obj.in ());"
<< be_uidt_nl
<< "}";
return 0;
}
示例6: sname_str
int
be_visitor_servant_svs::visit_component (be_component *node)
{
// This visitor is spawned by be_visitor_component_svh,
// which already does a check for imported node, so none
// is needed here.
node_ = node;
AST_Decl *scope = ScopeAsDecl (node_->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *sname = sname_str.c_str ();
const char *lname = node->local_name ();
const char *global = (sname_str == "" ? "" : "::");
AST_Decl::NodeType nt = this->node_->node_type ();
bool const is_connector = (nt == AST_Decl::NT_connector);
bool no_events = false;
if (!is_connector)
{
no_events =
(node->n_consumes () == 0UL
&& node->n_emits () == 0UL
&& node->n_publishes () == 0UL);
}
bool const de_facto = (is_connector || no_events);
const char *opt_conn =
(de_facto ? "Connector_" : "");
os_ << be_nl_2
<< lname << "_Servant::"
<< lname << "_Servant (" << be_idt << be_idt << be_idt_nl
<< global << sname << "::CCM_" << lname
<< "_ptr exe," << be_nl
<< "::Components::CCMHome_ptr h," << be_nl
<< "const char * ins_name," << be_nl
<< "::CIAO::Home_Servant_Impl_Base * hs," << be_nl
<< "::CIAO::" << be_global->ciao_container_type ()
<< "_Container_ptr c)" << be_uidt << be_uidt_nl
<< ": ::CIAO::" << opt_conn
<< "Servant_Impl_Base (h, hs, c)," << be_idt_nl
<< "::CIAO::" << be_global->ciao_container_type ()
<< "_Servant_Impl_T<" << be_idt_nl
<< "::" << node_->full_skel_name ()
<< "," << be_nl
<< global << sname << "::CCM_"
<< lname << "," << be_nl
<< lname << "_Context_T< " << be_idt_nl
<< "::CIAO::" << be_global->ciao_container_type ()
<< "_Container, ::CIAO::" << be_global->ciao_container_type () << "_Context_Impl_T< "
<< be_idt_nl << global << sname << "::CCM_" << lname << "_Context, " << be_nl
<< global << sname << "::" << lname << "> > > (exe, h, ins_name, hs, c)"
<< be_uidt << be_uidt << be_uidt << be_uidt << be_uidt_nl
<< "{" << be_idt_nl;
be_visitor_obv_factory_reg ofr_visitor (this->ctx_);
if (ofr_visitor.visit_component_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_servant_svs::"
"visit_component - "
"OBV factory registration failed\n"),
-1);
}
/// If a component has neither facets nor event sinks, the
/// setup methods aren't generated.
if (this->node_->n_remote_provides () > 0UL
|| this->node_->n_consumes () > 0UL)
{
be_visitor_populate_port_tables ppt_visitor (this->ctx_);
if (ppt_visitor.visit_component_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_servant_svs::"
"visit_component - "
"populate port tables visitor failed\n"),
-1);
}
}
os_ << be_uidt_nl << "}";
os_ << be_nl_2
<< lname << "_Servant::~"
<< lname << "_Servant (void)" << be_nl
<< "{" << be_nl
<< "}";
if (this->node_->has_rw_attributes ())
{
os_ << be_nl_2
<< "void" << be_nl
<< lname << "_Servant::set_attributes (" << be_idt_nl
<< "const ::Components::ConfigValues & descr)"
<< be_uidt_nl
//.........这里部分代码省略.........
示例7: sname_str
//.........这里部分代码省略.........
op_scope_ = node;
/// The overload of traverse_inheritance_graph() used here
/// doesn't automatically prime the queues.
node->get_insert_queue ().reset ();
node->get_del_queue ().reset ();
node->get_insert_queue ().enqueue_tail (node_);
Component_Exec_Op_Attr_Generator op_attr_gen (this);
status =
node->traverse_inheritance_graph (op_attr_gen,
&os_,
false,
false);
if (status == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("be_visitor_executor_exs::")
ACE_TEXT ("visit_component - ")
ACE_TEXT ("traverse_inheritance_graph() ")
ACE_TEXT ("for operations failed\n")),
-1);
}
os_ << be_nl_2
<< "// Component attributes and port operations.";
if (this->visit_component_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("be_visitor_component_exs::")
ACE_TEXT ("visit_component - ")
ACE_TEXT ("scope traversal failed\n")),
-1);
}
os_ << be_nl_2
<< "// Operations from Components::"
<< be_global->ciao_container_type () << "Component.";
AST_Decl *scope = ScopeAsDecl (node->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *sname = sname_str.c_str ();
const char *global = (sname_str == "" ? "" : "::");
const char *container_type = be_global->ciao_container_type ();
os_ << be_nl_2
<< "void" << be_nl
<< lname << "_exec_i::set_"
<< tao_cg->downcase (container_type)
<< "_context (" << be_idt_nl
<< "::Components::" << be_global->ciao_container_type ()
<< "Context_ptr ctx)" << be_uidt_nl
<< "{" << be_idt_nl
<< "this->ciao_context_ =" << be_idt_nl
<< global << sname << "::CCM_" << lname
<< "_Context::_narrow (ctx);" << be_uidt << be_nl_2
<< "if ( ::CORBA::is_nil (this->ciao_context_.in ()))"
<< be_idt_nl
<< "{" << be_idt_nl
<< "throw ::CORBA::INTERNAL ();" << be_uidt_nl
<< "}" << be_uidt << be_uidt_nl
<< "}";
if (ACE_OS::strcmp (be_global->ciao_container_type (), "Session") == 0)
{
os_ << be_nl_2
<< "void" << be_nl
<< lname << "_exec_i::configuration_complete (void)"
<< be_nl
<< "{" << be_idt_nl
<< your_code_here_ << be_uidt_nl
<< "}";
os_ << be_nl_2
<< "void" << be_nl
<< lname << "_exec_i::ccm_activate (void)" << be_nl
<< "{" << be_idt_nl
<< your_code_here_ << be_uidt_nl
<< "}";
os_ << be_nl_2
<< "void" << be_nl
<< lname << "_exec_i::ccm_passivate (void)" << be_nl
<< "{" << be_idt_nl
<< your_code_here_ << be_uidt_nl
<< "}";
}
os_ << be_nl_2
<< "void" << be_nl
<< lname << "_exec_i::ccm_remove (void)" << be_nl
<< "{" << be_idt_nl
<< your_code_here_ << be_uidt_nl
<< "}";
return 0;
}
示例8: sname_str
int
be_visitor_executor_exh::visit_component (be_component *node)
{
if (node->imported ())
{
return 0;
}
this->node_ = node;
AST_Decl *scope = ScopeAsDecl (node->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *sname = sname_str.c_str ();
// No _cxx_ prefix.
const char *lname =
node->original_local_name ()->get_string ();
const char *global = (sname_str == "" ? "" : "::");
os_ << be_nl_2
<< "/// Component Executor Implementation Class: "
<< lname << "_exec_i";
os_ << be_nl
<< "class ";
os_ << lname
<< "_exec_i" << be_idt_nl
<< ": public virtual " << lname << "_Exec," << be_idt_nl;
os_ << "public virtual ::CORBA::LocalObject";
os_ << be_uidt << be_uidt_nl
<< "{" << be_nl
<< "public:" << be_idt_nl;
os_ << "/// Constructor" << be_nl
<< lname << "_exec_i (void);";
os_ << be_nl
<< "/// Destructor" << be_nl
<< "virtual ~" << lname << "_exec_i (void);";
os_ << be_nl_2
<< "/** @name Supported operations and attributes. */" << be_nl
<< "//@{";
int status =
node->traverse_inheritance_graph (
be_interface::op_attr_decl_helper,
&os_,
false,
false);
os_ << be_nl_2 << "//@}" << be_nl_2;
if (status == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("be_visitor_executor_exh::")
ACE_TEXT ("visit_component - ")
ACE_TEXT ("traverse_inheritance_graph() ")
ACE_TEXT ("failed\n")),
-1);
}
os_ << "/** @name Component attributes and port operations. */" << be_nl
<< "//@{";
status = this->visit_component_scope (node);
os_<< be_nl << "//@}" << be_nl_2;
if (status == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("be_visitor_executor_exh::")
ACE_TEXT ("visit_component - ")
ACE_TEXT ("visit_component_scope() ")
ACE_TEXT ("failed\n")),
-1);
}
os_ << "/** @name Session component operations */" << be_nl
// Operations from Components::" << be_global->ciao_container_type ()
// << "Component. */" << be_nl
<< "//@{";
const char *container_type = be_global->ciao_container_type ();
os_ << be_nl_2
<< "/// Setter for container context for this component" << be_nl
<< "/// @param[in] ctx - Container context" << be_nl
<< "virtual void set_"
<< tao_cg->downcase (container_type)
<< "_context ("
<< "::Components::" << be_global->ciao_container_type ()
<< "Context_ptr ctx);";
if (ACE_OS::strcmp (be_global->ciao_container_type (), "Session") == 0)
{
//.........这里部分代码省略.........
示例9: sname_str
int
be_visitor_context_svth::visit_component (be_component *node)
{
// This visitor is spawned by be_visitor_component_svh,
// which already does a check for imported node, so none
// is needed here.
node_ = node;
AST_Decl *scope = ScopeAsDecl (node->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *sname = sname_str.c_str ();
// No '_cxx_' prefix.
const char *lname =
node->original_local_name ()->get_string ();
const char *global = (sname_str == "" ? "" : "::");
os_ << be_nl
<< "class " << lname << "_Servant;"
<< be_nl_2;
os_ << "template <typename CONTAINER_TYPE, typename BASE>" << be_nl;
os_ << "class " << lname << "_Context_T" << be_idt_nl;
// Spec: no multiple inheritance allowed for components.
AST_Component * base = node->base_component ();
if (base)
{
const char *lbase_name =
base->original_local_name ()->get_string ();
os_ << ": public " << global << "CIAO_" << base->flat_name ()
<< "_Impl::" << lbase_name << "_Context_T<CONTAINER_TYPE, BASE>";
}
else
{
os_ << ": public BASE";
}
os_ << be_uidt_nl
<< "{" << be_nl
<< "public:" << be_idt_nl;
os_ << "/// Allow the servant to access our state." << be_nl
<< "friend class " << lname << "_Servant;"
<< be_nl_2;
// os_ << "/// Some useful typedefs." << be_nl
// << "typedef" << be_nl
// << "::CIAO::" << be_global->ciao_container_type ()
// << "_Context_Impl_T<" << be_idt << be_idt_nl
// << global << sname << "::CCM_"
// << lname << "_Context," << be_nl
// << "::" << node->name () << ">" << be_uidt_nl
// << "base_type;" << be_uidt_nl << be_nl;
//
// os_ << "typedef base_type::context_type context_type;" << be_nl
// << "typedef base_type::component_type component_type;"
// << be_nl;
AST_Decl::NodeType nt = this->node_->node_type ();
bool const is_connector = (nt == AST_Decl::NT_connector);
bool no_events = false;
if (!is_connector)
{
no_events =
(node->n_consumes () == 0UL
&& node->n_emits () == 0UL
&& node->n_publishes () == 0UL);
}
bool const de_facto = (is_connector || no_events);
os_ << "typedef ::CIAO::"
<< (de_facto ? "Connector_" : "")
<< "Servant_Impl_Base svnt_base_type;" << be_nl_2;
os_ << lname << "_Context_T (" << be_idt_nl
<< "::Components::CCMHome_ptr h," << be_nl
<< "typename CONTAINER_TYPE::_ptr_type c," << be_nl
<< "PortableServer::Servant sv," << be_nl
<< "const char *id);" << be_uidt << be_nl_2;
os_ << "virtual ~" << lname << "_Context_T (void);";
os_ << be_nl_2
<< "/** @name Operations and members for " << lname
<< " receptacles and event sources,"
<< be_nl
<< " * defined in " << global << sname
<< "::CCM_" << lname << "_Context." << be_nl << " */"
<< be_nl
<< "//@{";
if (this->visit_scope (node) == -1)
{
//.........这里部分代码省略.........
示例10: sname_str
int
be_visitor_home_svs::gen_servant_class (void)
{
AST_Decl *scope = ScopeAsDecl (node_->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *sname = sname_str.c_str ();
// Avoid '_cxx_' prefix.
const char *lname =
node_->original_local_name ()->get_string ();
const char *clname = comp_->local_name ()->get_string ();
const char *global = (sname_str == "" ? "" : "::");
os_ << be_nl
<< lname << "_Servant::"
<< lname << "_Servant (" << be_idt << be_idt_nl
<< global << sname << "::CCM_" << lname << "_ptr exe," << be_nl
<< "const char * ins_name," << be_nl
<< "::CIAO::" << be_global->ciao_container_type ()
<< "_Container_ptr c)" << be_uidt_nl
<< ": ::CIAO::Home_Servant_Impl_Base ()," << be_idt_nl
<< "::CIAO::"
<< "Home_Servant_Impl<" << be_idt_nl
<< "::" << node_->full_skel_name () << "," << be_nl
<< global << sname << "::CCM_" << lname << "," << be_nl
<< clname << "_Servant," << be_nl
<< "::CIAO::" << be_global->ciao_container_type () << "_Container> (exe, c, ins_name)"
<< be_uidt << be_uidt << be_uidt_nl
<< "{" << be_nl
<< "}";
os_ << be_nl_2
<< lname << "_Servant::~" << lname << "_Servant (void)"
<< be_nl
<< "{" << be_nl
<< "}";
if (this->node_->has_rw_attributes ())
{
os_ << be_nl_2
<< "void" << be_nl
<< lname << "_Servant::set_attributes (" << be_idt_nl
<< "const ::Components::ConfigValues & descr)"
<< be_uidt_nl
<< "{" << be_idt_nl;
os_ << "for ( ::CORBA::ULong i = 0; i < descr.length (); ++i)"
<< be_idt_nl
<< "{" << be_idt_nl
<< "const char * descr_name = descr[i]->name ();"
<< be_nl
<< "::CORBA::Any & descr_value = descr[i]->value ();";
be_visitor_home_attr_set as_visitor (this->ctx_);
if (as_visitor.visit_home (node_) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"home_svs::"
"gen_servant_class - "
"attr init visitor failed\n"),
-1);
}
os_ << be_uidt_nl
<< "}" << be_uidt << be_uidt_nl
<< "}";
}
AST_Type *pk = node_->primary_key ();
if (pk != 0)
{
os_ << be_nl_2
<< "::" << comp_->name () << "_ptr" << be_nl
<< lname << "_Servant::create (" << be_idt_nl
<< "::" << pk->name () << " * /* key */)" << be_uidt_nl
<< "{" << be_idt_nl
<< "throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8,"
<< be_nl
<< " CORBA::COMPLETED_NO);"
<< be_uidt_nl
<< "}";
if (!be_global->gen_lwccm ())
{
os_ << be_nl_2
<< "::" << comp_->name () << "_ptr" << be_nl
<< lname << "_Servant::find_by_primary_key (" << be_idt_nl
<< "::" << pk->name () << " * /* key */)" << be_uidt_nl
<< "{" << be_idt_nl
<< "throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8,"
<< be_nl
<< " CORBA::COMPLETED_NO);"
<< be_uidt_nl
<< "}";
}
os_ << be_nl_2
//.........这里部分代码省略.........
示例11: ScopeAsDecl
int
be_visitor_ami4ccm_rh_ex_idl::visit_interface (be_interface *node)
{
os_ << be_nl
<< "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__;
os_ << be_nl_2
<< "local interface AMI4CCM_"
<< node->original_local_name ()
<< "ReplyHandler" << be_idt_nl
<< ": ";
long n_parents = node->n_inherits ();
if (n_parents == 0)
{
os_ << "::CCM_AMI::ReplyHandler";
}
else
{
os_ << be_idt;
for (long i = 0; i < n_parents; ++i)
{
if (i != 0)
{
os_ << "," << be_nl;
}
AST_Type *parent = node->inherits ()[i];
AST_Decl *d = ScopeAsDecl (parent->defined_in ());
bool global = (d->node_type () == AST_Decl::NT_root);
os_ << (global ? "" : "::") << d->full_name ()
<< "::AMI4CCM_" << parent->original_local_name ()
<< "ReplyHandler";
}
os_ << be_uidt;
}
os_ << be_uidt_nl
<< "{" << be_idt;
if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("be_visitor_ami4ccm_rh_ex_idl")
ACE_TEXT ("::visit_interface - ")
ACE_TEXT ("visit_scope() failed\n")),
-1);
}
os_ << be_uidt_nl
<< "};";
return 0;
}
示例12: sname_str
int
be_visitor_context_svts::visit_component (be_component *node)
{
// This visitor is spawned by be_visitor_component_svh,
// which already does a check for imported node, so none
// is needed here.
node_ = node;
AST_Decl *scope = ScopeAsDecl (node->defined_in ());
ACE_CString sname_str (scope->full_name ());
const char *lname = node_->local_name ();
const char *global = (sname_str == "" ? "" : "::");
os_ << be_nl
<< "template <typename CONTAINER_TYPE, typename BASE>" << be_nl
<< lname <<"_Context_T<CONTAINER_TYPE, BASE>::"
<< lname << "_Context_T ("
<< be_idt << be_idt_nl
<< "::Components::CCMHome_ptr h," << be_nl
<< "typename CONTAINER_TYPE::_ptr_type c," << be_nl
<< "PortableServer::Servant sv," << be_uidt_nl
<< "const char *id)" << be_uidt_nl
<< ": ::CIAO::Context_Impl_Base_T <CONTAINER_TYPE> (h, c, id),"
<< be_idt_nl;
// Spec: no multiple inheritance allowed for components.
AST_Component * base = node->base_component ();
if (base)
{
const char *lbase_name =
base->original_local_name ()->get_string ();
os_ << global << "CIAO_" << base->flat_name ()
<< "_Impl::" << lbase_name << "_Context_T<CONTAINER_TYPE, BASE>";
}
else
{
os_ << "BASE";
}
os_ << " (h, c, sv, id)";
os_ << be_uidt_nl
<< "{" << be_nl
<< "}";
os_ << be_nl_2
<< "template <typename CONTAINER_TYPE, typename BASE>" << be_nl
<< lname << "_Context_T<CONTAINER_TYPE, BASE>::~"
<< lname << "_Context_T (void)" << be_nl
<< "{" << be_nl
<< "}";
if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("be_visitor_context_svts")
ACE_TEXT ("::visit_component - ")
ACE_TEXT ("visit_component_scope() ")
ACE_TEXT ("failed\n")),
-1);
}
return 0;
}