本文整理汇总了C++中AST_Type::local_name方法的典型用法代码示例。如果您正苦于以下问题:C++ AST_Type::local_name方法的具体用法?C++ AST_Type::local_name怎么用?C++ AST_Type::local_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AST_Type
的用法示例。
在下文中一共展示了AST_Type::local_name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
// Dump this AST_Operation node (an operation) to the ostream o.
void
AST_Operation::dump (ACE_OSTREAM_TYPE &o)
{
AST_Decl *d = 0;
AST_Type *e = 0;
UTL_String *s = 0;
if (this->pd_flags == OP_oneway)
{
this->dump_i (o, "oneway ");
}
else if (this->pd_flags == OP_idempotent)
{
this->dump_i (o, "idempotent ");
}
this->pd_return_type->name ()->dump (o);
this->dump_i (o, " ");
this->local_name ()->dump (o);
this->dump_i (o, "(");
// Must advance the iterator explicity inside the loop.
for (UTL_ScopeActiveIterator i (this, IK_decls); !i.is_done ();)
{
d = i.item ();
d->dump (o);
i.next ();
if (!i.is_done())
{
this->dump_i (o, ", ");
}
}
this->dump_i (o, ")");
if (this->pd_exceptions != 0)
{
this->dump_i (o, " raises(");
// Must advance the iterator explicity inside the loop.
for (UTL_ExceptlistActiveIterator ei (this->pd_exceptions);
!ei.is_done ();)
{
e = ei.item ();
ei.next ();
e->local_name ()->dump (o);
if (!ei.is_done())
{
this->dump_i (o, ", ");
}
}
this->dump_i (o, ")");
}
if (this->pd_context != 0)
{
this->dump_i (o, " context(");
// Must advance the iterator explicity inside the loop.
for (UTL_StrlistActiveIterator si (this->pd_context); !si.is_done();)
{
s = si.item ();
si.next ();
this->dump_i (o, s->get_string ());
if (!si.is_done())
{
this->dump_i (o, ", ");
}
}
this->dump_i (o, ")");
}
}
示例2: comp_sname_str
int
be_visitor_servant_svs::visit_consumes (be_consumes *node)
{
AST_Type *obj = node->consumes_type ();
const char *port_name = node->local_name ()->get_string ();
const char *comp_lname = node_->local_name ();
ACE_CString comp_sname_str (
ScopeAsDecl (node_->defined_in ())->full_name ());
const char *comp_sname = comp_sname_str.c_str ();
const char *global = (comp_sname_str == "" ? "" : "::");
const char *lname = obj->local_name ()->get_string ();
const char *fname = obj->full_name ();
os_ << be_nl_2
<< comp_lname << "_Servant::" << lname << "Consumer_"
<< port_name << "_Servant::" << lname << "Consumer_"
<< port_name << "_Servant (" << be_idt << be_idt_nl
<< global << comp_sname << "::CCM_" << comp_lname
<< "_ptr executor," << be_nl
<< global << comp_sname << "::CCM_" << comp_lname
<< "_Context_ptr c)" << be_uidt_nl
<< ": executor_ ( " << global << comp_sname << "::CCM_"
<< comp_lname << "::_duplicate (executor))," << be_idt_nl
<< "ctx_ ( " << global << comp_sname
<< "::CCM_" << comp_lname
<< "_Context::_duplicate (c))" << be_uidt << be_uidt_nl
<< "{" << be_nl
<< "}";
os_ << be_nl_2
<< comp_lname << "_Servant::" << lname << "Consumer_"
<< port_name << "_Servant::~" << lname << "Consumer_"
<< port_name << "_Servant (void)" << be_nl
<< "{" << be_nl
<< "}";
os_ << be_nl_2
<< "::CORBA::Object_ptr" << be_nl
<< comp_lname << "_Servant::" << lname << "Consumer_"
<< port_name << "_Servant::_get_component (void)" << be_nl
<< "{" << be_idt_nl;
if (ACE_OS::strcmp (be_global->ciao_container_type (), "Session") == 0)
{
os_ << "return this->ctx_->get_CCM_object ();";
}
else
{
os_ << "return ::CORBA::Object::_nil ();";
}
os_ << be_uidt_nl << "}";
os_ << be_nl_2
<< "void" << be_nl
<< comp_lname << "_Servant::" << lname << "Consumer_"
<< port_name << "_Servant::push_" << lname
<< " (" << be_idt_nl
<< "::" << fname << " * evt)" << be_uidt_nl
<< "{" << be_idt_nl
<< "this->executor_->push_" << port_name
<< " (evt);" << be_uidt_nl
<< "}";
os_ << be_nl_2
<< "/// Inherited from ::Components::EventConsumerBase."
<< be_nl
<< "void" << be_nl
<< comp_lname << "_Servant::" << lname << "Consumer_"
<< port_name << "_Servant::push_event (" << be_idt_nl
<< "::Components::EventBase * ev)" << be_uidt_nl
<< "{" << be_idt_nl
<< "::" << fname << " * ev_type =" << be_idt_nl
<< "::" << fname << "::_downcast (ev);"
<< be_uidt_nl << be_nl
<< "if (ev_type != 0)" << be_idt_nl
<< "{" << be_idt_nl
<< "this->push_" << lname << " (ev_type);" << be_nl
<< "return;" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl
<< "throw ::Components::BadEventType ();" << be_uidt_nl
<< "}";
if (!be_global->gen_lwccm ())
{
os_ << be_nl_2
<< "::" << fname << "Consumer_ptr" << be_nl
<< node_->local_name () << "_Servant::get_consumer_"
<< port_name << " (void)" << be_nl
<< "{" << be_idt_nl
<< "return" << be_idt_nl
<< "::" << fname << "Consumer::_duplicate (" << be_idt_nl
<< "this->consumes_" << port_name << "_.in ());"
<< be_uidt << be_uidt << be_uidt_nl
<< "}";
}
os_ << be_nl_2
//.........这里部分代码省略.........
示例3:
int
be_visitor_context_svts::visit_emits (be_emits *node)
{
AST_Type *obj = node->emits_type ();
const char *port_name =
node->local_name ()->get_string ();
const char *fname = obj->full_name ();
const char *lname = obj->local_name ()->get_string ();
os_ << be_nl_2
<< "template <typename CONTAINER_TYPE, typename BASE>" << be_nl
<< "void" << be_nl
<< node_->local_name () << "_Context_T<CONTAINER_TYPE, BASE>::push_" << port_name
<< " (" << be_idt_nl
<< "::" << fname << " * ev)" << be_uidt_nl
<< "{" << be_idt_nl
<< "if (! ::CORBA::is_nil (this->ciao_emits_"
<< port_name << "_consumer_.in ()))" << be_idt_nl
<< "{" << be_idt_nl
<< "this->ciao_emits_" << port_name << "_consumer_->push_"
<< lname << " (ev);" << be_uidt_nl
<< "}" << be_uidt << be_uidt_nl
<< "}";
os_ << be_nl_2
<< "template <typename CONTAINER_TYPE, typename BASE>" << be_nl
<< "void" << be_nl
<< node_->local_name () << "_Context_T<CONTAINER_TYPE, BASE>::connect_" << port_name
<< " (" << be_idt_nl
<< "::" << fname << "Consumer_ptr c)" << be_uidt_nl
<< "{" << be_idt_nl
<< "if ( ::CORBA::is_nil (c))" << be_idt_nl
<< "{" << be_idt_nl
<< "throw ::Components::InvalidConnection ();" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl
<< "if (! ::CORBA::is_nil (this->ciao_emits_"
<< port_name << "_consumer_.in ()))" << be_idt_nl
<< "{" << be_idt_nl
<< "throw ::Components::AlreadyConnected ();" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl
<< "this->ciao_emits_" << port_name
<< "_consumer_ =" << be_idt_nl
<< "::" << fname << "Consumer::_duplicate (c);"
<< be_uidt << be_uidt_nl
<< "}";
os_ << be_nl_2
<< "template <typename CONTAINER_TYPE, typename BASE>" << be_nl
<< "::" << fname << "Consumer_ptr" << be_nl
<< node_->local_name () << "_Context_T<CONTAINER_TYPE, BASE>::disconnect_"
<< port_name << " (void)" << be_nl
<< "{" << be_idt_nl
<< "::" << fname << "Consumer_var ciao_emits_" << port_name << " =" << be_idt_nl
<< "this->ciao_emits_" << port_name << "_consumer_._retn ();" << be_uidt_nl << be_nl
<< "if ( ::CORBA::is_nil (ciao_emits_"
<< port_name << ".in ()))" << be_idt_nl
<< "{" << be_idt_nl
<< "throw ::Components::NoConnection ();" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl
<< "return ciao_emits_" << port_name
<< "._retn ();" << be_uidt_nl
<< "}";
return 0;
}
示例4: 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;
}
示例5: sname_str
int
be_visitor_context_svts::visit_publishes (be_publishes *node)
{
AST_Type *obj = node->publishes_type ();
const char *port_name =
node->local_name ()->get_string ();
const char *fname = obj->full_name ();
const char *lname = obj->local_name ()->get_string ();
ACE_CString sname_str (
ScopeAsDecl (obj->defined_in ())->full_name ());
os_ << be_nl_2
<< "template <typename CONTAINER_TYPE, typename BASE>" << be_nl
<< "void" << be_nl
<< node_->local_name () << "_Context_T<CONTAINER_TYPE, BASE>::push_"
<< port_name << " (" << be_idt_nl
<< "::" << fname << " * ev)" << be_uidt_nl
<< "{" << be_idt_nl;
os_ << "ACE_GUARD (TAO_SYNCH_MUTEX," << be_nl
<< " mon," << be_nl
<< " this->" << port_name
<< "_lock_);" << be_nl_2;
os_ << "for (" << tao_cg->upcase (port_name)
<< "_TABLE::const_iterator iter =" << be_nl
<< " this->ciao_publishes_" << port_name
<< "_.begin ();" << be_nl
<< " iter != this->ciao_publishes_" << port_name
<< "_.end ();" << be_nl
<< " ++iter)" << be_idt_nl
<< "{" << be_idt_nl
<< "iter->second->push_" << lname << " (ev);"
<< be_uidt_nl
<< "}" << be_uidt << be_uidt_nl
<< "}";
os_ << be_nl_2
<< "template <typename CONTAINER_TYPE, typename BASE>" << be_nl
<< "::Components::Cookie *" << be_nl
<< node_->local_name () << "_Context_T<CONTAINER_TYPE, BASE>::subscribe_"
<< port_name << " (" << be_idt_nl
<< "::" << fname << "Consumer_ptr c)" << be_uidt_nl
<< "{" << be_idt_nl
<< "if ( ::CORBA::is_nil (c))" << be_idt_nl
<< "{" << be_idt_nl
<< "throw ::Components::InvalidConnection ();" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl;
os_ << "ptrdiff_t const ptr = reinterpret_cast<ptrdiff_t> (c);"
<< be_nl_2;
os_ << "{" << be_idt_nl
<< "ACE_GUARD_RETURN (TAO_SYNCH_MUTEX," << be_nl
<< " mon," << be_nl
<< " this->" << port_name
<< "_lock_," << be_nl
<< " 0);";
os_ << be_nl_2
<< "::" << fname << "Consumer_var ciao_var = " << be_idt_nl
<< "::" << fname << "Consumer::_duplicate (c);" << be_uidt << be_nl_2
<< "std::pair<" << tao_cg->upcase (port_name) <<"_TABLE::iterator, bool> ret =" << be_idt_nl
<< "this->ciao_publishes_" << port_name
<< "_.insert (" << be_idt_nl << tao_cg->upcase (port_name)
<< "_TABLE::value_type (ptr, ciao_var.in ()));"
<< be_uidt << be_uidt_nl
<< "if (!ret.second)" << be_idt_nl
<< "{" << be_idt_nl
<< "throw ::Components::AlreadyConnected ();" << be_uidt_nl
<< "}" << be_uidt_nl
<< "ciao_var._retn ();" << be_uidt_nl
<< "}";
os_ << be_nl
<< be_nl
<< "::Components::Cookie * retv = 0;" << be_nl
<< "ACE_NEW_THROW_EX (retv," << be_nl
<< " ::CIAO::Cookie_Impl (ptr),"
<< be_nl
<< " ::CORBA::NO_MEMORY ());"
<< be_nl_2
<< "return retv;" << be_uidt_nl
<< "}";
os_ << be_nl_2
<< "template <typename CONTAINER_TYPE, typename BASE>" << be_nl
<< "::" << fname << "Consumer_ptr" << be_nl
<< node_->local_name () << "_Context_T<CONTAINER_TYPE, BASE>::unsubscribe_"
<< port_name << " (" << be_idt_nl
<< "::Components::Cookie * ck)" << be_uidt_nl
<< "{" << be_idt_nl
<< "ptrdiff_t key = 0UL;" << be_nl_2
<< "if (ck == 0 || ! ::CIAO::Cookie_Impl::extract (ck, key))"
<< be_idt_nl
<< "{" << be_idt_nl
<< "throw ::Components::InvalidConnection ();" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl;
os_ << "{" << be_idt_nl
//.........这里部分代码省略.........