summaryrefslogtreecommitdiff
path: root/ACE/ace/System_Time.cpp
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2006-10-23 23:31:00 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2006-10-23 23:31:00 +0000
commit493991791e3c7232fa33f428177dbfc9b666adac (patch)
treef937218c26da44d35b11b3ddeee1804031b5d99a /ACE/ace/System_Time.cpp
parentfe745d19b69bcac8e99ca5304656eada195cd1c6 (diff)
downloadATCD-493991791e3c7232fa33f428177dbfc9b666adac.tar.gz
ChangeLogTag:Mon Oct 23 02:28:42 UTC 2006 Ossama Othman <ossama_othman at symantec dot com>
Diffstat (limited to 'ACE/ace/System_Time.cpp')
-rw-r--r--ACE/ace/System_Time.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/ACE/ace/System_Time.cpp b/ACE/ace/System_Time.cpp
index 9aa77c4ddf1..ae5a9f905ab 100644
--- a/ACE/ace/System_Time.cpp
+++ b/ACE/ace/System_Time.cpp
@@ -1,16 +1,20 @@
// $Id$
#include "ace/System_Time.h"
+#include "ace/MMAP_Memory_Pool.h"
+#include "ace/Malloc_T.h"
+#include "ace/Null_Mutex.h"
+#include "ace/Time_Value.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_time.h"
-#include "ace/Time_Value.h"
ACE_RCSID(ace, System_Time, "$Id$")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_System_Time::ACE_System_Time (const ACE_TCHAR *poolname)
- : delta_time_ (0)
+ : shmem_ (0)
+ , delta_time_ (0)
{
ACE_TRACE ("ACE_System_Time::ACE_System_Time");
@@ -56,7 +60,7 @@ ACE_System_Time::~ACE_System_Time (void)
// Get the local system time.
int
-ACE_System_Time::get_local_system_time (ACE_UINT32 &time_out)
+ACE_System_Time::get_local_system_time (time_t & time_out)
{
ACE_TRACE ("ACE_System_Time::get_local_system_time");
time_out = ACE_OS::time (0);
@@ -74,7 +78,7 @@ ACE_System_Time::get_local_system_time (ACE_Time_Value &time_out)
// Get the system time of the central time server.
int
-ACE_System_Time::get_master_system_time (ACE_UINT32 &time_out)
+ACE_System_Time::get_master_system_time (time_t &time_out)
{
ACE_TRACE ("ACE_System_Time::get_master_system_time");
@@ -82,7 +86,7 @@ ACE_System_Time::get_master_system_time (ACE_UINT32 &time_out)
{
// Try to find it
void * temp;
- if (this->shmem_->find (ACE_DEFAULT_TIME_SERVER_STR, temp) == -1)
+ if (this->shmem_->find (ACE_DEFAULT_TIME_SERVER_STR, temp) == -1)
{
// No time entry in shared memory (meaning no Clerk exists)
// so return the local time of the host.
@@ -90,20 +94,20 @@ ACE_System_Time::get_master_system_time (ACE_UINT32 &time_out)
}
else
// Extract the delta time.
- this->delta_time_ = (long *) temp;
+ this->delta_time_ = static_cast<long *> (temp);
}
- ACE_UINT32 local_time;
+ time_t local_time;
// If delta_time is positive, it means that the system clock is
// ahead of our local clock so add delta to the local time to get an
// approximation of the system time. Else if delta time is negative,
// it means that our local clock is ahead of the system clock, so
// return the last local time stored (to avoid time conflicts).
- if (*this->delta_time_ >=0 )
+ if (*this->delta_time_ >= 0 )
{
this->get_local_system_time (local_time);
- time_out = local_time + (ACE_UINT32) *this->delta_time_;
+ time_out = local_time + static_cast<ACE_UINT32> (*this->delta_time_);
}
else
// Return the last local time. Note that this is stored as the
@@ -116,7 +120,7 @@ int
ACE_System_Time::get_master_system_time (ACE_Time_Value &time_out)
{
ACE_TRACE ("ACE_System_Time::get_master_system_time");
- ACE_UINT32 to;
+ time_t to;
if (this->get_master_system_time (to) == -1)
return -1;
time_out.sec (to);