本文整理汇总了C++中AST_Type::full_name方法的典型用法代码示例。如果您正苦于以下问题:C++ AST_Type::full_name方法的具体用法?C++ AST_Type::full_name怎么用?C++ AST_Type::full_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AST_Type
的用法示例。
在下文中一共展示了AST_Type::full_name方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prefix
int
be_visitor_receptacle_desc::visit_uses (be_uses *node)
{
ACE_CString prefix (this->ctx_->port_prefix ());
prefix += node->local_name ()->get_string ();
const char *port_name = prefix.c_str ();
AST_Type *obj = node->uses_type ();
bool const is_multiple = node->is_multiple ();
os_ << be_nl_2;
ACE_CString sname_str (comp_->full_name ());
const char *sname = sname_str.c_str ();
const char *global = (sname_str == "" ? "" : "::");
if (!is_multiple)
{
os_ << obj->full_name () << "_var ciao_"
<< port_name << " = " << be_idt_nl
<< "this->context_->get_connection_"
<< port_name << " ();" << be_uidt_nl;
}
else
{
os_ << "::" << sname << global << port_name << "Connections_var ciao_"
<< port_name << " = " << be_idt_nl
<< "this->context_->get_connections_"
<< port_name << " ();" << be_uidt_nl;
}
os_ << "::CIAO::Servant::describe_"
<< (is_multiple ? "multiplex" : "simplex")
<< "_receptacle<" << be_idt_nl;
if (!is_multiple)
{
os_ << "::" << obj->full_name () << "> (" << be_idt_nl;
}
else
{
os_ << "::" << sname << global << port_name << "Connections> (" << be_idt_nl;
}
os_ << "\"" << port_name << "\"," << be_nl
<< "\"" << obj->repoID () << "\"," << be_nl;
os_ << "ciao_" << port_name << ".in ()," << be_nl;
os_ << "safe_retval," << be_nl
<< slot_++ << "UL);" << be_uidt << be_uidt;
return 0;
}
示例2:
int
be_visitor_event_source_desc::visit_publishes (
be_publishes *node)
{
AST_Type *obj = node->publishes_type ();
const char *port_name =
node->local_name ()->get_string ();
os_ << be_nl_2;
os_ << "{" << be_idt_nl
<< "ACE_GUARD_RETURN (TAO_SYNCH_MUTEX," << be_nl
<< " mon," << be_nl
<< " this->context_->"
<< port_name << "_lock_," << be_nl
<< " 0);" << be_nl_2;
os_ << "::CIAO::Servant::describe_pub_event_source<"
<< be_idt_nl
<< "::" << obj->full_name () << "Consumer_var> ("
<< be_idt_nl
<< "\"" << port_name << "\"," << be_nl
<< "\"" << obj->repoID () << "\"," << be_nl
<< "this->context_->ciao_publishes_"
<< port_name << "_," << be_nl
<< "safe_retval," << be_nl
<< slot_++ << "UL);" << be_uidt << be_uidt;
os_ << be_uidt_nl
<< "}";
return 0;
}
示例3: 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
//.........这里部分代码省略.........
示例4:
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;
}
示例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
//.........这里部分代码省略.........
示例6:
// OBV_ class must be in OBV_ namespace.
int
be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node)
{
// Only visit non-abstract non-imported valuetype.
if (node->is_abstract () || node->imported ())
{
return 0;
}
TAO_OutStream *os = this->ctx_->stream ();
*os << be_nl_2 << "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__ ;
// OBV_ class maps only to a typedef if we are optimizing accessors.
if (node->opt_accessor ())
{
*os << be_nl_2 << "typedef " << node->full_name () << " ";
if (!node->is_nested ())
{
*os << "OBV_";
}
*os << node->local_name () << ";" << be_nl;
}
else
{
*os << be_nl_2 << "// OBV_ class" << be_nl;
*os << "class " << be_global->stub_export_macro() << " ";
if (!node->is_nested())
{
*os << "OBV_";
}
*os << node->local_name () << be_idt_nl
<< ": public virtual "
<< node->full_name ();
// STEP 1 (about which previous implementer forgot ):
// Generate inheritance from corresponding OBV_ classes.
//------>>>
// Here we need to be careful. There are few cases to consider:
//
// (1) We have VT with concrete factory and no inhereted VT with
// concrete factory then we need to mix-in RefCounter
//
// (2) We have VT with concerete factory and inheretence from
// another (not abstract or empty abstract <would like to
// know how to go there>) then its OBV_ already has mix-in
//
// (3) We have VT that supports an abstract interface. In this case,
// we will add implementations of _add_ref and _remove_ref that
// call this->DefaultValueRefCountBase and so it must be mixed in
//
// (4) The rest. Don't need to bother about anything, just inherit
// whatever there is.
//
int i = 0;
AST_Type *inherited = 0;
for (; i < node->n_inherits (); ++i)
{
inherited = node->inherits ()[i];
// We need only concrete valuetypes.
if (inherited->is_abstract ())
{
continue;
}
*os << "," << be_nl;
// dump the scoped name.
*os << " public virtual OBV_";
*os << inherited->full_name();
} // end of for loop
if (this->obv_need_ref_counter (node))
{
*os << "," << be_nl;
// dump the scoped name.
*os << " public virtual ::CORBA::DefaultValueRefCountBase";
}
*os << be_uidt_nl;
//------>>>
// STEP 2: Generate the body ==
*os << "{";
// Generate code for the OBV_ class definition.
//.........这里部分代码省略.........