当前位置: 首页>>代码示例>>C++>>正文


C++ AST_Type::repoID方法代码示例

本文整理汇总了C++中AST_Type::repoID方法的典型用法代码示例。如果您正苦于以下问题:C++ AST_Type::repoID方法的具体用法?C++ AST_Type::repoID怎么用?C++ AST_Type::repoID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AST_Type的用法示例。


在下文中一共展示了AST_Type::repoID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

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;
}
开发者ID:DOCGroup,项目名称:ACE_TAO,代码行数:33,代码来源:servant_svs.cpp

示例2: 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;
}
开发者ID:DOCGroup,项目名称:ACE_TAO,代码行数:55,代码来源:servant_svs.cpp

示例3: comp_sname_str


//.........这里部分代码省略.........
    }

  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
      << "void" << be_nl
      << node_->local_name () << "_Servant::setup_consumer_"
      << 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
      << node_->local_name () << "_Servant::" << lname
      << "Consumer_" << port_name << "_Servant *"
      << port_name << "_servant_impl = " << be_idt_nl
      << "new "   << node_->local_name () << "_Servant::" << lname
      << "Consumer_" << port_name << "_Servant (" << be_idt_nl
      << " this->executor_, this->context_);" << be_uidt_nl << be_uidt_nl << be_nl
      << "PortableServer::ServantBase_var safe_base_servant ("
      << port_name << "_servant_impl);" << 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(" << be_idt_nl
      << port_name << "_servant_oid.in()," << be_nl
      <<  port_name << "_servant_impl);" << be_uidt_nl << 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
      << "\"";

      ACE_CString work (obj->repoID ());
      ACE_CString result (work.substr (0, work.rfind (':')));
      result += "Consumer:1.0";

      os_ << result.c_str ();

      os_ << "\"," << be_nl
      << "::CIAO::Container_Types::FACET_CONSUMER_t);"
      << be_uidt_nl << be_uidt_nl
      << "::Components::EventConsumerBase_var ecb =" << be_idt_nl
      << "::Components::EventConsumerBase::_narrow ("
      << port_name << "_servant_impl_obj.in ());"
      << be_uidt_nl << be_nl
      << "this->add_consumer (\"" << port_name << "\", ecb.in ());"
      << be_uidt_nl
      << "}";

  return 0;
}
开发者ID:DOCGroup,项目名称:ACE_TAO,代码行数:101,代码来源:servant_svs.cpp

示例4: exceptions

int
ifr_adding_visitor_operation::visit_operation (AST_Operation *node)
{
  try
    {
      // If this operation is already in the repository (for example, if
      // we are processing the IDL file a second time inadvertently), we
      // just return 0. The IDL file must be legal, otherwise the IDL
      // compiler front end would have told us.

      CORBA::Contained_var prev_def =
        be_global->repository ()->lookup_id (node->repoID ());

      if (!CORBA::is_nil (prev_def.in ()))
        {
          return 0;
        }

      // Build the parameter list. Our overridden version of visit_argument
      // will look up each parameter and add its repository entry to
      // our params_ member.

      CORBA::ULong length = static_cast<CORBA::ULong> (node->argument_count ());

      this->params_.length (length);

      if (this->visit_scope (node) == -1)
        {
          ORBSVCS_ERROR_RETURN ((
              LM_ERROR,
              ACE_TEXT ("(%N:%l) ifr_adding_visitor_operation::")
              ACE_TEXT ("visit_operation -")
              ACE_TEXT (" visit_scope failed\n")
            ),
            -1
          );
        }

      this->index_ = 0;

      // Build the exception list.

      UTL_ExceptList *excepts = node->exceptions ();

      if (excepts != 0)
        {
          length = static_cast<CORBA::ULong> (excepts->length ());
        }
      else
        {
          length = 0;
        }

      CORBA::ExceptionDefSeq exceptions (length);
      exceptions.length (length);

      AST_Type *ex = 0;
      CORBA::ULong i = 0;

      for (UTL_ExceptlistActiveIterator ex_iter (excepts);
           !ex_iter.is_done ();
           ex_iter.next (), ++i)
        {
          ex = ex_iter.item ();

          prev_def =
            be_global->repository ()->lookup_id (ex->repoID ());

          exceptions[i] =
            CORBA::ExceptionDef::_narrow (prev_def.in ());
        }

      // Build the context list.

      UTL_StrList *ctx_list = node->context ();

      if (ctx_list != 0)
        {
          length = static_cast<CORBA::ULong> (ctx_list->length ());
        }
      else
        {
          length = 0;
        }

      CORBA::ContextIdSeq contexts (length);
      contexts.length (length);

      UTL_StrlistActiveIterator ctx_iter (ctx_list);
      UTL_String *str = 0;
      i = 0;

      while (!ctx_iter.is_done ())
        {
          str = ctx_iter.item ();

          contexts[i++] = str->get_string ();

          ctx_iter.next ();
        }
//.........这里部分代码省略.........
开发者ID:CCJY,项目名称:ATCD,代码行数:101,代码来源:ifr_adding_visitor_operation.cpp


注:本文中的AST_Type::repoID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。