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


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

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


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

示例1:

void
be_component::gen_skel_inheritance (TAO_OutStream *os)
{
  AST_Component *base = this->base_component ();

  if (base != 0)
    {
      *os << "public virtual POA_" << base->name ();
    }
  else
    {
      *os << "public virtual POA_Components::CCMObject";
    }

  long nsupports = this->n_inherits ();
  AST_Type **supports = this->supports ();
  AST_Type *supported = 0;

  for (long i = 0; i < nsupports; ++i)
    {
      supported = supports[i];

      if (supported->is_abstract ())
        {
          continue;
        }

      *os << "," << be_nl;
      *os << "public virtual POA_" << supported->name ();
    }
}
开发者ID:asdlei00,项目名称:ACE,代码行数:31,代码来源:be_component.cpp

示例2:

// 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.
//.........这里部分代码省略.........
开发者ID:asdlei00,项目名称:ACE,代码行数:101,代码来源:valuetype_obv_ch.cpp


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