|
| 1 | +/* |
| 2 | + Copyright (c) DataStax, Inc. |
| 3 | +
|
| 4 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + you may not use this file except in compliance with the License. |
| 6 | + You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | + Unless required by applicable law or agreed to in writing, software |
| 11 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + See the License for the specific language governing permissions and |
| 14 | + limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +#ifndef __UUID_OPERATORS_HPP_INCLUDED__ |
| 18 | +#define __UUID_OPERATORS_HPP_INCLUDED__ |
| 19 | + |
| 20 | +#ifdef __cplusplus |
| 21 | +#include "cassandra.h" |
| 22 | + |
| 23 | +/** |
| 24 | + * Compare two UUIDs for ordering |
| 25 | + * |
| 26 | + * This operator is useful to use CassUuid variables as std::map keys, for |
| 27 | + * instance. |
| 28 | + * |
| 29 | + * @param uuid1 A UUID |
| 30 | + * @param uuid2 Another UUID |
| 31 | + * @return true if, and only if, uuid1 is numerically less or equal than uuid2 |
| 32 | + */ |
| 33 | +bool operator<(const CassUuid& uuid1, const CassUuid& uuid2); |
| 34 | + |
| 35 | +/** |
| 36 | + * Compare two UUIDs for equality |
| 37 | + * |
| 38 | + * This operator is useful to use CassUuid variables as std::map keys, for |
| 39 | + * instance. |
| 40 | + * |
| 41 | + * @param uuid1 A UUID |
| 42 | + * @param uuid2 Another UUID |
| 43 | + * @return true if, and only if, uuid1 is numerically less or equal than uuid2 |
| 44 | + */ |
| 45 | +bool operator==(const CassUuid& uuid1, const CassUuid& uuid2); |
| 46 | +#endif |
| 47 | + |
| 48 | +#endif /* __UUID_OPERATORS_HPP_INCLUDED__ */ |
0 commit comments