activemq-cpp-3.6.0
UUID.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _DECAF_UTIL_UUID_H_
19 #define _DECAF_UTIL_UUID_H_
20 
21 #include <decaf/util/Config.h>
22 #include <decaf/lang/Comparable.h>
23 #include <string>
24 #include <vector>
25 
26 namespace decaf {
27 namespace util {
28 
29  class UUIDImpl;
30 
66  class DECAF_API UUID : public lang::Comparable<UUID> {
67  private:
68 
69  UUIDImpl* uuid;
70 
71  public:
72 
80  static UUID randomUUID();
81 
91  static UUID nameUUIDFromBytes(const std::vector<char>& name);
92 
104  static UUID nameUUIDFromBytes(const char* name, std::size_t size);
105 
117  static UUID fromString(const std::string& name);
118 
119  public:
120 
129  UUID(long long mostSigBits, long long leastSigBits);
130 
131  virtual ~UUID();
132 
137  virtual int compareTo(const UUID& value) const;
138 
147  virtual bool equals(const UUID& value) const;
148 
154  virtual bool operator==(const UUID& value) const;
155 
162  virtual bool operator<(const UUID& value) const;
163 
169  virtual std::string toString() const;
170 
174  virtual long long getLeastSignificantBits() const;
175 
179  virtual long long getMostSignificantBits() const;
180 
196  virtual long long node();
197 
211  virtual long long timestamp();
212 
226  virtual int clockSequence();
227 
241  virtual int variant();
242 
256  virtual int version();
257 
258  };
259 
260 }}
261 
262 #endif /*_DECAF_UTIL_UUID_H_*/