activemq-cpp-3.8.2
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, int size);
105 
117  static UUID fromString(const std::string& name);
118 
119  public:
120 
129  UUID(long long mostSigBits, long long leastSigBits);
130 
137  UUID(const UUID& source);
138 
147  UUID& operator= (const UUID& source);
148 
149  virtual ~UUID();
150 
155  virtual int compareTo(const UUID& value) const;
156 
165  virtual bool equals(const UUID& value) const;
166 
172  int hashCode() const;
173 
179  virtual bool operator==(const UUID& value) const;
180 
187  virtual bool operator<(const UUID& value) const;
188 
211  std::string toString() const;
212 
216  long long getLeastSignificantBits() const;
217 
221  long long getMostSignificantBits() const;
222 
238  long long node();
239 
255  long long timestamp();
256 
272  int clockSequence();
273 
287  int variant();
288 
302  int version();
303 
304  };
305 
306 }}
307 
308 #endif /*_DECAF_UTIL_UUID_H_*/
A class that represents an immutable universally unique identifier (UUID).
Definition: UUID.h:66
#define DECAF_API
Definition: Config.h:29
bool operator==(const ArrayPointer< T > &left, const U *right)
Definition: ArrayPointer.h:379
This interface imposes a total ordering on the objects of each class that implements it...
Definition: Comparable.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25