CMS 3D CMS Logo

UUID.h

Go to the documentation of this file.
00001 #ifndef CLASSLIB_UUID_H
00002 # define CLASSLIB_UUID_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "classlib/utils/Error.h"
00007 # include "classlib/utils/iosfwd.h"
00008 
00009 namespace lat {
00010 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00011 
00012 # define CONST_UUID(a,b,c,d,e,f,g,h,i,j,k) \
00013     {0x##a,0x##b,0x##c,0x##d,0x##e,0x##f,0x##g,0x##h,0x##i,0x##j,0x##k}
00014 
00015 
00016 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00017 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00018 
00019 class UUID;
00020 class Time;
00021 
00022 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00023 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00024 
00025 std::ostream &operator<< (std::ostream &out, const UUID &id);
00026 
00027 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00028 
00029 class UUID
00030 {
00031 public:
00032     typedef unsigned char Binary [16];
00033 
00034     UUID (void);
00035     UUID (const char *text);
00036     UUID (const std::string &text);
00037     UUID (Binary raw);
00038     UUID (const UUID &x);
00039     UUID &operator= (const UUID &x);
00040 
00041     bool                operator== (const UUID &x) const;
00042     bool                operator!= (const UUID &x) const;
00043     bool                operator<  (const UUID &x) const;
00044 
00045     bool                isNull (void) const;
00046     Time                time (void) const;
00047     int                 type (void) const;
00048     int                 variant (void) const;
00049 
00050     void                format (char *buf) const;
00051 
00052     void                clear (void);
00053 
00054     static UUID         generate (void);
00055     static UUID         generateRandom (void);
00056     static UUID         generateTime (void);
00057 
00058 private:
00059     Binary              m_uuid;
00060 };
00061 
00062 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00063 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00064 
00065 } // namespace lat
00066 #endif // CLASSLIB_UUID_H

Generated on Tue Jun 9 17:38:55 2009 for CMSSW by  doxygen 1.5.4