summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2012-05-24 10:57:22 -0700
committerSamuel Just <sam.just@inktank.com>2012-06-05 16:09:49 -0700
commitd5ab87798b9bae235545580672244e9da4f710cf (patch)
treed437666498f5c859ee8d9522658fd87607711128 /src/include
parent8e41ac150563e56ef37b0518cfd2e23be82c7f05 (diff)
downloadceph-d5ab87798b9bae235545580672244e9da4f710cf.tar.gz
src/: Add namespace and pool fields to hobject_t
From this point, hobjects in the ObjectStore will be globally unique. This will allow us to avoid including the collection in the ObjectMap key encoding and thereby enable efficient collection renames and, eventually, collection splits. Signed-off-by: Samuel Just <sam.just@inktank.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cmp.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/include/cmp.h b/src/include/cmp.h
index 3c431d9abef..d660c1923b0 100644
--- a/src/include/cmp.h
+++ b/src/include/cmp.h
@@ -1,5 +1,7 @@
#ifndef __CEPH_CMP_H
#define __CEPH_CMP_H
+#include <boost/tuple/tuple.hpp>
+#include <boost/tuple/tuple_comparison.hpp>
/*
* macros to define comparison operators for classes with small numbers of members.
@@ -102,4 +104,30 @@
(l.d == r.d && l.e <= r.e))))))); \
}
+#define WRITE_EQ_OPERATORS_7(type, a, b, c, d, e, f, g) \
+ inline bool operator==(const type &l, const type &r) { \
+ return (boost::make_tuple(boost::cref(l.a), boost::cref(l.b), boost::cref(l.c), boost::cref(l.d), boost::cref(l.e), boost::cref(l.f), boost::cref(l.g)) == \
+ boost::make_tuple(boost::cref(r.a), boost::cref(r.b), boost::cref(r.c), boost::cref(r.d), boost::cref(r.e), boost::cref(r.f), boost::cref(r.g))); \
+ } \
+ inline bool operator!=(const type &l, const type &r) { \
+ return (boost::make_tuple(boost::cref(l.a), boost::cref(l.b), boost::cref(l.c), boost::cref(l.d), boost::cref(l.e), boost::cref(l.f), boost::cref(l.g)) != \
+ boost::make_tuple(boost::cref(r.a), boost::cref(r.b), boost::cref(r.c), boost::cref(r.d), boost::cref(r.e), boost::cref(r.f), boost::cref(r.g))); \
+ }
+#define WRITE_CMP_OPERATORS_7(type, a, b, c, d, e, f, g) \
+ inline bool operator<=(const type &l, const type &r) { \
+ return (boost::make_tuple(boost::cref(l.a), boost::cref(l.b), boost::cref(l.c), boost::cref(l.d), boost::cref(l.e), boost::cref(l.f), boost::cref(l.g)) <= \
+ boost::make_tuple(boost::cref(r.a), boost::cref(r.b), boost::cref(r.c), boost::cref(r.d), boost::cref(r.e), boost::cref(r.f), boost::cref(r.g))); \
+ } \
+ inline bool operator>=(const type &l, const type &r) { \
+ return (boost::make_tuple(boost::cref(l.a), boost::cref(l.b), boost::cref(l.c), boost::cref(l.d), boost::cref(l.e), boost::cref(l.f), boost::cref(l.g)) >= \
+ boost::make_tuple(boost::cref(r.a), boost::cref(r.b), boost::cref(r.c), boost::cref(r.d), boost::cref(r.e), boost::cref(r.f), boost::cref(r.g))); \
+ } \
+ inline bool operator>(const type &l, const type &r) { \
+ return (boost::make_tuple(boost::cref(l.a), boost::cref(l.b), boost::cref(l.c), boost::cref(l.d), boost::cref(l.e), boost::cref(l.f), boost::cref(l.g)) > \
+ boost::make_tuple(boost::cref(r.a), boost::cref(r.b), boost::cref(r.c), boost::cref(r.d), boost::cref(r.e), boost::cref(r.f), boost::cref(r.g))); \
+ } \
+ inline bool operator<(const type &l, const type &r) { \
+ return (boost::make_tuple(boost::cref(l.a), boost::cref(l.b), boost::cref(l.c), boost::cref(l.d), boost::cref(l.e), boost::cref(l.f), boost::cref(l.g)) < \
+ boost::make_tuple(boost::cref(r.a), boost::cref(r.b), boost::cref(r.c), boost::cref(r.d), boost::cref(r.e), boost::cref(r.f), boost::cref(r.g))); \
+ }
#endif