本文整理汇总了C++中ACE_Log_Record::time_stamp方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_Log_Record::time_stamp方法的具体用法?C++ ACE_Log_Record::time_stamp怎么用?C++ ACE_Log_Record::time_stamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_Log_Record
的用法示例。
在下文中一共展示了ACE_Log_Record::time_stamp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defined
void
MFC_Log::log(ACE_Log_Record& log_record)
{
unsigned long priority = log_record.type();
char Message[512];
ACE_OS::sprintf(Message,"%d.%03ld %s", log_record.time_stamp().sec(),
log_record.time_stamp().usec()/ 1000, log_record.msg_data());
#if defined (ACE_WIN32)
::OutputDebugString(Message);
#endif /* ACE_WIN32 */
}
示例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 ();
}