X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Finclude%2Fhealth.h;fp=src%2Fceph%2Fsrc%2Finclude%2Fhealth.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=b23a4d4e2b32e1d1fc3fdc5f99ec6ed658f2f572;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/include/health.h b/src/ceph/src/include/health.h deleted file mode 100644 index b23a4d4..0000000 --- a/src/ceph/src/include/health.h +++ /dev/null @@ -1,68 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab - -#pragma once - -#include -#include - -#include "include/encoding.h" - -// health_status_t -enum health_status_t { - HEALTH_ERR = 0, - HEALTH_WARN = 1, - HEALTH_OK = 2, -}; - -static inline void encode(health_status_t hs, bufferlist& bl) { - uint8_t v = hs; - ::encode(v, bl); -} -static inline void decode(health_status_t& hs, bufferlist::iterator& p) { - uint8_t v; - ::decode(v, p); - hs = health_status_t(v); -} -template<> -struct denc_traits { - static constexpr bool supported = true; - static constexpr bool featured = false; - static constexpr bool bounded = true; - static constexpr bool need_contiguous = false; - static void bound_encode(const bufferptr& v, size_t& p, uint64_t f=0) { - p++; - } - static void encode(const health_status_t& v, - buffer::list::contiguous_appender& p, - uint64_t f=0) { - ::denc((uint8_t)v, p); - } - static void decode(health_status_t& v, buffer::ptr::iterator& p, - uint64_t f=0) { - uint8_t tmp; - ::denc(tmp, p); - v = health_status_t(tmp); - } - static void decode(health_status_t& v, buffer::list::iterator& p, - uint64_t f=0) { - uint8_t tmp; - ::denc(tmp, p); - v = health_status_t(tmp); - } -}; - -inline std::ostream& operator<<(std::ostream &oss, const health_status_t status) { - switch (status) { - case HEALTH_ERR: - oss << "HEALTH_ERR"; - break; - case HEALTH_WARN: - oss << "HEALTH_WARN"; - break; - case HEALTH_OK: - oss << "HEALTH_OK"; - break; - } - return oss; -}