本文整理汇总了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 ();
}
示例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 ();
}