/*
* macros to define comparison operators for classes with small numbers of members.
*/
-#define WRITE_EQ_OPERATORS_5(type, a, b, c, d, e) \
- inline bool operator==(const type &l, const type &r) { \
- return l.a == r.a && l.b == r.b && l.c == r.c && l.d == r.d && l.e == r.e; \
- } \
- inline bool operator!=(const type &l, const type &r) { \
- return l.a != r.a || l.b != r.b || l.c != r.c || l.d != r.d || l.e != r.e; \
- }
-
-#define WRITE_CMP_OPERATORS_5(type, a, b, c, d, e) \
- inline bool operator>(const type &l, const type &r) { \
- return l.a > r.a || \
- (l.a == r.a && (l.b > r.b || \
- (l.b == r.b && (l.c > r.c || \
- (l.c == r.c && (l.d > r.d || \
- (l.d == r.d && l.e > r.e))))))); \
- } \
- inline bool operator<(const type &l, const type &r) { \
- return l.a < r.a || \
- (l.a == r.a && (l.b < r.b || \
- (l.b == r.b && (l.c < r.c || \
- (l.c == r.c && (l.d < r.d || \
- (l.d == r.d && (l.e < r.e)))))))); \
- } \
- inline bool operator>=(const type &l, const type &r) { \
- return l.a > r.a || \
- (l.a == r.a && (l.b > r.b || \
- (l.b == r.b && (l.c > r.c || \
- (l.c == r.c && (l.d > r.d || \
- (l.d == r.d && l.e >= r.e))))))); \
- } \
- inline bool operator<=(const type &l, const type &r) { \
- return l.a < r.a || \
- (l.a == r.a && (l.b < r.b || \
- (l.b == r.b && (l.c < r.c || \
- (l.c == r.c && (l.d < r.d || \
- (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 l.a == r.a && l.b == r.b && l.c == r.c && l.d == r.d && l.e == r.e && l.f == r.f && l.g == r.g; \
pool_id(-1) {
}
+ bool operator==(const file_layout_t&) const = default;
+
static file_layout_t get_default() {
return file_layout_t(1<<22, 1, 1<<22);
}
};
WRITE_CLASS_ENCODER_FEATURES(file_layout_t)
-WRITE_EQ_OPERATORS_5(file_layout_t, stripe_unit, stripe_count, object_size, pool_id, pool_ns);
-
std::ostream& operator<<(std::ostream& out, const file_layout_t &layout);
#endif