// @(#)root/base:$Id$
// Author: Fons Rademakers   30/9/2001

/*************************************************************************
 * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TUUID                                                                //
//                                                                      //
// This class defines a UUID (Universally Unique IDentifier), also      //
// known as GUIDs (Globally Unique IDentifier). A UUID is 128 bits      //
// long, and if generated according to this algorithm, is either        //
// guaranteed to be different from all other UUIDs/GUIDs generated      //
// until 3400 A.D. or extremely likely to be different. UUIDs were      //
// originally used in the Network Computing System (NCS) and            //
// later in the Open Software Foundation's (OSF) Distributed Computing  //
// Environment (DCE).                                                   //
//                                                                      //
// Structure of universal unique IDs (UUIDs).                           //
//                                                                      //
// Depending on the network data representation, the multi-             //
// octet unsigned integer fields are subject to byte swapping           //
// when communicated between dissimilar endian machines.                //
//                                                                      //
// +-----------------------------------+                                //
// |     low 32 bits of time           |  0-3   .fTimeLow               //
// +-------------------------------+----                                //
// |     mid 16 bits of time       |      4-5   .fTimeMid               //
// +-------+-----------------------+                                    //
// | vers. |   hi 12 bits of time  |      6-7   .fTimeHiAndVersion      //
// +-------+-------+---------------+                                    //
// |Res | clkSeqHi |                      8     .fClockSeqHiAndReserved //
// +---------------+                                                    //
// |   clkSeqLow   |                      9     .fClockSeqLow           //
// +---------------+------------------+                                 //
// |            node ID               |   10-15 .fNode                  //
// +----------------------------------+                                 //
//                                                                      //
// The adjusted time stamp is split into three fields, and the          //
// clockSeq is split into two fields.                                   //
//                                                                      //
// The timestamp is a 60-bit value. For UUID version 1, this            //
// is represented by Coordinated Universal Time (UTC/GMT) as            //
// a count of 100-nanosecond intervals since 00:00:00.00,               //
// 15 October 1582 (the date of Gregorian reform to the                 //
// Christian calendar).                                                 //
//                                                                      //
// The version number is multiplexed in the 4 most significant          //
// bits of the 'fTimeHiAndVersion' field. There are two defined         //
// versions:                                                            //
//               MSB <---                                               //
// Version      4-Bit Code      Description                             //
// ------------------------------------------------------------         //
// |  1           0 0 0 1     DCE version, as specified herein.         //
// |  2           0 0 1 0     DCE Security version, with                //
// |                          embedded POSIX UIDs.                      //
// |  3           0 0 1 1     node id is a random value                 //
// ------------------------------------------------------------         //
//                                                                      //
// Clock Sequence                                                       //
//                                                                      //
// The clock sequence value must be changed whenever:                   //
//                                                                      //
//    The UUID generator detects that the local value of UTC            //
//    has gone backward; this may be due to re-syncing of the system    //
//    clock.                                                            //
//                                                                      //
// While a node is operational, the UUID service always saves           //
// the last UTC used to create a UUID. Each time a new UUID             //
// is created, the current UTC is compared to the saved value           //
// and if either the current value is less or the saved value           //
// was lost, then the clock sequence is incremented modulo              //
// 16,384, thus avoiding production of duplicted UUIDs.                 //
//                                                                      //
// The clock sequence must be initialized to a random number            //
// to minimize the correlation across system. This provides             //
// maximum protection against node identifiers that may move            //
// or switch from system to system rapidly.                             //
//                                                                      //
// Clock Adjustment                                                     //
//                                                                      //
// UUIDs may be created at a rate greater than the system clock         //
// resolution. Therefore, the system must also maintain an              //
// adjustment value to be added to the lower-order bits of the          //
// time. Logically, each time the system clock ticks, the               //
// adjustment value is cleared. Every time a UUID is generated,         //
// the current adjustment value is read and incremented, and            //
// then added to the UTC time field of the UUID.                        //
//                                                                      //
// Clock Overrun                                                        //
//                                                                      //
// The 100-nanosecond granularity of time should prove sufficient       //
// even for bursts of UUID production in the next generation of         //
// high-performance multiprocessors. If a system overruns the           //
// clock adjustment by requesting too many UUIDs within a single        //
// system clock tick, the UUID generator will stall until the           //
// system clock catches up.                                             //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TROOT.h"
#include "TUUID.h"
#include "TError.h"
#include "TSystem.h"
#include "TInetAddress.h"
#include "TMD5.h"
#include "Bytes.h"
#include "TVirtualMutex.h"
#include "ThreadLocalStorage.h"
#include <string.h>
#include <stdlib.h>
#ifdef R__WIN32
#include "Windows4Root.h"
#include <Iphlpapi.h>
#else
#include <unistd.h>
#include <sys/time.h>
#if defined(R__LINUX) && !defined(R__WINGCC)
#include <sys/sysinfo.h>
#endif
#endif


ClassImp(TUUID)

//______________________________________________________________________________
TUUID::TUUID()
{
   // Create a UUID.

   TTHREAD_TLS(uuid_time_t) time_last;
   TTHREAD_TLS(UShort_t) clockseq(0);
   TTHREAD_TLS(Bool_t) firstTime(kTRUE);
   uuid_time_t *time_last_ptr = TTHREAD_TLS_PTR(time_last);

   if (firstTime) {
      R__LOCKGUARD2(gROOTMutex); // rand and random are not thread safe.

      if (gSystem) {
         // try to get a unique seed per process
         UInt_t seed = (UInt_t) (Long64_t(gSystem->Now()) + gSystem->GetPid());
#ifdef R__WIN32
         srand(seed);
#else
         srandom(seed);
#endif
      }
      GetCurrentTime(time_last_ptr);
#ifdef R__WIN32
      clockseq = 1+(UShort_t)(65536*rand()/(RAND_MAX+1.0));
#else
      clockseq = 1+(UShort_t)(65536*random()/(RAND_MAX+1.0));
#endif
      firstTime = kFALSE;
   }

   uuid_time_t timestamp;

   // get current time
   GetCurrentTime(&timestamp);

   // if clock went backward change clockseq
   if (CmpTime(&timestamp, time_last_ptr) == -1) {
      clockseq = (clockseq + 1) & 0x3FFF;
      if (clockseq == 0) clockseq++;
   }

   Format(clockseq, timestamp);

   time_last = timestamp;
   fUUIDIndex = 1<<30;
}

//______________________________________________________________________________
TUUID::~TUUID()
{
   // delete this TUUID

   //gROOT->GetUUIDs()->RemoveUUID(fUUIDIndex);
}

//______________________________________________________________________________
Int_t TUUID::CmpTime(uuid_time_t *t1, uuid_time_t *t2)
{
   // Compare two time values.

   if (t1->high < t2->high) return -1;
   if (t1->high > t2->high) return 1;
   if (t1->low  < t2->low)  return -1;
   if (t1->low  > t2->low)  return 1;
   return 0;
}

//______________________________________________________________________________
void TUUID::SetFromString(const char *uuid)
{
   // Set this UUID to the value specified in uuid ((which must be in
   // TUUID::AsString() format).

   // Format is tttttttt-tttt-cccc-cccc-nnnnnnnnnnnn.
   Long_t  timeLo;
   int     timeMid;
   int     timeHiAndVersion;
   int     clockSeqHiAndRes;
   int     clockSeqLo;
   int     node[6];

   sscanf(uuid, "%8lx-%4x-%4x-%2x%2x-%2x%2x%2x%2x%2x%2x",
          &timeLo,
          &timeMid,
          &timeHiAndVersion,
          &clockSeqHiAndRes,
          &clockSeqLo,
          &node[0], &node[1], &node[2], &node[3], &node[4], &node[5]);

   // Note that we're going through this agony because scanf is
   // defined to know only to scan into "int"s or "long"s.
   fTimeLow               = (UInt_t) timeLo;
   fTimeMid               = (UShort_t) timeMid;
   fTimeHiAndVersion      = (UShort_t) timeHiAndVersion;
   fClockSeqHiAndReserved = (UChar_t) clockSeqHiAndRes;
   fClockSeqLow           = (UChar_t) clockSeqLo;
   fNode[0]               = (UChar_t) node[0];
   fNode[1]               = (UChar_t) node[1];
   fNode[2]               = (UChar_t) node[2];
   fNode[3]               = (UChar_t) node[3];
   fNode[4]               = (UChar_t) node[4];
   fNode[5]               = (UChar_t) node[5];
   fUUIDIndex             = 1<<30;
}

//______________________________________________________________________________
TUUID::TUUID(const char *uuid)
{
   // Initialize a TUUID with uuid (which must be in TUUID::AsString() format).

   fTimeLow               = 0;
   fTimeMid               = 0;
   fTimeHiAndVersion      = 0;
   fClockSeqHiAndReserved = 0;
   fClockSeqLow           = 0;
   fNode[0]               = 0;
   fUUIDIndex             = 0;

   if (!uuid || !*uuid)
      Error("TUUID", "null string not allowed");
   else
      SetFromString(uuid);
}

//______________________________________________________________________________
void TUUID::FillBuffer(char *&buffer)
{
   // Stream UUID into output buffer.

   Version_t version = TUUID::Class_Version();
   tobuf(buffer, version);
   tobuf(buffer, fTimeLow);
   tobuf(buffer, fTimeMid);
   tobuf(buffer, fTimeHiAndVersion);
   tobuf(buffer, fClockSeqHiAndReserved);
   tobuf(buffer, fClockSeqLow);
   for (Int_t i = 0; i < 6; i++)
      tobuf(buffer, fNode[i]);
}

//______________________________________________________________________________
void TUUID::ReadBuffer(char *&buffer)
{
   // Stream UUID from input buffer.

   Version_t version;
   frombuf(buffer, &version);
   frombuf(buffer, &fTimeLow);
   frombuf(buffer, &fTimeMid);
   frombuf(buffer, &fTimeHiAndVersion);
   frombuf(buffer, &fClockSeqHiAndReserved);
   frombuf(buffer, &fClockSeqLow);
   for (Int_t i = 0; i < 6; i++)
      frombuf(buffer, &fNode[i]);
}

//______________________________________________________________________________
void TUUID::StreamerV1(TBuffer &b)
{
   // Stream UUID from input buffer.
   // This function is for the exclusive use of TDirectory::Streamer() to
   // read a non-versioned version of TUUID.

   b >> fTimeLow;
   b >> fTimeMid;
   b >> fTimeHiAndVersion;
   b >> fClockSeqHiAndReserved;
   b >> fClockSeqLow;
   for (UInt_t i = 0; i < 6; i++) {
      b >> fNode[i];
   }
}

//______________________________________________________________________________
void TUUID::Format(UShort_t clockseq, uuid_time_t ts)
{
   // Make a UUID from timestamp, clockseq and node id.

   fTimeLow = ts.low;
   fTimeMid = (UShort_t)(ts.high & 0xFFFF);
   fTimeHiAndVersion = (UShort_t)((ts.high >> 16) & 0x0FFF);
   fTimeHiAndVersion |= (1 << 12);
   fClockSeqLow = clockseq & 0xFF;
   fClockSeqHiAndReserved = (clockseq & 0x3F00) >> 8;
   fClockSeqHiAndReserved |= 0x80;
   GetNodeIdentifier();
}

//______________________________________________________________________________
void TUUID::GetCurrentTime(uuid_time_t *timestamp)
{
   // Get current time as 60 bit 100ns ticks since whenever.
   // Compensate for the fact that real clock resolution is less
   // than 100ns.

   const UShort_t uuids_per_tick = 1024;

   TTHREAD_TLS(uuid_time_t) time_last;
   TTHREAD_TLS(UShort_t)    uuids_this_tick(0);
   TTHREAD_TLS(Bool_t)      init(kFALSE);

   uuid_time_t *time_last_ptr = TTHREAD_TLS_PTR(time_last);

   if (!init) {
      GetSystemTime(time_last_ptr);
      uuids_this_tick = uuids_per_tick;
      init = kTRUE;
   }

   uuid_time_t time_now;

   while (1) {
      GetSystemTime(&time_now);

      // if clock reading changed since last UUID generated
      if (CmpTime(time_last_ptr, &time_now))  {
         // reset count of uuid's generated with this clock reading
         uuids_this_tick = 0;
         break;
      }
      if (uuids_this_tick < uuids_per_tick) {
         uuids_this_tick++;
         break;
      }
      // going too fast for our clock; spin
   }

   time_last = time_now;

   if (uuids_this_tick != 0) {
      if (time_now.low & 0x80000000) {
         time_now.low += uuids_this_tick;
         if (!(time_now.low & 0x80000000))
            time_now.high++;
      } else
         time_now.low += uuids_this_tick;
   }

   timestamp->high = time_now.high;
   timestamp->low  = time_now.low;
}

//______________________________________________________________________________
void TUUID::GetSystemTime(uuid_time_t *timestamp)
{
   // Get system time with 100ns precision. Time is since Oct 15, 1582.

#ifdef R__WIN32
   ULARGE_INTEGER time;
   GetSystemTimeAsFileTime((FILETIME *)&time);
   // NT keeps time in FILETIME format which is 100ns ticks since
   // Jan 1, 1601. UUIDs use time in 100ns ticks since Oct 15, 1582.
   // The difference is 17 Days in Oct + 30 (Nov) + 31 (Dec)
   // + 18 years and 5 leap days.
   time.QuadPart +=
            (unsigned __int64) (1000*1000*10)       // seconds
          * (unsigned __int64) (60 * 60 * 24)       // days
          * (unsigned __int64) (17+30+31+365*18+5); // # of days

   timestamp->high = time.HighPart;
   timestamp->low  = time.LowPart;
#else
   struct timeval tp;
   gettimeofday(&tp, 0);
   // Offset between UUID formatted times and Unix formatted times.
   // UUID UTC base time is October 15, 1582.
   // Unix base time is January 1, 1970.
   ULong64_t uuid_time = ((ULong64_t)tp.tv_sec * 10000000) + (tp.tv_usec * 10) +
                         0x01B21DD213814000LL;
   timestamp->high = (UInt_t) (uuid_time >> 32);
   timestamp->low  = (UInt_t) (uuid_time & 0xFFFFFFFF);
#endif
}

//______________________________________________________________________________
void TUUID::GetNodeIdentifier()
{
   // Get node identifier. Try first to get network address, if no
   // network interface try random info based on some machine parameters.

   static UInt_t adr = 0;

   if (gSystem) {
#ifndef R__WIN32
      if (!adr) {
         TInetAddress addr = gSystem->GetHostByName(gSystem->HostName());
         if (addr.IsValid())
            adr = addr.GetAddress();
         else
            adr = 1;  // illegal address
      }
#else
      // this way to get the machine's IP address is needed because
      // GetHostByName() on Win32 contacts the DNS which we don't want
      // as firewall tools like ZoneAlarm are likely to catch it and
      // alarm the user
      if (!adr) {
         PIP_ADAPTER_INFO ainfo = (PIP_ADAPTER_INFO) malloc(sizeof(IP_ADAPTER_INFO));
         ULONG buflen = sizeof(IP_ADAPTER_INFO);
         DWORD stat = GetAdaptersInfo(ainfo, &buflen);
         if (stat == ERROR_BUFFER_OVERFLOW) {
            free(ainfo);
            ainfo = (PIP_ADAPTER_INFO) malloc(buflen);
            stat = GetAdaptersInfo(ainfo, &buflen);
         }
         if (stat != ERROR_SUCCESS)
            adr = 1;  // illegal address
         else {
            // take address of first adapter
            PIP_ADAPTER_INFO adapter = ainfo;
            int a, b, c, d;
            sscanf(adapter->IpAddressList.IpAddress.String, "%d.%d.%d.%d",
                   &a, &b, &c, &d);
            adr = (a << 24) | (b << 16) | (c << 8) | d;
         }
         free(ainfo);
      }
#endif
      if (adr > 2) {
         memcpy(fNode, &adr, 4);
         fNode[4] = 0xbe;
         fNode[5] = 0xef;
         return;
      }
   }
   static UChar_t seed[16];
   if (adr < 2) {
      GetRandomInfo(seed);
      seed[0] |= 0x80;
      if (gSystem) adr = 2;  // illegal address
   }
   memcpy(fNode, seed, sizeof(fNode));
   fTimeHiAndVersion |= (3 << 12);    // version == 3: random node info
}

//______________________________________________________________________________
void TUUID::GetRandomInfo(UChar_t seed[16])
{
   // Get random info based on some machine parameters.

#ifdef R__WIN32
   struct randomness {
      MEMORYSTATUS  m;
      SYSTEM_INFO   s;
      FILETIME      t;
      LARGE_INTEGER pc;
      DWORD         tc;
      DWORD         l;
      char          hostname[MAX_COMPUTERNAME_LENGTH + 1];
   };
   randomness r;
   memset(&r, 0, sizeof(r));  // zero also padding bytes

   // memory usage stats
   GlobalMemoryStatus(&r.m);
   // random system stats
   GetSystemInfo(&r.s);
   // 100ns resolution time of day
   GetSystemTimeAsFileTime(&r.t);
   // high resolution performance counter
   QueryPerformanceCounter(&r.pc);
   // milliseconds since last boot
   r.tc = GetTickCount();
   r.l = MAX_COMPUTERNAME_LENGTH + 1;
   GetComputerName(r.hostname, &r.l);
#else
   struct randomness {
#if defined(R__LINUX) && !defined(R__WINGCC)
      struct sysinfo   s;
#endif
      struct timeval   t;
      char             hostname[257];
   };
   randomness r;
   memset(&r, 0, sizeof(r));  // zero also padding bytes

#if defined(R__LINUX) && !defined(R__WINGCC)
   sysinfo(&r.s);
#endif
   gettimeofday(&r.t, 0);
   gethostname(r.hostname, 256);
#endif
   TMD5 md5;
   md5.Update((UChar_t *)&r, sizeof(randomness));
   md5.Final(seed);
}

//______________________________________________________________________________
void TUUID::Print() const
{
   // Print UUID.

   printf("%s\n", AsString());
}

//______________________________________________________________________________
const char *TUUID::AsString() const
{
   // Return UUID as string. Copy string immediately since it will be reused.

   static char uuid[40];

   snprintf(uuid,40, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
           fTimeLow, fTimeMid, fTimeHiAndVersion, fClockSeqHiAndReserved,
           fClockSeqLow, fNode[0], fNode[1], fNode[2], fNode[3], fNode[4],
           fNode[5]);

   return uuid;
}

//______________________________________________________________________________
UShort_t TUUID::Hash() const
{
   // Compute 16-bit hash value of the UUID.

   Short_t  c0 = 0, c1 = 0, x, y;
   char    *c = (char *) &fTimeLow;

   // For speed lets unroll the following loop:
   //   for (i = 0; i < 16; i++) {
   //      c0 += *c++;
   //      c1 += c0;
   //   }

   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;

   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;

   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;

   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;
   c0 += *c++; c1 += c0;

   //  Calculate the value for "First octet" of the hash
   x = -c1 % 255;
   if (x < 0)
      x += 255;

   // Calculate the value for "second octet" of the hash
   y = (c1 - c0) % 255;
   if (y < 0)
      y += 255;

   return UShort_t((y << 8) + x);
}

//______________________________________________________________________________
Int_t TUUID::Compare(const TUUID &u) const
{
   // Compare two UUIDs "lexically" and return
   //    -1   this is lexically before u
   //     0   this is equal to u
   //     1   this is lexically after u

#define CHECK(f1, f2) if (f1 != f2) return f1 < f2 ? -1 : 1;
   CHECK(fTimeLow, u.fTimeLow)
   CHECK(fTimeMid, u.fTimeMid)
   CHECK(fTimeHiAndVersion, u.fTimeHiAndVersion)
   CHECK(fClockSeqHiAndReserved, u.fClockSeqHiAndReserved)
   CHECK(fClockSeqLow, u.fClockSeqLow)
   for (int i = 0; i < 6; i++) {
      if (fNode[i] < u.fNode[i])
         return -1;
      if (fNode[i] > u.fNode[i])
         return 1;
   }
   return 0;
}

//______________________________________________________________________________
TInetAddress TUUID::GetHostAddress() const
{
   // Get address of host encoded in UUID. If host id is not an ethernet
   // address, but random info, then the returned TInetAddress is not valid.

   if ((fTimeHiAndVersion >> 12) == 1) {
      UInt_t addr;
      memcpy(&addr, fNode, 4);
      return TInetAddress("????", addr, 0);
   }
   return TInetAddress();
}

//______________________________________________________________________________
TDatime TUUID::GetTime() const
{
   // Get time from UUID.

   TDatime     dt;
   uuid_time_t ts;

   ts.low   = fTimeLow;
   ts.high  = (UInt_t)fTimeMid;
   ts.high |= (UInt_t)((fTimeHiAndVersion & 0x0FFF) << 16);

   // Offset between UUID formatted times and Unix formatted times.
   // UUID UTC base time is October 15, 1582.
   // Unix base time is January 1, 1970.
   ULong64_t high = ts.high;
   ULong64_t uuid_time = (high << 32) + ts.low;
   uuid_time -= 0x01B21DD213814000LL;
   uuid_time /= 10000000LL;
   UInt_t tt = (UInt_t) uuid_time;
   dt.Set(tt);

   return dt;
}

//______________________________________________________________________________
void TUUID::GetUUID(UChar_t uuid[16]) const
{
   // Return uuid in specified buffer (16 byte = 128 bits).

   memcpy(uuid, &fTimeLow, 16);
}

//______________________________________________________________________________
void TUUID::SetUUID(const char *uuid)
{
   // Set this UUID to the value specified in uuid ((which must be in
   // TUUID::AsString() format).

   if (!uuid || !*uuid)
      Error("SetUUID", "null string not allowed");
   else
      SetFromString(uuid);
}

//______________________________________________________________________________
TBuffer &operator<<(TBuffer &buf, const TUUID &uuid)
{
   // Input operator.  Delegate to Streamer.

   R__ASSERT( buf.IsWriting() );

   const_cast<TUUID&>(uuid).Streamer(buf);
   return buf;
}
 TUUID.cxx:1
 TUUID.cxx:2
 TUUID.cxx:3
 TUUID.cxx:4
 TUUID.cxx:5
 TUUID.cxx:6
 TUUID.cxx:7
 TUUID.cxx:8
 TUUID.cxx:9
 TUUID.cxx:10
 TUUID.cxx:11
 TUUID.cxx:12
 TUUID.cxx:13
 TUUID.cxx:14
 TUUID.cxx:15
 TUUID.cxx:16
 TUUID.cxx:17
 TUUID.cxx:18
 TUUID.cxx:19
 TUUID.cxx:20
 TUUID.cxx:21
 TUUID.cxx:22
 TUUID.cxx:23
 TUUID.cxx:24
 TUUID.cxx:25
 TUUID.cxx:26
 TUUID.cxx:27
 TUUID.cxx:28
 TUUID.cxx:29
 TUUID.cxx:30
 TUUID.cxx:31
 TUUID.cxx:32
 TUUID.cxx:33
 TUUID.cxx:34
 TUUID.cxx:35
 TUUID.cxx:36
 TUUID.cxx:37
 TUUID.cxx:38
 TUUID.cxx:39
 TUUID.cxx:40
 TUUID.cxx:41
 TUUID.cxx:42
 TUUID.cxx:43
 TUUID.cxx:44
 TUUID.cxx:45
 TUUID.cxx:46
 TUUID.cxx:47
 TUUID.cxx:48
 TUUID.cxx:49
 TUUID.cxx:50
 TUUID.cxx:51
 TUUID.cxx:52
 TUUID.cxx:53
 TUUID.cxx:54
 TUUID.cxx:55
 TUUID.cxx:56
 TUUID.cxx:57
 TUUID.cxx:58
 TUUID.cxx:59
 TUUID.cxx:60
 TUUID.cxx:61
 TUUID.cxx:62
 TUUID.cxx:63
 TUUID.cxx:64
 TUUID.cxx:65
 TUUID.cxx:66
 TUUID.cxx:67
 TUUID.cxx:68
 TUUID.cxx:69
 TUUID.cxx:70
 TUUID.cxx:71
 TUUID.cxx:72
 TUUID.cxx:73
 TUUID.cxx:74
 TUUID.cxx:75
 TUUID.cxx:76
 TUUID.cxx:77
 TUUID.cxx:78
 TUUID.cxx:79
 TUUID.cxx:80
 TUUID.cxx:81
 TUUID.cxx:82
 TUUID.cxx:83
 TUUID.cxx:84
 TUUID.cxx:85
 TUUID.cxx:86
 TUUID.cxx:87
 TUUID.cxx:88
 TUUID.cxx:89
 TUUID.cxx:90
 TUUID.cxx:91
 TUUID.cxx:92
 TUUID.cxx:93
 TUUID.cxx:94
 TUUID.cxx:95
 TUUID.cxx:96
 TUUID.cxx:97
 TUUID.cxx:98
 TUUID.cxx:99
 TUUID.cxx:100
 TUUID.cxx:101
 TUUID.cxx:102
 TUUID.cxx:103
 TUUID.cxx:104
 TUUID.cxx:105
 TUUID.cxx:106
 TUUID.cxx:107
 TUUID.cxx:108
 TUUID.cxx:109
 TUUID.cxx:110
 TUUID.cxx:111
 TUUID.cxx:112
 TUUID.cxx:113
 TUUID.cxx:114
 TUUID.cxx:115
 TUUID.cxx:116
 TUUID.cxx:117
 TUUID.cxx:118
 TUUID.cxx:119
 TUUID.cxx:120
 TUUID.cxx:121
 TUUID.cxx:122
 TUUID.cxx:123
 TUUID.cxx:124
 TUUID.cxx:125
 TUUID.cxx:126
 TUUID.cxx:127
 TUUID.cxx:128
 TUUID.cxx:129
 TUUID.cxx:130
 TUUID.cxx:131
 TUUID.cxx:132
 TUUID.cxx:133
 TUUID.cxx:134
 TUUID.cxx:135
 TUUID.cxx:136
 TUUID.cxx:137
 TUUID.cxx:138
 TUUID.cxx:139
 TUUID.cxx:140
 TUUID.cxx:141
 TUUID.cxx:142
 TUUID.cxx:143
 TUUID.cxx:144
 TUUID.cxx:145
 TUUID.cxx:146
 TUUID.cxx:147
 TUUID.cxx:148
 TUUID.cxx:149
 TUUID.cxx:150
 TUUID.cxx:151
 TUUID.cxx:152
 TUUID.cxx:153
 TUUID.cxx:154
 TUUID.cxx:155
 TUUID.cxx:156
 TUUID.cxx:157
 TUUID.cxx:158
 TUUID.cxx:159
 TUUID.cxx:160
 TUUID.cxx:161
 TUUID.cxx:162
 TUUID.cxx:163
 TUUID.cxx:164
 TUUID.cxx:165
 TUUID.cxx:166
 TUUID.cxx:167
 TUUID.cxx:168
 TUUID.cxx:169
 TUUID.cxx:170
 TUUID.cxx:171
 TUUID.cxx:172
 TUUID.cxx:173
 TUUID.cxx:174
 TUUID.cxx:175
 TUUID.cxx:176
 TUUID.cxx:177
 TUUID.cxx:178
 TUUID.cxx:179
 TUUID.cxx:180
 TUUID.cxx:181
 TUUID.cxx:182
 TUUID.cxx:183
 TUUID.cxx:184
 TUUID.cxx:185
 TUUID.cxx:186
 TUUID.cxx:187
 TUUID.cxx:188
 TUUID.cxx:189
 TUUID.cxx:190
 TUUID.cxx:191
 TUUID.cxx:192
 TUUID.cxx:193
 TUUID.cxx:194
 TUUID.cxx:195
 TUUID.cxx:196
 TUUID.cxx:197
 TUUID.cxx:198
 TUUID.cxx:199
 TUUID.cxx:200
 TUUID.cxx:201
 TUUID.cxx:202
 TUUID.cxx:203
 TUUID.cxx:204
 TUUID.cxx:205
 TUUID.cxx:206
 TUUID.cxx:207
 TUUID.cxx:208
 TUUID.cxx:209
 TUUID.cxx:210
 TUUID.cxx:211
 TUUID.cxx:212
 TUUID.cxx:213
 TUUID.cxx:214
 TUUID.cxx:215
 TUUID.cxx:216
 TUUID.cxx:217
 TUUID.cxx:218
 TUUID.cxx:219
 TUUID.cxx:220
 TUUID.cxx:221
 TUUID.cxx:222
 TUUID.cxx:223
 TUUID.cxx:224
 TUUID.cxx:225
 TUUID.cxx:226
 TUUID.cxx:227
 TUUID.cxx:228
 TUUID.cxx:229
 TUUID.cxx:230
 TUUID.cxx:231
 TUUID.cxx:232
 TUUID.cxx:233
 TUUID.cxx:234
 TUUID.cxx:235
 TUUID.cxx:236
 TUUID.cxx:237
 TUUID.cxx:238
 TUUID.cxx:239
 TUUID.cxx:240
 TUUID.cxx:241
 TUUID.cxx:242
 TUUID.cxx:243
 TUUID.cxx:244
 TUUID.cxx:245
 TUUID.cxx:246
 TUUID.cxx:247
 TUUID.cxx:248
 TUUID.cxx:249
 TUUID.cxx:250
 TUUID.cxx:251
 TUUID.cxx:252
 TUUID.cxx:253
 TUUID.cxx:254
 TUUID.cxx:255
 TUUID.cxx:256
 TUUID.cxx:257
 TUUID.cxx:258
 TUUID.cxx:259
 TUUID.cxx:260
 TUUID.cxx:261
 TUUID.cxx:262
 TUUID.cxx:263
 TUUID.cxx:264
 TUUID.cxx:265
 TUUID.cxx:266
 TUUID.cxx:267
 TUUID.cxx:268
 TUUID.cxx:269
 TUUID.cxx:270
 TUUID.cxx:271
 TUUID.cxx:272
 TUUID.cxx:273
 TUUID.cxx:274
 TUUID.cxx:275
 TUUID.cxx:276
 TUUID.cxx:277
 TUUID.cxx:278
 TUUID.cxx:279
 TUUID.cxx:280
 TUUID.cxx:281
 TUUID.cxx:282
 TUUID.cxx:283
 TUUID.cxx:284
 TUUID.cxx:285
 TUUID.cxx:286
 TUUID.cxx:287
 TUUID.cxx:288
 TUUID.cxx:289
 TUUID.cxx:290
 TUUID.cxx:291
 TUUID.cxx:292
 TUUID.cxx:293
 TUUID.cxx:294
 TUUID.cxx:295
 TUUID.cxx:296
 TUUID.cxx:297
 TUUID.cxx:298
 TUUID.cxx:299
 TUUID.cxx:300
 TUUID.cxx:301
 TUUID.cxx:302
 TUUID.cxx:303
 TUUID.cxx:304
 TUUID.cxx:305
 TUUID.cxx:306
 TUUID.cxx:307
 TUUID.cxx:308
 TUUID.cxx:309
 TUUID.cxx:310
 TUUID.cxx:311
 TUUID.cxx:312
 TUUID.cxx:313
 TUUID.cxx:314
 TUUID.cxx:315
 TUUID.cxx:316
 TUUID.cxx:317
 TUUID.cxx:318
 TUUID.cxx:319
 TUUID.cxx:320
 TUUID.cxx:321
 TUUID.cxx:322
 TUUID.cxx:323
 TUUID.cxx:324
 TUUID.cxx:325
 TUUID.cxx:326
 TUUID.cxx:327
 TUUID.cxx:328
 TUUID.cxx:329
 TUUID.cxx:330
 TUUID.cxx:331
 TUUID.cxx:332
 TUUID.cxx:333
 TUUID.cxx:334
 TUUID.cxx:335
 TUUID.cxx:336
 TUUID.cxx:337
 TUUID.cxx:338
 TUUID.cxx:339
 TUUID.cxx:340
 TUUID.cxx:341
 TUUID.cxx:342
 TUUID.cxx:343
 TUUID.cxx:344
 TUUID.cxx:345
 TUUID.cxx:346
 TUUID.cxx:347
 TUUID.cxx:348
 TUUID.cxx:349
 TUUID.cxx:350
 TUUID.cxx:351
 TUUID.cxx:352
 TUUID.cxx:353
 TUUID.cxx:354
 TUUID.cxx:355
 TUUID.cxx:356
 TUUID.cxx:357
 TUUID.cxx:358
 TUUID.cxx:359
 TUUID.cxx:360
 TUUID.cxx:361
 TUUID.cxx:362
 TUUID.cxx:363
 TUUID.cxx:364
 TUUID.cxx:365
 TUUID.cxx:366
 TUUID.cxx:367
 TUUID.cxx:368
 TUUID.cxx:369
 TUUID.cxx:370
 TUUID.cxx:371
 TUUID.cxx:372
 TUUID.cxx:373
 TUUID.cxx:374
 TUUID.cxx:375
 TUUID.cxx:376
 TUUID.cxx:377
 TUUID.cxx:378
 TUUID.cxx:379
 TUUID.cxx:380
 TUUID.cxx:381
 TUUID.cxx:382
 TUUID.cxx:383
 TUUID.cxx:384
 TUUID.cxx:385
 TUUID.cxx:386
 TUUID.cxx:387
 TUUID.cxx:388
 TUUID.cxx:389
 TUUID.cxx:390
 TUUID.cxx:391
 TUUID.cxx:392
 TUUID.cxx:393
 TUUID.cxx:394
 TUUID.cxx:395
 TUUID.cxx:396
 TUUID.cxx:397
 TUUID.cxx:398
 TUUID.cxx:399
 TUUID.cxx:400
 TUUID.cxx:401
 TUUID.cxx:402
 TUUID.cxx:403
 TUUID.cxx:404
 TUUID.cxx:405
 TUUID.cxx:406
 TUUID.cxx:407
 TUUID.cxx:408
 TUUID.cxx:409
 TUUID.cxx:410
 TUUID.cxx:411
 TUUID.cxx:412
 TUUID.cxx:413
 TUUID.cxx:414
 TUUID.cxx:415
 TUUID.cxx:416
 TUUID.cxx:417
 TUUID.cxx:418
 TUUID.cxx:419
 TUUID.cxx:420
 TUUID.cxx:421
 TUUID.cxx:422
 TUUID.cxx:423
 TUUID.cxx:424
 TUUID.cxx:425
 TUUID.cxx:426
 TUUID.cxx:427
 TUUID.cxx:428
 TUUID.cxx:429
 TUUID.cxx:430
 TUUID.cxx:431
 TUUID.cxx:432
 TUUID.cxx:433
 TUUID.cxx:434
 TUUID.cxx:435
 TUUID.cxx:436
 TUUID.cxx:437
 TUUID.cxx:438
 TUUID.cxx:439
 TUUID.cxx:440
 TUUID.cxx:441
 TUUID.cxx:442
 TUUID.cxx:443
 TUUID.cxx:444
 TUUID.cxx:445
 TUUID.cxx:446
 TUUID.cxx:447
 TUUID.cxx:448
 TUUID.cxx:449
 TUUID.cxx:450
 TUUID.cxx:451
 TUUID.cxx:452
 TUUID.cxx:453
 TUUID.cxx:454
 TUUID.cxx:455
 TUUID.cxx:456
 TUUID.cxx:457
 TUUID.cxx:458
 TUUID.cxx:459
 TUUID.cxx:460
 TUUID.cxx:461
 TUUID.cxx:462
 TUUID.cxx:463
 TUUID.cxx:464
 TUUID.cxx:465
 TUUID.cxx:466
 TUUID.cxx:467
 TUUID.cxx:468
 TUUID.cxx:469
 TUUID.cxx:470
 TUUID.cxx:471
 TUUID.cxx:472
 TUUID.cxx:473
 TUUID.cxx:474
 TUUID.cxx:475
 TUUID.cxx:476
 TUUID.cxx:477
 TUUID.cxx:478
 TUUID.cxx:479
 TUUID.cxx:480
 TUUID.cxx:481
 TUUID.cxx:482
 TUUID.cxx:483
 TUUID.cxx:484
 TUUID.cxx:485
 TUUID.cxx:486
 TUUID.cxx:487
 TUUID.cxx:488
 TUUID.cxx:489
 TUUID.cxx:490
 TUUID.cxx:491
 TUUID.cxx:492
 TUUID.cxx:493
 TUUID.cxx:494
 TUUID.cxx:495
 TUUID.cxx:496
 TUUID.cxx:497
 TUUID.cxx:498
 TUUID.cxx:499
 TUUID.cxx:500
 TUUID.cxx:501
 TUUID.cxx:502
 TUUID.cxx:503
 TUUID.cxx:504
 TUUID.cxx:505
 TUUID.cxx:506
 TUUID.cxx:507
 TUUID.cxx:508
 TUUID.cxx:509
 TUUID.cxx:510
 TUUID.cxx:511
 TUUID.cxx:512
 TUUID.cxx:513
 TUUID.cxx:514
 TUUID.cxx:515
 TUUID.cxx:516
 TUUID.cxx:517
 TUUID.cxx:518
 TUUID.cxx:519
 TUUID.cxx:520
 TUUID.cxx:521
 TUUID.cxx:522
 TUUID.cxx:523
 TUUID.cxx:524
 TUUID.cxx:525
 TUUID.cxx:526
 TUUID.cxx:527
 TUUID.cxx:528
 TUUID.cxx:529
 TUUID.cxx:530
 TUUID.cxx:531
 TUUID.cxx:532
 TUUID.cxx:533
 TUUID.cxx:534
 TUUID.cxx:535
 TUUID.cxx:536
 TUUID.cxx:537
 TUUID.cxx:538
 TUUID.cxx:539
 TUUID.cxx:540
 TUUID.cxx:541
 TUUID.cxx:542
 TUUID.cxx:543
 TUUID.cxx:544
 TUUID.cxx:545
 TUUID.cxx:546
 TUUID.cxx:547
 TUUID.cxx:548
 TUUID.cxx:549
 TUUID.cxx:550
 TUUID.cxx:551
 TUUID.cxx:552
 TUUID.cxx:553
 TUUID.cxx:554
 TUUID.cxx:555
 TUUID.cxx:556
 TUUID.cxx:557
 TUUID.cxx:558
 TUUID.cxx:559
 TUUID.cxx:560
 TUUID.cxx:561
 TUUID.cxx:562
 TUUID.cxx:563
 TUUID.cxx:564
 TUUID.cxx:565
 TUUID.cxx:566
 TUUID.cxx:567
 TUUID.cxx:568
 TUUID.cxx:569
 TUUID.cxx:570
 TUUID.cxx:571
 TUUID.cxx:572
 TUUID.cxx:573
 TUUID.cxx:574
 TUUID.cxx:575
 TUUID.cxx:576
 TUUID.cxx:577
 TUUID.cxx:578
 TUUID.cxx:579
 TUUID.cxx:580
 TUUID.cxx:581
 TUUID.cxx:582
 TUUID.cxx:583
 TUUID.cxx:584
 TUUID.cxx:585
 TUUID.cxx:586
 TUUID.cxx:587
 TUUID.cxx:588
 TUUID.cxx:589
 TUUID.cxx:590
 TUUID.cxx:591
 TUUID.cxx:592
 TUUID.cxx:593
 TUUID.cxx:594
 TUUID.cxx:595
 TUUID.cxx:596
 TUUID.cxx:597
 TUUID.cxx:598
 TUUID.cxx:599
 TUUID.cxx:600
 TUUID.cxx:601
 TUUID.cxx:602
 TUUID.cxx:603
 TUUID.cxx:604
 TUUID.cxx:605
 TUUID.cxx:606
 TUUID.cxx:607
 TUUID.cxx:608
 TUUID.cxx:609
 TUUID.cxx:610
 TUUID.cxx:611
 TUUID.cxx:612
 TUUID.cxx:613
 TUUID.cxx:614
 TUUID.cxx:615
 TUUID.cxx:616
 TUUID.cxx:617
 TUUID.cxx:618
 TUUID.cxx:619
 TUUID.cxx:620
 TUUID.cxx:621
 TUUID.cxx:622
 TUUID.cxx:623
 TUUID.cxx:624
 TUUID.cxx:625
 TUUID.cxx:626
 TUUID.cxx:627
 TUUID.cxx:628
 TUUID.cxx:629
 TUUID.cxx:630
 TUUID.cxx:631
 TUUID.cxx:632
 TUUID.cxx:633
 TUUID.cxx:634
 TUUID.cxx:635
 TUUID.cxx:636
 TUUID.cxx:637
 TUUID.cxx:638
 TUUID.cxx:639
 TUUID.cxx:640
 TUUID.cxx:641
 TUUID.cxx:642
 TUUID.cxx:643
 TUUID.cxx:644
 TUUID.cxx:645
 TUUID.cxx:646
 TUUID.cxx:647
 TUUID.cxx:648
 TUUID.cxx:649
 TUUID.cxx:650
 TUUID.cxx:651
 TUUID.cxx:652
 TUUID.cxx:653
 TUUID.cxx:654
 TUUID.cxx:655
 TUUID.cxx:656
 TUUID.cxx:657
 TUUID.cxx:658
 TUUID.cxx:659
 TUUID.cxx:660
 TUUID.cxx:661
 TUUID.cxx:662
 TUUID.cxx:663
 TUUID.cxx:664
 TUUID.cxx:665
 TUUID.cxx:666
 TUUID.cxx:667
 TUUID.cxx:668
 TUUID.cxx:669
 TUUID.cxx:670
 TUUID.cxx:671
 TUUID.cxx:672
 TUUID.cxx:673
 TUUID.cxx:674
 TUUID.cxx:675
 TUUID.cxx:676
 TUUID.cxx:677
 TUUID.cxx:678
 TUUID.cxx:679
 TUUID.cxx:680
 TUUID.cxx:681