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


C++ TAO_OutputCDR::write_long方法代码示例

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


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

示例1: INTERNAL

CORBA::Boolean
CORBA::ValueBase::_tao_write_repository_id (TAO_OutputCDR &strm,
                                            ACE_CString& id)
{
#ifdef TAO_HAS_VALUETYPE_OUT_INDIRECTION

  VERIFY_MAP (TAO_OutputCDR, repo_id_map, Repo_Id_Map);
  char* pos = 0;
  if (strm.get_repo_id_map ()->get()->find (id, pos) == 0)
  {
    if (!strm.write_long (TAO_OBV_GIOP_Flags::Indirection_tag))
      {
        return false;
      }
    CORBA::Long offset= -strm.offset (pos);
    if (TAO_debug_level)
      {
        TAOLIB_DEBUG ((LM_DEBUG,
          ACE_TEXT ("TAO (%P|%t) - %N:%l ValueBase::_tao_write_repository_id,  id %C indirection %d\n"),
          id.c_str(), offset));
      }
    if (!strm.write_long (offset))
      {
        return false;
      }
  }
  else
  {
    if (strm.align_write_ptr (ACE_CDR::LONG_SIZE) != 0)
      {
        throw CORBA::INTERNAL ();
      }
    if (strm.get_repo_id_map ()->get ()->bind (id, strm.current()->wr_ptr ()) != 0)
      {
        throw CORBA::INTERNAL ();
      }
    if (TAO_debug_level)
      {
        TAOLIB_DEBUG ((LM_DEBUG,
          ACE_TEXT ("TAO (%P|%t) - %N:%l ValueBase::_tao_write_repository_id, bound %C - %x\n"),
          id.c_str (), strm.current()->wr_ptr ()));
      }
    if (! strm.write_string (id.c_str ()))
      {
        return false;
      }
  }
#else
  if (! strm.write_string (id.c_str ()))
    {
      return 0;
    }
#endif

  return 1;
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:56,代码来源:ValueBase.cpp

示例2:

CORBA::Boolean
TAO_ChunkInfo::reserve_chunk_size(TAO_OutputCDR &strm)
{
  // This is called in the start_chunk().
  // Reserve the chunk size the first time the start_chunk () is called
  // if there are several start_chunk () called continuously without
  // calling end_chunk (). This could happen in the _tao_marshal_state()
  // in the most derived valuetype.

  if (this->chunk_size_pos_ == 0)
    {
      // Align the wr_ptr before we reserve the space for chunk size.
      strm.align_write_ptr (ACE_CDR::LONG_SIZE);
      // Remember begin of the chunk (at chunk size position) that is needed
      // when we write back actual chunk size to the stream.
      this->chunk_size_pos_ = strm.current ()->wr_ptr ();

      // Insert four bytes here as a place-holder, we need to go back
      // later and write the actual size.
      if (! strm.write_long (0))
        {
          return 0;
        }

      // Remember length before writing chunk data. This is used to calculate
      // the actual size of the chunk.
      this->length_to_chunk_octets_pos_ = strm.total_length ();
    }

  return 1;
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:31,代码来源:ValueBase.cpp

示例3: return

CORBA::Boolean
operator<< (TAO_OutputCDR & cdr, CORBA::Principal * x)
{
  if (x != 0)
    {
      CORBA::ULong length  = x->id.length ();
      cdr.write_long (length);
      cdr.write_octet_array (x->id.get_buffer (), length);
    }
  else
    {
      cdr.write_ulong (0);
    }

  return (CORBA::Boolean) cdr.good_bit ();
}
开发者ID:asdlei00,项目名称:ACE,代码行数:16,代码来源:Principal.cpp

示例4:

static int
test_write (TAO_OutputCDR &cdr, int n)
{
  CORBA::Long l = 0xdeadbeef;

  for (int i = 0; i < n; ++i)
    {
      if (cdr.write_long (l) == 0)
        ACE_ERROR_RETURN ((LM_ERROR,
                           "write_long[%d] failed\n",
                           i),
                          1);
    }

  return 0;
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:16,代码来源:growth.cpp


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