diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2004-06-16 07:58:09 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2004-06-16 07:58:09 +0000 |
commit | 5db6a116406b02ad826677d56474373139b5e461 (patch) | |
tree | a52a3ebe70100dd6ee98945618918994ed8f30cc /ace/Log_Record.inl | |
parent | 393a25f7bd25beca509700ba1a568442c1a0921c (diff) | |
download | ATCD-5db6a116406b02ad826677d56474373139b5e461.tar.gz |
ChangeLogTag: Wed Jun 16 07:56:12 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ace/Log_Record.inl')
-rw-r--r-- | ace/Log_Record.inl | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/ace/Log_Record.inl b/ace/Log_Record.inl new file mode 100644 index 00000000000..b670116ce00 --- /dev/null +++ b/ace/Log_Record.inl @@ -0,0 +1,110 @@ +/* -*- C++ -*- */ +// $Id$ + +#include "ace/Global_Macros.h" +#include "ace/os_include/arpa/os_inet.h" +#include "ace/Time_Value.h" +#include "ace/OS_NS_string.h" + +ACE_INLINE +ACE_Log_Record::~ACE_Log_Record (void) +{ +} + +ACE_INLINE void +ACE_Log_Record::encode (void) +{ + ACE_TRACE ("ACE_Log_Record::encode"); + this->length_ = htonl (this->length_); + this->type_ = htonl (this->type_); + // Make sure we don't enclose the sec() and usec() fields until + // they've been normalized. + this->secs_ = htonl (this->secs_); + this->usecs_ = htonl (this->usecs_); + this->pid_ = htonl (this->pid_); +} + +ACE_INLINE void +ACE_Log_Record::decode (void) +{ + ACE_TRACE ("ACE_Log_Record::decode"); + ACE_Time_Value tv (ntohl (this->secs_), + ntohl (this->usecs_)); + + this->secs_ = tv.sec (); + this->usecs_ = tv.usec (); + this->type_ = ntohl (this->type_); + this->pid_ = ntohl (this->pid_); + this->length_ = ntohl (this->length_); +} + +ACE_INLINE long +ACE_Log_Record::type (void) const +{ + ACE_TRACE ("ACE_Log_Record::type"); + return (long) this->type_; +} + +ACE_INLINE void +ACE_Log_Record::type (long t) +{ + ACE_TRACE ("ACE_Log_Record::type"); + this->type_ = (ACE_UINT32) t; +} + +ACE_INLINE long +ACE_Log_Record::length (void) const +{ + ACE_TRACE ("ACE_Log_Record::length"); + return (long) this->length_; +} + +ACE_INLINE void +ACE_Log_Record::length (long l) +{ + ACE_TRACE ("ACE_Log_Record::length"); + this->length_ = static_cast<ACE_UINT32> (l); +} + +ACE_INLINE ACE_Time_Value +ACE_Log_Record::time_stamp (void) const +{ + ACE_TRACE ("ACE_Log_Record::time_stamp"); + return ACE_Time_Value ((long) this->secs_, (long) this->usecs_); +} + +ACE_INLINE void +ACE_Log_Record::time_stamp (const ACE_Time_Value &ts) +{ + ACE_TRACE ("ACE_Log_Record::time_stamp"); + this->secs_ = (ACE_UINT32) ts.sec (); + this->usecs_ = (ACE_UINT32) ts.usec (); +} + +ACE_INLINE long +ACE_Log_Record::pid (void) const +{ + ACE_TRACE ("ACE_Log_Record::pid"); + return (long) this->pid_; +} + +ACE_INLINE void +ACE_Log_Record::pid (long p) +{ + ACE_TRACE ("ACE_Log_Record::pid"); + this->pid_ = (ACE_UINT32) p; +} + +ACE_INLINE const ACE_TCHAR * +ACE_Log_Record::msg_data (void) const +{ + ACE_TRACE ("ACE_Log_Record::msg_data"); + return this->msg_data_; +} + +ACE_INLINE size_t +ACE_Log_Record::msg_data_len (void) const +{ + ACE_TRACE ("ACE_Log_Record::msg_data_len"); + return ACE_OS::strlen (this->msg_data_) + 1; +} |