stlab.adobe.com Adobe Systems Incorporated
zuid.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated and others
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #ifndef ADOBE_ZUID_HPP
10 #define ADOBE_ZUID_HPP
11 
12 #include <adobe/config.hpp>
13 
14 #include <boost/operators.hpp>
15 #include <boost/cstdint.hpp>
16 
17 #include <string>
18 
19 /*************************************************************************************************/
20 
21 /*
22  Relevant copyright information is provided below and may not be removed from this file.
23 
24  Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm.
25 */
26 
27 /*************************************************************************************************/
28 
29 /*
30  Copyright (c) 1990 - 1993, 1996 Open Software Foundation, Inc.
31  Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
32  Digital Equipment Corporation, Maynard, Mass.
33  Copyright (c) 1998 Microsoft.
34 
35  To anyone who acknowledges that this file is provided "AS IS" without any
36  express or implied warranty: permission to use, copy, modify, and
37  distribute this file for any purpose is hereby granted without fee,
38  provided that the above copyright notices and this notice appears in all
39  source code copies, and that none of the names of Open Software Foundation,
40  Inc., Hewlett-Packard Company, or Digital Equipment Corporation be used in
41  advertising or publicity pertaining to distribution of the software without
42  specific, written prior permission. Neither Open Software Foundation, Inc.,
43  Hewlett-Packard Company, Microsoft, nor Digital Equipment Corporation makes
44  any representations about the suitability of this software for any purpose.
45 */
46 
47 /*************************************************************************************************/
48 
49 /*
50  MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
51 
52  Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights
53  reserved.
54 
55  License to copy and use this software is granted provided that it is
56  identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in
57  all material mentioning or referencing this software or this function.
58 
59  License is also granted to make and use derivative works provided that such
60  works are identified as "derived from the RSA Data Security, Inc. MD5
61  Message-Digest Algorithm" in all material mentioning or referencing the
62  derived work.
63 
64  RSA Data Security, Inc. makes no representations concerning either the
65  merchantability of this software or the suitability of this software for
66  any particular purpose. It is provided "as is" without express or implied
67  warranty of any kind.
68 
69  These notices must be retained in any copies of any part of this
70  documentation and/or software.
71 */
72 
73 /*************************************************************************************************/
74 
75 namespace adobe {
76 
77 /*************************************************************************************************/
78 
79 struct uuid_t
80 {
81 #if !defined(ADOBE_NO_DOCUMENTATION)
82  boost::uint32_t data1_m;
83  boost::uint16_t data2_m;
84  boost::uint16_t data3_m;
85  boost::uint8_t data4_m[8];
86 #endif
87 };
88 
89 class zuid_t
90 #if !defined(ADOBE_NO_DOCUMENTATION)
91  : private boost::totally_ordered<zuid_t>
92 #endif
93 {
94 public:
95 #if !defined(ADOBE_NO_DOCUMENTATION)
96  zuid_t ();
97  zuid_t (const zuid_t&);
98 #endif
99 
100  explicit zuid_t (const uuid_t&);
101  explicit zuid_t (const std::string&);
102  explicit zuid_t (const char*);
103 
104  zuid_t (const zuid_t& name_space, const std::string& name);
105 
106 #if !defined(ADOBE_NO_DOCUMENTATION)
107  zuid_t& operator = (const zuid_t&);
108  zuid_t& operator = (const uuid_t&);
109 #endif
110 
111  std::string str () const;
112  char* c_str () const;
113 
114  static const zuid_t null;
115 
116 #if !defined(ADOBE_NO_DOCUMENTATION)
117  enum { string_size_k = 36 };
118 
119 private:
120  friend bool operator == (const zuid_t& a, const zuid_t& b);
121  friend bool operator < (const zuid_t& a, const zuid_t& b);
122 
123  struct zeroed { };
124 
125  zuid_t(zeroed);
126 
127  uuid_t uuid_m;
128 #endif
129 };
130 
131 /*************************************************************************************************/
132 #if !defined(ADOBE_NO_DOCUMENTATION)
133 
134 bool operator == (const zuid_t& a, const zuid_t& b);
135 bool operator < (const zuid_t& a, const zuid_t& b);
136 
137 #endif
138 
139 /*************************************************************************************************/
140 
141 } // namespace adobe
142 
143 /*************************************************************************************************/
144 
145 #endif
146 
147 /*************************************************************************************************/
UUID-like identifier generator.
Definition: zuid.hpp:89
bool operator==(const circular_queue< T > &x, const circular_queue< T > &y)
static const zuid_t null
Definition: zuid.hpp:114
bool operator<(const step_iterator_adaptor< D, IT, S_FN > &p1, const step_iterator_adaptor< D, IT, S_FN > &p2)
Definition: iterator.hpp:372

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google