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


C++ ACE_Log_Record::pid方法代码示例

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


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

示例1:

  ssize_t
  NDDS_Log_Backend::log (ACE_Log_Record  &log_record)
  {
    Log_Record *instance (0);

    instance = Log_RecordTypeSupport::create_data_ex (DDS_BOOLEAN_FALSE);

    if (instance == 0)
      {
        ACE_ERROR ((LM_EMERGENCY, ACE_TEXT ("Unable to create data sample for log record\n")));
        return 0;
      }

    instance->node = this->node_.c_str ();
    instance->pid = log_record.pid ();
    instance->pid = log_record.pid ();
    instance->message = ACE_TEXT_ALWAYS_CHAR (log_record.msg_data ());

    DDS_ReturnCode_t const retval =
      this->log_record_writer_->write (*instance, DDS_HANDLE_NIL);

    if (retval != DDS_RETCODE_OK)
      {
        ACE_ERROR ((LM_EMERGENCY, ACE_TEXT ("Unable to write log record to DDS\n")));
        return 0;
      }

    if (instance != 0)
      {
        Log_RecordTypeSupport::delete_data_ex (instance,
                                               DDS_BOOLEAN_FALSE);
      }

    return log_record.msg_data_len ();
  }
开发者ID:DOCGroup,项目名称:DAnCE,代码行数:35,代码来源:Log_Backend.cpp

示例2: defined

int
operator<< (ACE_OutputCDR &cdr,
            const ACE_Log_Record &log_record)
{
  // The written message length can't be more than 32 bits (ACE_CDR::ULong)
  // so reduce it here if needed.
  ACE_CDR::ULong u_msglen =
    ACE_Utils::truncate_cast<ACE_CDR::ULong> (log_record.msg_data_len ());

  // Insert each field from <log_record> into the output CDR stream.
  cdr << ACE_CDR::Long (log_record.type ());
  cdr << ACE_CDR::Long (log_record.pid ());
  cdr << ACE_CDR::LongLong (log_record.time_stamp ().sec ());
  cdr << ACE_CDR::Long (log_record.time_stamp ().usec ());
  cdr << u_msglen;
#if defined (ACE_USES_WCHAR)
  cdr.write_wchar_array (log_record.msg_data (), u_msglen);
#else
  cdr.write_char_array (log_record.msg_data (), u_msglen);
#endif /* ACE_USES_WCHAR */
  return cdr.good_bit ();
}
开发者ID:Amara1231,项目名称:blizzlikecore,代码行数:22,代码来源:Log_Record.cpp


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