#include "ace/Log_Priority.h"#include "ace/ACE_export.h"#include "ace/Default_Constants.h"#include "ace/Basic_Types.h"#include "ace/iosfwd.h"#include "ace/Log_Record.inl"Include dependency graph for Log_Record.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Classes | |
| class | ACE_Log_Record |
| Defines the structure of an ACE logging record. More... | |
Functions | |
| ACE_Export int | operator>> (ACE_InputCDR &cdr, ACE_Log_Record &log_record) |
| ACE_Export int | operator<< (ACE_OutputCDR &cdr, const ACE_Log_Record &log_record) |
Variables | |
| ACE_BEGIN_VERSIONED_NAMESPACE_DECL class | ACE_Time_Value |
Definition in file Log_Record.h.
|
||||||||||||
|
Definition at line 291 of file Log_Record.cpp. References ACE_OutputCDR::good_bit(), ACE_CDR::Long, ACE_Log_Record::msg_data(), ACE_Log_Record::msg_data_len(), ACE_Log_Record::pid(), ACE_Time_Value::sec(), ACE_Log_Record::time_stamp(), ACE_Log_Record::type(), ACE_CDR::ULong, ACE_Time_Value::usec(), ACE_OutputCDR::write_char_array(), and ACE_OutputCDR::write_wchar_array().
00293 {
00294 size_t msglen = log_record.msg_data_len ();
00295 // The ACE_Log_Record::msg_data () function is non-const, since it
00296 // returns a non-const pointer to internal class members. Since we
00297 // know that no members are modified here, we can safely const_cast
00298 // the log_record parameter without violating the interface
00299 // contract.
00300 ACE_Log_Record &nonconst_record = (const_cast<ACE_Log_Record&> (log_record));
00301 // Insert each field from <log_record> into the output CDR stream.
00302 cdr << ACE_CDR::Long (log_record.type ());
00303 cdr << ACE_CDR::Long (log_record.pid ());
00304 cdr << ACE_CDR::Long (log_record.time_stamp ().sec ());
00305 cdr << ACE_CDR::Long (log_record.time_stamp ().usec ());
00306 cdr << ACE_CDR::ULong (msglen);
00307 #if defined (ACE_USES_WCHAR)
00308 cdr.write_wchar_array (nonconst_record.msg_data (), msglen);
00309 #else
00310 cdr.write_char_array (nonconst_record.msg_data (), msglen);
00311 #endif /* ACE_USES_WCHAR */
00312 return cdr.good_bit ();
00313 }
|
|
||||||||||||
|
Definition at line 316 of file Log_Record.cpp. References ACE_TCHAR, ACE_InputCDR::good_bit(), ACE_CDR::Long, ACE_Log_Record::pid(), ACE_InputCDR::read_char_array(), ACE_InputCDR::read_wchar_array(), ACE_Log_Record::set_msg_data_ptr(), ACE_Log_Record::time_stamp(), ACE_Log_Record::type(), and ACE_CDR::ULong.
00318 {
00319 ACE_CDR::Long type;
00320 ACE_CDR::Long pid;
00321 ACE_CDR::Long sec, usec;
00322 ACE_CDR::ULong buffer_len;
00323
00324 // Extract each field from input CDR stream into <log_record>.
00325 if ((cdr >> type) && (cdr >> pid) && (cdr >> sec) && (cdr >> usec)
00326 && (cdr >> buffer_len)) {
00327 ACE_TCHAR *log_msg = new ACE_TCHAR[buffer_len + 1];
00328 log_record.type (type);
00329 log_record.pid (pid);
00330 log_record.time_stamp (ACE_Time_Value (sec, usec));
00331 #if defined (ACE_USES_WCHAR)
00332 cdr.read_wchar_array (log_msg, buffer_len);
00333 #else
00334 cdr.read_char_array (log_msg, buffer_len);
00335 #endif /* ACE_USES_WCHAR */
00336 log_msg[buffer_len] = '\0';
00337 log_record.set_msg_data_ptr (log_msg);
00338 }
00339 return cdr.good_bit ();
00340 }
|
|
|
Definition at line 34 of file Log_Record.h. |
1.3.6