diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-10-21 21:41:34 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-10-21 21:41:34 +0000 |
commit | a5fdebc5f6375078ec1763850a4ca23ec7fe6458 (patch) | |
tree | bcf0a25c3d45a209a6e3ac37b233a4812f29c732 /ace/System_Time.h | |
download | ATCD-a5fdebc5f6375078ec1763850a4ca23ec7fe6458.tar.gz |
Initial revision
Diffstat (limited to 'ace/System_Time.h')
-rw-r--r-- | ace/System_Time.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/ace/System_Time.h b/ace/System_Time.h new file mode 100644 index 00000000000..c8c1035fe03 --- /dev/null +++ b/ace/System_Time.h @@ -0,0 +1,73 @@ +/* -*- C++ -*- */ +// $Id$ + + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// System_Time.h +// +// = AUTHOR +// Prashant Jain, Tim H. Harrison and Douglas C. Schmidt +// +// ============================================================================ + +#if !defined (ACE_SYSTEM_TIME_H) +#define ACE_SYSTEM_TIME_H + +#include "ace/OS.h" +#include "ace/Malloc.h" + +class ACE_Export ACE_Date_Time + // TITLE + // This class holds internally date and time and has interfaces + // for getting month or compares of times and dates, etc. +{ +public: +}; + +class ACE_Export ACE_System_Time + // = TITLE + // Defines the timer services of the OS interface to access the + // system time either on the local host or on the central time + // server in the network. +{ +public: + enum Sync_Mode { Jump, Adjust }; + // enumeration types to specify mode of synchronization with master + // clock. Jump will set local system time directly (thus possibly + // producing time gaps or ambiguous local system times. Adjust will + // smoothly slow down or speed up the local system clock to reach + // the system time of the master clock. + + ACE_System_Time (const char *poolname = ACE_DEFAULT_BACKING_STORE); + // Default constructor. + + ~ACE_System_Time (void); + // Default destructor. + + int get_local_system_time (ACE_UINT32 &time_out); + // Get the local system time. + + int get_master_system_time (ACE_UINT32 &time_out); + // Get the system time of the central time server. + + int sync_local_system_time (ACE_System_Time::Sync_Mode mode); + // synchronize local system time with the central time server using + // specified mode. + +private: + typedef ACE_Malloc <ACE_MMAP_Memory_Pool, ACE_Null_Mutex> MALLOC; + typedef ACE_Allocator_Adapter<MALLOC> ALLOCATOR; + + ALLOCATOR *shmem_; + // Our allocator (used for obtaining system time from shared memory). + + long *delta_time_; + // Pointer to delta time kept in shared memory. +}; + +#endif /* ACE_SYSTEM_TIME_H */ |