activemq-cpp-3.9.5
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>
23#include <string>
24#include <vector>
25
26namespace decaf {
27namespace 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
273
287 int variant();
288
302 int version();
303
304 };
305
306}}
307
308#endif /*_DECAF_UTIL_UUID_H_*/
This interface imposes a total ordering on the objects of each class that implements it.
Definition Comparable.h:33
UUID(long long mostSigBits, long long leastSigBits)
Constructs a new UUID using the specified data.
int hashCode() const
Returns a Hash Code value for this UUID.
static UUID randomUUID()
Static factory to retrieve a type 4 (pseudo randomly generated) UUID.
virtual int compareTo(const UUID &value) const
Compare the given UUID to this one.
long long getLeastSignificantBits() const
virtual bool operator==(const UUID &value) const
Compares equality between this object and the one passed.
int variant()
The variant number associated with this UUID.
long long getMostSignificantBits() const
int clockSequence()
The clock sequence value associated with this UUID.
virtual bool equals(const UUID &value) const
Compares this UUID to the one given, returns true if they are equal.
static UUID nameUUIDFromBytes(const char *name, int size)
Static factory to retrieve a type 3 (name based) UUID based on the specified byte array.
static UUID fromString(const std::string &name)
Creates a UUID from the string standard representation as described in the toString() method.
virtual bool operator<(const UUID &value) const
Compares this object to another and returns true if this object is considered to be less than the one...
long long timestamp()
The timestamp value associated with this UUID.
std::string toString() const
Returns a String object representing this UUID.
UUID(const UUID &source)
Create a copy of the source UUID.
int version()
The version number associated with this UUID.
static UUID nameUUIDFromBytes(const std::vector< char > &name)
Static factory to retrieve a type 3 (name based) UUID based on the specified byte array.
long long node()
The node value associated with this UUID.
#define DECAF_API
Definition Config.h:29
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25