Warning, file /include/root/TUUID.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TUUID
0013 #define ROOT_TUUID
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #ifdef WIN32
0031 #undef GetCurrentTime
0032 #endif
0033 #include "Rtypes.h"
0034
0035
0036 class TBuffer;
0037 class TFile;
0038 class TDirectory;
0039 class TInetAddress;
0040 class TDatime;
0041
0042 class TUUID {
0043
0044 protected:
0045 UInt_t fUUIDIndex;
0046 UInt_t fTimeLow;
0047 UShort_t fTimeMid;
0048 UShort_t fTimeHiAndVersion;
0049 UChar_t fClockSeqHiAndReserved;
0050 UChar_t fClockSeqLow;
0051 UChar_t fNode[6];
0052
0053 struct uuid_time_t {
0054 UInt_t high;
0055 UInt_t low;
0056 };
0057
0058 Int_t CmpTime(uuid_time_t *t1, uuid_time_t *t2);
0059 void Format(UShort_t clockseq, uuid_time_t ts);
0060 void GetNodeIdentifier();
0061 void GetCurrentTime(uuid_time_t *timestamp);
0062 void GetSystemTime(uuid_time_t *timestamp);
0063 void GetRandomInfo(UChar_t seed[16]);
0064 void SetFromString(const char *uuid_str);
0065
0066 public:
0067 TUUID();
0068 TUUID(const char *uuid_str);
0069 virtual ~TUUID();
0070
0071 const char *AsString() const;
0072 Int_t Compare(const TUUID &u) const;
0073 UShort_t Hash() const;
0074 void Print() const;
0075 TInetAddress GetHostAddress() const;
0076 TDatime GetTime() const;
0077 void GetUUID(UChar_t uuid[16]) const;
0078 void SetUUID(const char *uuid_str);
0079 UInt_t GetUUIDNumber() const { return fUUIDIndex; }
0080 void SetUUIDNumber(UInt_t index) { fUUIDIndex = index; }
0081
0082 void StreamerV1(TBuffer &b);
0083 void FillBuffer(char *&buffer);
0084 void ReadBuffer(char *&buffer);
0085 Int_t Sizeof() const { return 18; }
0086
0087 ClassDef(TUUID,1)
0088 };
0089
0090
0091 inline TBuffer &operator>>(TBuffer &buf, TUUID &uuid)
0092 { uuid.Streamer(buf); return buf; }
0093
0094
0095 TBuffer &operator<<(TBuffer &buf, const TUUID &uuid);
0096
0097 inline Bool_t operator==(const TUUID &u1, const TUUID &u2)
0098 { return (!u1.Compare(u2)) ? kTRUE : kFALSE; }
0099
0100 inline Bool_t operator!=(const TUUID &u1, const TUUID &u2)
0101 { return !(u1 == u2); }
0102
0103
0104 #endif