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


C++ TAO_InputCDR::align_read_ptr方法代码示例

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


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

示例1: _tao_unmarshal_value_indirection

CORBA::Boolean
CORBA::ValueBase::_tao_unmarshal_pre (
  TAO_InputCDR &strm,
  CORBA::ValueBase *&valuetype,
  const char *const fallback_repo_id,
  CORBA::Boolean &is_null_object,
  CORBA::Boolean &is_indirected)
{
  // %! yet much to do ... look for +++ !

  // 1. Get the <value-tag> (else it may be <indirection-tag> or <null-ref>).
  //    Is object yet unmarshalled (<indirection-tag> is set) ? (->1a)
  //    Is <null-ref> given ? Set 0 and return ok.
  // 1a. Lookup the real address in memory, which should be aligned +++
  //     to CORBA::ValueBase. Its possible at this point that worse
  //     type mismatch gets by undetected, if the CDR stream fakes.
  //     So the type should be checked ... +++

  // 2. Now at this point it must be a <value-tag> (error else).
  //    if (chunking) check that any last chunk ends with matching
  //    size. If not raise marshal exception.
  //    Increase the nesting level of valuetypes.

  // 3. if (chunking) read and record the blocksize-tag.

  // 4. Unmarshal type information and lookup factory.
  //    If no type information is given in the CDR encoding, as told
  //    from the <value-tag>, then use the repository id parameter
  //    (it _must_ be right).

  CORBA::Boolean is_chunked = false;

  // Save the position of the start of the ValueType
  // to allow caching for later indirection.
  if (strm.align_read_ptr (ACE_CDR::LONG_SIZE))
    {
      return false;
    }
  void *const start_of_valuetype = strm.rd_ptr();

  Repository_Id_List ids;
  CORBA::Boolean result =
    CORBA::ValueBase::_tao_unmarshal_header (
      strm, fallback_repo_id, ids,
      is_null_object, is_indirected, is_chunked);

  if (!result || is_null_object)
    {
      valuetype = 0;
      return result;
    }
  if (is_indirected)
    {
      return _tao_unmarshal_value_indirection (strm, valuetype);
    }

  CORBA::ValueBase::_tao_unmarshal_find_factory (
    strm, start_of_valuetype, valuetype, ids, is_chunked);

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


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