#include "ace/UUID.h"
#include "ace/Guard_T.h"
#include "ace/Log_Msg.h"
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_sys_time.h"
#include "ace/OS_NS_netdb.h"
#include "ace/OS_NS_unistd.h"
#include "ace/ACE.h"
Functions | |
ACE_RCSID (ace, UUID,"$Id: UUID.cpp 88515 2010-01-13 08:47:38Z johnnyw $") 1 namespace ACE_Utils |
ACE_RCSID | ( | ace | , | |
UUID | , | |||
"$Id: UUID.cpp 88515 2010-01-13 08:47:38Z johnnyw $" | ||||
) |
Special case for the nil UUID.
Support versions 1, 3, and 4 only
Obtain a new timestamp. If UUID's are being generated too quickly the clock sequence will be incremented
ACE_Time_Value is in POSIX time, seconds since Jan 1, 1970. UUIDs use time in 100ns ticks since 15 October 1582. The difference is: 15 Oct 1582 - 1 Jan 1600: 17 days in Oct, 30 in Nov, 31 in Dec + 17 years and 4 leap days (1584, 88, 92 and 96) 1 Jan 1600 - 1 Jan 1900: 3 centuries + 73 leap days ( 25 in 17th cent. and 24 each in 18th and 19th centuries) 1 Jan 1900 - 1 Jan 1970: 70 years + 17 leap days. This adds up, in days: (17+30+31+365*17+4)+ (365*300+73)+ (365*70+17) or 122192928000000000U (0x1B21DD213814000) 100 ns ticks.
Get the time of day, convert to 100ns ticks then add the offset.